Commit Graph

9551 Commits

Author SHA1 Message Date
Benjamin Carlsson
da6e68951b Preserve inline TUI scrollback in Windows Terminal (#39619)
## Why

Windows Terminal can discard rows scrolled through a partial DEC scroll region instead of retaining them in terminal scrollback.

## What changed

- Detect Windows Terminal, including via `WT_SESSION`, and use full-screen scrolling for inline viewport growth and history insertion.
- Keep the existing terminal-wrapped history behavior for Zellij while centralizing terminal-specific scrollback selection.

## Testing

Add VT100-backed tests covering strategy selection and preservation of scrollback during history insertion and viewport growth.

GitOrigin-RevId: 209a7a8053a1fcf911d6e0aee764e563b8725bd1
2026-08-20 06:39:20 +00:00
Benjamin Carlsson
4bb7804a23 Apply composer editing preferences to TUI text prompts (#39618)
## What changed

- Initialize custom text prompts with the main composer's editor keybindings and Vim setting.
- Support Vim mode transitions, operator sequences, cursor styles, keymap contexts, and mode-aware footer hints in these prompts.
- Start Vim prompts in insert mode, use the first `Esc` to enter normal mode, and preserve `Esc` cancellation outside Vim.

## Testing

- Cover remapped editor and Vim commands, mode and context transitions, paste handling, cancellation, and footer rendering at different widths.

GitOrigin-RevId: 7a678310639dafb938084197df23d6d2a080a051
2026-08-20 06:35:47 +00:00
Jeremy Rose
bc3545b805 Validate linked worktrees before inheriting project trust (#39616)
## Why

A checkout could point its `.git` file at a trusted repository's worktree
directory without proving that the repository had registered that checkout.
This could cause project configuration from an unrelated checkout to be treated
as trusted.

## What changed

- Verify the linked worktree's `gitdir` backlink, `commondir`, registered
  checkout, and main checkout ownership before resolving the main repository's
  trust key.
- Reject missing, oversized, symlinked, mismatched, or swapped Git metadata.
- Preserve valid linked worktrees that use path aliases, separate Git
  directories, or non-UTF-8 POSIX paths.

## Testing

Add resolver and config-loading coverage for forged worktrees, metadata races,
case-sensitive paths, moved worktrees, and host MCP startup from project config.

GitOrigin-RevId: 6052a7d10ad2d613436f20175c356abdef8c758e
2026-08-20 06:29:32 +00:00
Jeremy Rose
250b5ea2bf Bind MCP OAuth refresh tokens to their issuer (#39615)
## Why

An authorization server discovered for an MCP server can change. A stored refresh token must not be sent to a different issuer than the one that originally granted it.

## What changed

- Persist the discovered authorization server issuer with new OAuth credentials and preserve it across refreshes.
- Validate that issuer against a single pinned metadata snapshot before refreshing or adopting stored refresh credentials.
- Require reauthentication when refresh credentials have no issuer or the issuer changed. An unexpired access token can still be used without exposing its refresh token.

## Testing

Add coverage for issuer persistence, missing and changed issuers, metadata changes during startup, and refresh-token preservation.

GitOrigin-RevId: 07e48ba892f627428a28bbed5cca4ad703e2a5fd
2026-08-20 06:25:17 +00:00
sayan-oai
530c1aed58 Prevent apply_patch from widening write permissions (#39614)
## Why

Deriving permissions from the parent of an already-writable patch target can
unnecessarily grant write access outside the intended workspace.

## What changed

Skip targets already covered by the active filesystem sandbox policy before
deriving additional parent-directory permissions. Targets outside the writable
area continue to request the required parent access.

## Testing

Added unit and CLI regression coverage for workspace-directory targets,
already-writable parents, and symlink escapes outside the workspace.

GitOrigin-RevId: 187109ff0b56a1a399cb8a9981b7e822977025d5
2026-08-20 06:21:54 +00:00
jif
929e2b9c1d Harden MCP OAuth fallback credential writes (#39611)
## Why

The fallback file contains OAuth credentials, so it must be private from the
moment it is created and writes must not follow links to another path.

## What changed

- Create the fallback file with mode `0600` on Unix before writing credentials.
- Reject symlinks and other non-regular files on Unix and Windows, including
  Windows reparse points.
- Truncate and update an existing regular file through the validated file
  handle, restoring private Unix permissions when needed.

## Testing

Added coverage for creation under a permissive umask, updates through an
existing hard link, permission restoration, and symlink rejection.

GitOrigin-RevId: d3e4be52e8f4cebb66c59d496a7f77a952a2d0d9
2026-08-20 06:17:48 +00:00
jif
c19482a768 Limit Bazel integration test threads on macOS (#39609)
## What changed

- Add a `test_threads` option to `codex_rust_crate` that sets
  `RUST_TEST_THREADS` for sharded integration tests when configured.
- Run the `core` and `app-server` Bazel integration tests with one Rust test
  thread on macOS, leaving the thread count unchanged on other platforms.

GitOrigin-RevId: 118147413eb141f557d9ee82858860617d61acce
2026-08-20 06:13:28 +00:00
xl-openai
5c305eb50b Harden skill installation against unsafe symlinks (#39608)
## What changed

- Require selected skill paths to resolve within the cloned repository and reject
  symlinked path components.
- Reject special files and symlinks that escape the selected skill or resolve to
  anything other than a regular file.
- Add regression tests showing that escaping symlinks are rejected while links
  to regular files within the skill are installed as file contents.

GitOrigin-RevId: d4c3f09fb630dea96b34ea5552de571b36f1ceca
2026-08-20 06:10:03 +00:00
pakrym-oai
186b449bc2 Resolve model-provided shells by type (#39607)
## Why

A model-provided shell path should select the requested shell type without
allowing that path to determine which executable Codex runs.

## What changed

- Resolve model-provided shells through Codex's normal shell discovery and
  fallback logic after detecting their type.
- Keep the configured packaged zsh executable when the zsh-fork feature is
  enabled and the file exists.
- Update shell, unified exec, and network approval expectations to use the
  resolved local executable and arguments.

GitOrigin-RevId: ebe6f7eec2cfd1c0548d5bf1a26b7a30dba02cc2
2026-08-20 06:03:25 +00:00
Adam Perry @ OpenAI
6869d17cc2 Enable user namespaces in shared CI setup (#39606)
## What changed

- Enable unprivileged user namespaces for every Linux job that uses the shared
  `setup-ci` action.
- Disable AppArmor's unprivileged user namespace restriction when that sysctl is
  available.
- Remove the duplicate setup from the two nextest workflow jobs.

GitOrigin-RevId: a5aebe0795ada435e687826134411c8b1c28bd98
2026-08-20 05:59:06 +00:00
Eric Traut
430bc36fb2 Hide approved automatic review warnings in the TUI (#39605)
## What changed

- Ignore Guardian warning notifications that report a successful automatic approval review, keeping approved reviews out of TUI history.
- Continue displaying all other Guardian warnings.
- Extend the approved-review history test to cover the notification path.

GitOrigin-RevId: 719e84bc5b20c0a5364d10f84be9c6ac96158719
2026-08-20 05:54:19 +00:00
Eric Traut
3434c2545b Preserve queued TUI input semantics (#39604)
## Why

Paste placeholders and deferred slash-command parsing can hide the meaning of an input until it is expanded or a session is configured. Draining such input as an ordinary message can accidentally treat pasted text beginning with `!` as a shell command or lose `/plan` behavior.

## What changed

- Track paste-expanded inputs that begin with `!` as literal model input through history, queue editing, retries, and startup queues.
- Defer `/plan` parsing when session or model state is unavailable, then submit it in plan mode with shell escapes disabled.
- Drain queued input only after session configuration, and keep later queued prompts pending when an initial prompt cannot be submitted.
- Suppress queue auto-send before applying a replayed thread session so input from the outgoing thread is not submitted during restoration.

## Testing

Add coverage for direct, recalled, edited, interrupted, rejected, startup-queued, and plan-mode paste flows, including placeholder collisions and rejected initial images.

GitOrigin-RevId: d482220d8df21754f166fea5b54e9945f622a978
2026-08-20 05:49:49 +00:00
iceweasel-oai
8e7f646974 Use in-process parsing for PowerShell command classification (#39602)
## What changed

- Route PowerShell wrapper extraction and Windows safe-command classification through the tree-sitter lowerer.
- Compile the PowerShell AST subprocess parser only in tests, where it remains available as an oracle.

GitOrigin-RevId: 3690bc32e8987ac9de820ef39ff7401d98ea8d83
2026-08-20 05:45:13 +00:00
rka-oai
198f42067a Keep async user messages on the direct tool surface (#39601)
## What changed

- Register `send_user_message_async` as `DirectModelOnly` so supported models can call it directly without exposing it through code mode.
- Exercise the async message flow with a code-mode-only model configuration and verify that the tool remains directly visible.

GitOrigin-RevId: ce22d5f63471ce90ac55ae2f3d0048f6cda57e01
2026-08-20 05:42:20 +00:00
jif
f6950546e5 Protect macOS Seatbelt writable root anchors (#39599)
## Why

A sandboxed process could replace a writable directory root, changing the
authority boundary used to construct a later sandbox policy.

## What changed

- Deny unlinking or renaming directory roots granted write access by Seatbelt,
  while preserving replacement and deletion behavior for writable files.
- Reject writable roots with nested symlink components and report these as
  Seatbelt preparation errors instead of network proxy failures.
- Normalize writable roots before adding them to the generated Seatbelt policy.

## Testing

Add coverage for symlink rejection, error classification, directory-root
replacement and rename protection, newly created roots, and writable file
replacement.

GitOrigin-RevId: ab1ed4e55f20034bc43e028e6529d3d1f0d8181c
2026-08-20 05:36:23 +00:00
sayan-oai
d75c85f651 Separate thread settings from environment configuration (#39597)
## Why

Environment-owned permission profiles and workspace roots must remain effective
without being persisted or restored as thread-owned settings.

## What changed

- Keep thread settings snapshots and restore data separate from the effective
  configuration supplied by the primary environment.
- Use resolved environment permissions, active profiles, workspace roots, and
  network policy when building turn context and session events.
- Preserve environment selections when agents are evicted, resumed, or spawned,
  and validate owner configuration when it becomes ready.
- Start memory initialization only after the primary environment is configured.

## Testing

- Extend remote-environment and multi-agent tests to cover settings persistence,
  owner permission profiles, workspace roots, spawning, eviction, and resume.

GitOrigin-RevId: d82f126981cd0190233020bbdd61d96c70558868
2026-08-20 05:29:12 +00:00
willwang-openai
8f4a48a6ad Keep marketplace upgrade state out of config (#39595)
## What changed

- Stop writing `last_updated` and `last_revision` to marketplace entries in
  `config.toml`; keep the activated revision in
  `.codex-marketplace-install.json` instead.
- Use installed marketplace metadata to detect up-to-date checkouts.
- Snapshot the installed marketplace before activation and roll back a stale
  upgrade if another installation changed the destination concurrently.

## Testing

- Verify marketplace add and upgrade operations leave `config.toml` unchanged.
- Cover restoring a newer concurrently installed marketplace when a stale
  activation is rejected.

GitOrigin-RevId: 10942c3fc7c6c3f68b7d5953e8c1b5e86bf71866
2026-08-20 05:24:56 +00:00
Angad Singh
1bfabb21fe Raise the MCP tool name limit to 128 bytes (#39594)
## Why

The Responses API accepts tool names up to 128 bytes, but MCP tool name
normalization limited model-visible names to 64 bytes.

## What changed

- Preserve MCP tool names up to the 128-byte Responses API limit.
- Continue shortening and hashing names that exceed the limit so generated
  names remain bounded and unique.

## Testing

- Cover names at the 128-byte boundary and immediately above it.
- Verify distinct long names remain 128 bytes and code-mode compatible.

GitOrigin-RevId: 75544d00e75dd0e9328b3e2ac763d26f9cc99a48
2026-08-20 05:21:09 +00:00
Adam Perry @ OpenAI
493e0efb7b Prevent SQLx warnings from feeding back into SQLite logs (#39592)
## Why

Warnings emitted while querying SQLite or acquiring a connection must not be
written back through the same SQLite log sink.

## What changed

- Disable the `sqlx::query` and `sqlx::pool::acquire` targets for the SQLite
  log filter.
- Keep warnings from other `sqlx` targets so useful diagnostics remain
  available.

## Testing

Extend the log filter test to verify that query and pool-acquisition warnings
are dropped while another `sqlx` warning is retained.

GitOrigin-RevId: cec9d4e07d113de8eccec7445ede0ae68e21886d
2026-08-20 05:16:59 +00:00
xli-oai
e7c0e8eb9f Harden plugin manifest handling during installation (#39590)
## Why

Plugin installation skips symlinks while copying a plugin into the cache. A
symlinked manifest could therefore be used during source validation but omitted
from the staged copy, allowing a lower-precedence manifest to take its place.

## What changed

- Require discoverable manifests and their parent directories to be regular
  files and directories, rejecting symlinks and other non-regular entries at a
  higher-precedence manifest path.
- Verify that staging preserves the selected manifest path and contents before
  activating the cached plugin.
- Preserve generated fallback manifests by injecting and validating them in the
  staged plugin.

## Testing

Add coverage for symlinked manifest files and directories, precedence changes,
and fallback-manifest staging.

GitOrigin-RevId: 1b69c1e75cdfecb8cab4070a32aa9739833a70de
2026-08-20 05:10:57 +00:00
Dylan Hurd
4b450d2f1b Preserve unparsed shell wrappers in exec policy (#39588)
## Why

Reducing a heredoc shell script to its inner executable lets a prefix rule for
that executable apply to the entire wrapper, even though the full script was
not parsed as a plain command.

## What changed

- Fall back to evaluating the complete shell wrapper when plain-command parsing
  fails, including for heredoc scripts.
- Keep these commands sandboxed when only the inner executable is allowed.
- Propose the full wrapper as the exec policy amendment when approval is needed.

## Testing

Added exec policy, Unix escalation, and approval scenario coverage for unparsed
and heredoc shell wrappers.

GitOrigin-RevId: 8f65133acb6b7c638263917e1d9137e45990772c
2026-08-20 05:07:17 +00:00
Jeremy Rose
3bebaea8f2 Isolate IPC in Bubblewrap sandboxes (#39586)
## What changed

- Pass `--unshare-ipc` when building Bubblewrap arguments for both restricted-filesystem and full-filesystem sandbox paths.
- Update the Bubblewrap argument tests to cover the new namespace flag.

GitOrigin-RevId: 61fb1d5150d09626a3b6ee7a9c6a508108c52e80
2026-08-20 05:03:49 +00:00
jif
6141747444 Test plugin sync isolation from repository Git config (#39585)
## Why

The pre-trust remote lookup must not inherit Git configuration from the
repository that launched Codex, where URL rewrites can invoke custom transport
helpers during an automatic plugin sync.

## What changed

- Add a Unix regression test that runs the startup lookup from a repository
  with a local `insteadOf` rewrite to an `ext` transport and verifies that the
  helper is not executed.
- Reuse `OPENAI_PLUGINS_GIT_URL` for the lookup so the production command and
  regression fixture target the same remote.

GitOrigin-RevId: e53af4a82a4206c31bf0f4733f908dcc064a4795
2026-08-20 04:59:20 +00:00
Adam Perry @ OpenAI
8e2265196e Add a just recipe for assembling Codex packages (#39584)
## What changed

- Add `just assemble-codex-package` as the documented entry point for the package builder.
- Export `CODEX_REPO_ROOT` from `just` and release CI, and require the package builder to use it for repository-relative inputs.
- Resolve the ripgrep and zsh manifests relative to their Python modules.

GitOrigin-RevId: 039d12107a49171f064b0119adc6b99cf97c6c1e
2026-08-20 04:55:47 +00:00
iceweasel-oai
3b45c29062 Stop treating Git commands as inherently safe (#39524)
## Why

Repository configuration can cause even read-only Git commands to execute
helpers, so Git command arguments alone are not enough to establish trust.

## What changed

- Remove Git commands from the known-safe command classification on Unix and
  Windows, including commands nested in supported shells.
- Under the `unless-trusted` approval policy, require approval for commands such
  as `git status` unless an explicit execution policy rule allows them.

## Testing

- Cover direct, shell-wrapped, absolute-path, and PowerShell Git commands.
- Verify `git status` approval behavior with and without an explicit allow rule.

GitOrigin-RevId: dd04e0ddca0c56ba64ae64abe6e658bae7bf5a4d
2026-08-19 18:01:14 +00:00
joeytrasatti-openai
1b450c7912 Persist thread section moves before the first turn (#39523)
## Why

New non-ephemeral threads have no persisted rollout or preview until their first
turn, so moving them into a section could leave them absent from section-filtered
thread lists.

## What changed

- Materialize and flush a non-ephemeral thread before applying an explicit
  section move.
- Include explicitly sectioned threads with empty previews in section-filtered
  queries, and update the partial indexes to cover them.

## Testing

- Add an app-server test that moves a newly started thread into and out of the
  pinned section before its first turn.
- Cover empty-preview threads in recency and section-position query tests.

GitOrigin-RevId: aa3c4daf9890f06c08b93cd60f146099cbc6cfb2
2026-08-19 17:57:40 +00:00
Charlie Marsh
ffad922340 Isolate automatic plugin Git operations (#39520)
## Why

Background marketplace and plugin refreshes can otherwise inherit repository-local or command-scoped Git configuration from the project that launched Codex. That configuration can redirect remotes or invoke Git helpers during an automatic operation.

## What changed

- Run automatic marketplace upgrades, plugin cache refreshes, and curated marketplace lookups with repository-scoped Git environment variables removed and a temporary trusted repository under the Codex home.
- Carry the automatic/manual trust mode through marketplace upgrades and plugin materialization.
- Preserve the caller's Git configuration for explicit marketplace upgrades, plugin installs, and refreshes.

## Testing

- Add regression coverage for repository URL rewrites, protocol helpers, command-scoped configuration, and manual Git filters.

GitOrigin-RevId: 957f45fa3bd7ce7e1b83355f276cf65dc5e99c8e
2026-08-19 17:34:00 +00:00
Tamir Duberstein
18937b2265 Use mem::take to drain unified exec output buffers (#39515)
## What changed

Replace the custom `HeadTailBuffer::drain` helper with `std::mem::take` at
the output collection call site. This moves the buffered output out while
resetting the shared buffer to its default empty state.

GitOrigin-RevId: 7a93d1312f2cea0d7913a5264eeb01726b45e0ea
2026-08-19 16:30:10 +00:00
Tamir Duberstein
db675cc005 Use stored item types when materializing turn summaries (#39514)
## What changed

- Select user and agent summary items using the materialized `item_type` column.
- Fall back to the type in `item_json` when `item_type` is empty so rows written by older clients still produce the correct summary.

## Testing

- Extend the summary materialization test to cover items inserted without a stored item type.

GitOrigin-RevId: 45ca1107900e9b8d46561cea210a27ecd661cedc
2026-08-19 16:20:21 +00:00
jif
992f5c681f Track built-in control tool calls in analytics (#39510)
## What changed

- Emit `codex_control_tool_call_event` for built-in control tools such as
  `request_user_input`, `update_plan`, `view_image`, and goal tools.
- Record correlation and timing metadata plus completed, failed, rejected, or
  interrupted outcomes, and include these calls in turn-level tool counts.
- Keep tool arguments out of control-tool analytics events.

## Testing

- Extend the app-server turn profile test to cover successful and failed
  control tools, event correlation, turn counts, and argument exclusion.

GitOrigin-RevId: c20f73dfb79654e31b4b5040eddb0e0d91cae10d
2026-08-19 15:55:38 +00:00
jif
6972c57c78 Test disabled enhanced Node REPL transcript images separately (#39509)
## What changed

- Add a focused Code Mode integration test with Guardian transcript images enabled and enhanced Node REPL transcripts disabled.
- Verify that the Guardian request and parent request omit both the screenshot and its surrounding transcript markers.
- Remove this configuration from the broader parameterized transcript-evidence test.

GitOrigin-RevId: 1309de12337a28a7e1d49eca509ba73207d4d9be
2026-08-19 15:47:56 +00:00
jif
eb5a25aaa2 Test code mode notifications without a sync tool call (#39506)
GitOrigin-RevId: 9ee4dfb93fee83737fa555bb6111101991417a4d
2026-08-19 15:42:22 +00:00
jif
b0cdcce616 Test text stringify errors in the code mode runtime (#39505)
## What changed

Move circular-value coverage for the `text()` helper from the core integration
suite to the in-process code mode runtime tests. Verify that stringification
returns no content and surfaces the V8 circular-structure error without needing
a mock server or network access.

GitOrigin-RevId: d506591af5ae8ce0a8c7305d633a7b0f2e458335
2026-08-19 15:37:26 +00:00
jif
36268f177f Use a narrow fixture for the unified image resize test (#39501)
## What changed

Update the unified image budget integration test to resize a `6401x1` image to
`6000x1` and verify that the model receives the corresponding resize notice.

GitOrigin-RevId: 401e9728dc4bd6f0122bbc62f996a0b961e22b3a
2026-08-19 15:32:59 +00:00
jif
83915c7ca1 Correct normalized dynamic tool coverage across response modes (#39497)
## What changed

- Keep validating normalized dynamic tool visibility for both Responses and Responses Lite.
- Exercise the normalized dynamic tool call and its returned metadata only for Responses Lite.
- Let the standard Responses case complete in a single mocked response without expecting a dynamic tool request.

GitOrigin-RevId: 7793e6f6df07fc58c2976a773a1198496af08dfd
2026-08-19 15:26:15 +00:00
jif
af70018080 Use default timeouts in cyber exec policy tests (#39496)
## What changed

Stop setting explicit one-second `timeout_ms` and `yield_time_ms` values in the
mock command calls. The shell command and unified exec variants now use their
default timing behavior while testing cyber exec policy.

GitOrigin-RevId: b1c25304ca47e7b08f023fe678467fc00330158b
2026-08-19 15:21:11 +00:00
jif
94a831d9dd Test panoramic Guardian transcript image resizing (#39494)
## What changed

Use a 2049-by-32 image in the Guardian transcript evidence test and verify that
it is resized to 2048-by-32 while preserving its aspect ratio.

GitOrigin-RevId: 4b1b404c0fc76c46739379ef154e629bf8d669f3
2026-08-19 15:17:02 +00:00
Tamir Duberstein
fcdf2b5014 Make head-tail buffer capacity const generic (#39493)
## What changed

- Parameterize `HeadTailBuffer` by a const `MAX_BYTES` value and derive its
  head and tail budgets from that value.
- Keep `UNIFIED_EXEC_OUTPUT_MAX_BYTES` as the default capacity for production
  call sites.
- Update focused buffer tests to select their smaller capacities through the
  type parameter.

GitOrigin-RevId: 106e81a2c2db935f7f77a4f301ef591017958287
2026-08-19 14:49:58 +00:00
jif
d1d51f6315 Move shell snapshot tests into shell-command (#39480)
## What changed

- Co-locate the Bash and zsh snapshot-script tests with
  `codex-shell-command`, where `snapshot_script` is implemented.
- Add `tempfile` as a dev dependency for the relocated tests.
- Keep the higher-level snapshot lifecycle tests in `codex-core`.

GitOrigin-RevId: 6d5e9ab95962722f7c89ea40512bd70ee81d8da2
2026-08-19 12:56:08 +00:00
jif
e741cd9ace Consolidate Guardian extensions into codex-guardian-v2 (#39474)
## What changed

- Move the Guardian thread lifecycle contributor and subagent-spawn context into `codex-guardian-v2`.
- Install the lifecycle contributor and asynchronous risk scorer through a single extension entry point.
- Remove the redundant `codex-guardian` crate and group the existing scorer implementation under `async_scorer`.

GitOrigin-RevId: 97141190c843e588b8c09c9ccd3fe00e1fae39a4
2026-08-19 11:59:23 +00:00
rka-oai
f5a3dc5540 Remove the feature gate for async user messages (#39452)
## What changed

- Expose `send_user_message_async` to root agents whenever the selected model advertises support for it.
- Retain `send_async_message` as a removed compatibility flag so existing configuration is accepted without controlling tool availability.
- Update the async message test to cover model-driven tool exposure without enabling the legacy flag.

GitOrigin-RevId: 558b427c2b203a057dd7c836e0ec702ae6134346
2026-08-19 09:01:23 +00:00
alexsong-oai
3929c99a97 Refresh expired AWS credentials for Bedrock (#39410)
## Why

Bedrock sessions that use the AWS SDK credential chain need a way to recover when credentials expire during a request.

## What changed

- Add `aws.auth_refresh` provider configuration with an `aws` command, arguments, and a configurable timeout.
- Run the command for refreshable Bedrock authentication failures, reload the SDK credentials, re-sign the request, and retry it.
- Share refresh state across matching provider configurations so concurrent failures invoke the command only once. Bearer tokens, command auth, and static environment credentials do not use this recovery path.

## Testing

- Add coverage for configuration validation, refreshable error classification, concurrent refresh sharing, and an end-to-end retry signed with refreshed credentials.

GitOrigin-RevId: 0302fe3aabdbc1097e7bd62a74d407ba38a3cc57
2026-08-19 04:46:58 +00:00
Adam Perry @ OpenAI
6cc2ba8a95 Support FD mounts with older system Bubblewrap versions (#39404)
## Why

System Bubblewrap installations that lack `--ro-bind-fd` cannot directly create
the descriptor-backed read-only mounts used by the Linux sandbox.

## What changed

- Detect `--ro-bind-fd` support when probing system Bubblewrap.
- On older versions, translate descriptor-backed mounts to `/proc/self/fd`
  read-only binds and pass their descriptors and destinations to the trusted
  inner sandbox stage for verification.
- Reject malformed, duplicate, mismatched, or symlink-substituted mounts, and
  close inherited descriptors before running sandboxed code.

## Testing

Added unit coverage for capability detection, legacy argument translation,
invalid mount rejection, inode verification, and descriptor closure.

GitOrigin-RevId: dfc0a457b572cdd9aed093fb5abf57360e9724a2
2026-08-19 04:06:50 +00:00
Adam Perry @ OpenAI
956f590ad5 Remove npm package staging from repo checks (#39402)
## What changed

Remove the `repo-checks` steps that staged a Codex npm package from a fixed
release workflow and uploaded the resulting tarball as an artifact.

GitOrigin-RevId: bb3756188eeea2ed236710273234e70f17dc9e9d
2026-08-19 03:52:59 +00:00
Eric Traut
14a8ac89af Prefer the most recent session when queueing by name (#39385)
## What changed

- Resolve duplicate exact-name matches to the most recent session instead of rejecting the queue request as ambiguous.
- Include non-interactive and custom-source sessions in name-based queue lookups.
- Prefer state database matches before falling back to rollout scanning.

## Testing

- Cover queueing to non-interactive and custom-source sessions, including duplicate names and a state database match that avoids importing a legacy rollout.

GitOrigin-RevId: 5b019da0a950c9381d324a09a21c78a9d0ac2252
2026-08-19 02:45:45 +00:00
Eric Traut
8843960ba0 Scope TUI approval requests to their threads (#39372)
## Why

Approval and item IDs can collide across concurrent threads. Tracking pending app-server approvals by ID alone can therefore resolve, submit, or dismiss a request from the wrong thread.

## What changed

- Key command execution, file change, and permissions approvals by both thread ID and approval ID.
- Route approval responses through the originating thread and require the thread to match when processing resolution notifications or dismissing approval prompts.
- Canonicalize parseable thread IDs so equivalent UUID representations still match.

## Testing

- Cover colliding approval IDs across threads, mismatched resolution notifications, prompt dismissal, and response routing for primary and background threads.

GitOrigin-RevId: c2d899a1e4b6a6413c78a0595a5311f5fabb9815
2026-08-19 02:28:42 +00:00
sayan-oai
fde2156057 Enforce environment MCP policies (#39335)
## What changed

- Add environment-provided MCP restrictions for configured and plugin-provided servers.
- Disable attachment-scoped servers while their environment configuration is pending, failed, or unselected, while preserving selected-plugin access and the controller-owned Apps server.
- Apply the resolved policy to runtime startup, model tool exposure, telemetry, OAuth flows, and skill dependency installation.

## Testing

- Cover policy filtering for configured and plugin servers, environment state transitions, Apps ownership, and managed OAuth rejection.

GitOrigin-RevId: 7ca5d4dda14068e758497f88835d5cba685e159e
2026-08-19 01:26:16 +00:00
Abhinav
d35e5495f9 Route hook MCP calls through current connections (#39331)
## What changed

- Execute hook-triggered MCP calls through the runtime's latest connection set instead of preparing a separate catalog-bound call.
- Keep hook calls from waiting for server startup or reconnecting, and reject disconnected servers immediately.
- Apply the shorter of the hook-requested timeout and the server's configured tool timeout.

## Testing

- Update connection manager tests to cover non-waiting calls and disabled tool filters.

GitOrigin-RevId: 3166b2d1e26d9ae2b8b3a648b4d0897cc260eb93
2026-08-19 01:15:10 +00:00
charlesgong-openai
67ed4e717a Stop migrating Cursor sandbox settings (#39325)
## What changed

- Ignore `.cursor/sandbox.json` during external agent config migration.
- Continue importing supported settings from `.cursor/cli-config.json`.

## Testing

- Update app-server migration coverage to verify that environment variables from `cli-config.json` are imported.

GitOrigin-RevId: 6094f1cb6f698392d58056f826da21c1f1389a1b
2026-08-19 01:06:12 +00:00
cooper-oai
b537d5a097 Enforce workspace restrictions for header authentication (#39322)
## What changed

- Validate externally supplied header credentials against configured ChatGPT workspace restrictions using their `chatgpt-account-id` header.
- Reject header credentials with a missing or disallowed account ID, including credentials returned during refresh, without replacing the previously cached authentication.
- Document that identity headers must be bound to validated credentials because Codex uses them for managed authentication policy.

## Testing

- Add coverage for allowed, disallowed, and missing account IDs.
- Add coverage for rejecting a refresh that changes to a disallowed workspace.

GitOrigin-RevId: 3e3db2607cd8f9f1b8000472342e42e4b1cf00b2
2026-08-19 00:28:52 +00:00