Commit Graph

9578 Commits

Author SHA1 Message Date
felixxia-oai
478dbe9df0 Make Guardian v2 parent compaction reuse configurable (#39691)
## What changed

- Add `features.guardianv2.reuse_parent_compaction`, defaulting to `true` to preserve existing behavior.
- When disabled, omit parent compaction items from Guardian v2 contributor requests.
- Cover configuration parsing and disabled-reuse request construction.

GitOrigin-RevId: 0cf7c0ac7a2567c9f73a3f9724df6f6a6170e995
2026-08-20 10:57:03 +00:00
Ben Romano
312b62ac95 Trace MCP runtime refresh coordination (#39667)
## What changed

Add named tracing spans for MCP dirty-state refreshes and time spent waiting
to acquire the refresh semaphore.

GitOrigin-RevId: 1dbb3572d2061581beb83b3de098d6ec91791104
2026-08-20 08:36:00 +00:00
pakrym-oai
2584e88cad Improve no-follow filesystem behavior across platforms (#39666)
## What changed

- Use `statx` for no-follow metadata on Linux so `created_at_ms` includes the birth time when the filesystem provides it, with a fallback for unavailable or blocked `statx` calls.
- Mark files and directories for deletion explicitly on Windows after opening them without traversing reparse points.
- Cover create, write, metadata, remove, and link-rejection behavior for local and remote filesystems, including sandboxed execution on Linux and Windows.

## Testing

- Add Linux coverage for preserving birth time in no-follow metadata.
- Add cross-platform coverage for sandboxed no-follow operations and removal of files and empty directories.

GitOrigin-RevId: 1bc531669839bf5d033aa4a215220ed1cc5f63d5
2026-08-20 08:32:11 +00:00
Dylan Hurd
fec2dccfcf Add macOS Seatbelt filesystem integration tests (#39665)
## What changed

Add macOS-only integration coverage that runs commands under the production
Seatbelt policy and verifies:

- deny globs protect matching files, directory ancestors, symlink aliases, and
  paths created after policy application;
- protected directories cannot be moved, replaced, or exchanged across
  writable roots; and
- standard read-only and workspace-write profiles continue to allow expected
  filesystem operations.

GitOrigin-RevId: 1f666835ee402bedd1d32e87f1082eaaf7b7bf6a
2026-08-20 08:28:35 +00:00
charlesgong-openai
97c82c0900 Restrict plugin migration to home scope (#39663)
## Why

Plugin imports persist user-global enabled state. Repository-controlled settings
must not be allowed to select executable plugin content for installation.

## What changed

- Detect plugin migrations only from home-scoped external agent settings.
- Reject plugin imports with a non-empty project `cwd` before loading Codex
  configuration, while continuing to treat an empty `cwd` as home scope.

## Testing

- Cover repository-scoped detection with remote, installed, and project-relative
  marketplaces.
- Verify that forged project-scoped imports fail without writing `config.toml`.

GitOrigin-RevId: 53cb46ae049cb49283187312d475d40cf42e35ab
2026-08-20 08:24:18 +00:00
ianw-oai
240bbfc14a Add max and ultra reasoning efforts to the SDKs (#39662)
## What changed

- Add `max` and `ultra` to the TypeScript `ModelReasoningEffort` type.
- Add matching Python `ReasoningEffort` members and preserve them when SDK artifacts are regenerated.
- Update the Python model-selection examples to rank the new effort levels.

## Testing

- Cover serialization of both new Python enum members while continuing to accept unknown future values.

GitOrigin-RevId: 1412b77bdbb2530f5d38921cdea971dd34458353
2026-08-20 08:20:08 +00:00
Benjamin Carlsson
631d5a8b02 Expand Vim change commands and add character replacement (#39661)
## What changed

- Add the configurable `vim_normal.replace_char` action, bound to `r` by default, to replace the grapheme under the cursor while remaining in normal mode.
- Support change-operator motions such as `cw`, `c$`, `cj`, and `ck`, plus the repeated `cc` command for changing the current line.
- Let `Esc` cancel a pending replacement before it reaches composer-level handling.
- Preserve existing custom Vim bindings and chord prefixes when introducing the new default.

## Testing

- Cover replacement, grapheme boundaries, remapping and unbinding, change motions, cancellation, keymap conflicts, and keymap picker snapshots.

GitOrigin-RevId: 98feb4eeb57142c37adb73abfe58d1f703b9270d
2026-08-20 08:13:56 +00:00
pakrym-oai
e3e5ad2847 Harden unsandboxed patch filesystem access (#39659)
## Why

An `apply_patch` path can be replaced with a symlink after verification, allowing an unsandboxed patch operation to reach a different file than the one that was approved.

## What changed

- Add `follow_symlinks` options to executor filesystem reads, writes, metadata lookups, directory creation, and removal, including the corresponding `followSymlinks` protocol fields.
- Implement no-follow filesystem operations on Unix and Windows that reject links in any path component and restrict file access to regular files.
- Run `apply_patch` with symlink traversal disabled when an otherwise-required sandbox is bypassed, while retaining the existing follow-symlink default for standalone callers.

## Testing

- Cover leaf and ancestor symlinks across patch add, update, delete, and move operations, including a path swap after verification.
- Exercise local and remote no-follow filesystem behavior, concurrent directory creation, special-file rejection, and Windows reparse points.

GitOrigin-RevId: 43fd479084891493ce13564fbd894b98f329c6dd
2026-08-20 08:10:08 +00:00
Ankush Gupta
4e1a772a7d Let Guardian V2 satisfy required model reviews (#39658)
## What changed

- Allow the Guardian V2 approval monitor to handle reviews for models that require automatic review.
- Preserve full Guardian review when Guardian V2 is disabled by configuration or managed requirements.
- Cover required-model routing for low- and high-risk actions, plus both Guardian V2 disable paths.

GitOrigin-RevId: d1201cc3dbd7c4a07de633388b14f17ada9feb39
2026-08-20 08:07:06 +00:00
Eric Traut
5e3a6fe4ee Warn when launching the deprecated MCP server (#39657)
## What changed

Print a warning to standard error when `codex mcp-server` is invoked, noting
that the command is deprecated and will be removed in a future release. The
server continues to launch after the warning.

GitOrigin-RevId: 0fefa2579a420a2fad85ef3afe373204f9836869
2026-08-20 08:02:39 +00:00
Eric Traut
4a432d180d Advertise the Desktop app in graphical Linux sessions (#39656)
## What changed

- Add Linux-specific install and launch guidance to the generic and paid tooltip pools when `DISPLAY` or `WAYLAND_DISPLAY` is set.
- Keep the Linux tooltip hidden in WSL and headless sessions, and preserve platform-specific macOS and Windows behavior.

## Testing

- Add coverage for native graphical Linux, WSL, headless Linux, macOS, and Windows tooltip selection.

GitOrigin-RevId: cbe9435db064d5718a591db363dcb7cc1429d5ee
2026-08-20 07:58:28 +00:00
pakrym-oai
1802a65571 Make core integration test permissions explicit (#39655)
## What changed

- Run local and remote compaction test turns with approvals disabled and an unrestricted permission profile.
- Keep the full test harness available where compaction turns need the configured model and working directory.
- Enable the Windows sandbox for managed-network unified exec process-event coverage.
- Update request snapshots to reflect the resulting `danger-full-access` sandbox metadata.

GitOrigin-RevId: 38eb46ca6ab28246d738e31eab900b2825072c7d
2026-08-20 07:52:35 +00:00
Adam Perry @ OpenAI
7ece061767 Enforce filesystem permissions when loading AGENTS.md (#39653)
## Why

Project instructions must respect the selected environment's filesystem read
permissions. Tightening those permissions for a later turn must not allow
previously cached instructions to reach the model.

## What changed

- Apply each environment's filesystem sandbox while discovering and reading
  `AGENTS.md` files.
- Fail thread or turn setup when sandboxing blocks a discovered instruction
  file, while allowing a restricted project with no instructions to start.
- Clear cached instructions before refresh and include the Windows sandbox
  level in the cache key.
- Ignore inaccessible ancestor marker probes so readable instructions in the
  selected working directory can still load.

## Testing

Added coverage for restricted projects, denied instruction files, cache
invalidation after permissions tighten, and unreadable ancestor markers.

GitOrigin-RevId: 6ea1a27b9c873a6260e4f87d42ae1317a6a4ae4b
2026-08-20 07:48:46 +00:00
zm-oai
ab82cddd04 Resolve bundled Windows helpers through bin junctions (#39649)
## Why

Installer `bin` directories can be junctions, so looking for bundled helpers
relative to the apparent executable path can miss the package's
`codex-resources` directory.

## What changed

Retry bundled executable lookup from the canonical executable path when lookup
from the original path fails.

## Testing

Add a Windows regression test that creates a `bin` junction and verifies that
the sandbox setup helper is resolved from the package resources directory.

GitOrigin-RevId: f2f20ce1ccfa95ae65171a03a986d10e2560e696
2026-08-20 07:42:18 +00:00
Dylan Hurd
8aaf839774 Exercise restricted-token sandboxing in cyber policy tests (#39646)
## What changed

Run both branches of the heuristically safe command policy test with the
Windows sandbox level set to `RestrictedToken`.

GitOrigin-RevId: ae5d754ec4a51d73a8e5f9d844f94a91f795fb72
2026-08-20 07:37:52 +00:00
Anton Panasenko
af0e82c562 Enforce managed residency for model providers (#39645)
## Why

Model provider configuration could override the residency header required by
`enforce_residency`, so provider-backed requests did not reliably honor the
managed setting.

## What changed

- Apply the managed residency header after building a provider, making it
  authoritative for model requests and model discovery.
- Warn when a provider configures the residency header through
  `http_headers` or `env_http_headers`, while preserving the original provider
  configuration and unrelated headers.
- Cover HTTP and WebSocket requests, model discovery, and case-insensitive
  header detection with targeted tests.

GitOrigin-RevId: 461ef8989d5bd06ffdea694aee4265e392e07590
2026-08-20 07:33:27 +00:00
evanz-oai
663da53823 Sanitize developer context in full-history agent forks (#39641)
## Why

Developer messages can contain both inherited agent policy and unrelated context. Full-history forks need to replace the parent policy without dropping the unrelated content that shares its message.

## What changed

- Filter fork-specific developer instructions by content item instead of excluding an entire developer message.
- Remove inherited multi-agent mode instructions before applying the child agent's current mode.
- Preserve unrelated content items and discard developer messages only when filtering leaves them empty.

## Testing

Extend agent-control and subagent notification tests to cover compound compacted messages, multi-agent mode instructions, and proactive-to-explicit mode transitions.

GitOrigin-RevId: 028834e237d8636c13b17a724574bc8eb09a55ba
2026-08-20 07:29:43 +00:00
Jeremy Rose
d944ce83a2 Prompt to unarchive sessions before resuming or forking (#39640)
## Why

Starting an archived session with `codex resume` or `codex fork` stopped with
guidance to run a separate `codex unarchive` command first.

## What changed

- Detect archived-session startup failures and offer to unarchive and retry the
  requested operation.
- Allow the user to cancel without modifying the archived session.
- Render the confirmation in the alternate screen when available and preserve
  inline terminal context when `--no-alt-screen` is set.
- Preserve `--no-alt-screen` whether it appears before or after the `resume` or
  `fork` subcommand.

## Testing

- Cover confirmation, cancellation, retry behavior, and unrelated startup
  failures for both resume and fork.
- Add prompt interaction and terminal rendering coverage, including narrow and
  inline viewports.

GitOrigin-RevId: 382cdbd15b5d12c091e554d6d3a2f9b3589654f4
2026-08-20 07:25:40 +00:00
Alvin
fdc23b93b8 Treat invalid_grant refresh failures as permanent (#39637)
## Why

OAuth token endpoints can report an unusable refresh token with the standard
`invalid_grant` error instead of a legacy expired, reused, or revoked subtype.

## What changed

- Classify `400 Bad Request` responses with an `invalid_grant` error code as
  permanent refresh failures, preserving the generic failure reason.
- Cache that failure so subsequent refresh attempts do not repeat the request.
- Keep other `400 Bad Request` errors transient and retryable.

## Testing

Added refresh tests covering terminal `invalid_grant` responses and retryable
`invalid_request` responses.

GitOrigin-RevId: 513d34b514a7e4118a70c76e9d0fe779c006d5d8
2026-08-20 07:21:24 +00:00
Dylan Hurd
7edd0a4c9d Show strict review warnings in the TUI (#39635)
## What changed

- Render `StrictReviewRequired` notifications as warning history cells that explain tool calls may take extra time.
- Preserve the active command and task-running state when the notification arrives.

## Testing

- Add a TUI snapshot test covering the warning and continued command output.

GitOrigin-RevId: bf01b612a22b537b247b6df6818080fc73b5414d
2026-08-20 07:17:31 +00:00
Sean Huang
7ea7b29369 Expose permission profile resolution in the core API (#39632)
## What changed

- Add `Config::resolve_permission_profile` to resolve named profiles from the
  effective configuration and managed requirements.
- Make active-profile network proxy lookup public and re-export
  `CodexThreadSettingsOverrides` from `codex-core-api`.
- Cover configured and managed profile inheritance, duplicate-name rejection,
  and preservation of managed network settings.

GitOrigin-RevId: ffb5f54a932ef1a4b624677b5f051ecdcd1134b8
2026-08-20 07:11:46 +00:00
Dylan Hurd
910ecccf30 Skip sandboxed shell commands in Guardian v2 by default (#39631)
## What changed

- Exclude sandboxed `exec_command` and `shell_command` calls from Guardian v2 classification by default while continuing to classify calls that request `require_escalated` permissions.
- Add `guardianv2.review_scope.sandboxed_exec_commands` to opt sandboxed shell commands back into classification.
- Keep other tools and namespaced shell tools in scope, and advance tool-call progress when a call is skipped.

## Testing

- Cover the default and configured review scopes, tool namespaces, permission modes, and skipped-call progress tracking.

GitOrigin-RevId: 32fb540c69959b9a82569f0f2fc76b5517496e6b
2026-08-20 07:08:31 +00:00
jif
942af8447b Retire the untrusted approval policy (#39630)
## What changed

- Remove `untrusted` from the CLI, configuration schema, and MCP tool interface. Explicit `approval_policy = "untrusted"` settings now fail with an actionable error.
- Remove the known-safe command allowlist. Projects marked untrusted now request approval for every command unless an explicit exec policy rule allows it.
- Keep command parsing conservative by treating in-place `sed` forms as mutating and ignoring unrecognized commands when recording memory usage.

## Testing

- Cover rejection of the retired configuration value and approval requests for commands in untrusted projects.

GitOrigin-RevId: d6bf425edddfffbb325eee6acf383434af5fd33b
2026-08-20 07:03:02 +00:00
Eric Traut
9ca99b5171 Preserve parent repository discovery through sandbox metadata mounts (#39629)
## Why

The Linux sandbox represents missing protected metadata paths such as `.git`
with empty read-only directories. Repository and project discovery treated any
`.git` directory as a checkout root, so this synthetic directory could hide a
real parent repository and its trust configuration.

## What changed

- Treat a `.git` directory as repository metadata only when it contains
  `HEAD`, while continuing to recognize file-based `.git` entries.
- Protect missing `.git` paths with the same read-only synthetic mounts as
  other workspace metadata without disrupting parent-repository discovery.
- Canonicalize and read-only bind the synthetic-mount registry into the
  sandbox, and make protected-path cleanup handle read-only directory trees.

## Testing

Added coverage for repository, project-root, trust, synthetic-mount, and
Landlock behavior, including nested incomplete `.git` directories and a
redirected `TMPDIR`.

GitOrigin-RevId: 0724c54d56531143bb28011e4ca414cd3b0212be
2026-08-20 06:57:00 +00:00
philn-oai
e396ef3fc1 Add cwd-relative turn diff paths (#39625)
## What changed

- Add the opt-in `cwd_relative_turn_diffs` feature.
- When enabled, render turn diff paths relative to each selected environment's
  working directory instead of the detected Git root.
- Preserve repository-root-relative paths when the feature is disabled.

## Testing

- Cover enabled and disabled behavior for nested working directories across
  supported originators.

GitOrigin-RevId: 8b4908706a82b01f33ccd035b0945f9a29fce26f
2026-08-20 06:52:01 +00:00
Dylan Hurd
52e387daca Prevent protected-path rename bypasses in macOS Seatbelt (#39623)
## Why

Renaming a writable directory could move protected descendants outside the
paths covered by their read-only or unreadable policy entries.

## What changed

- Deny unlink-style writes to directory ancestors of protected paths, placing
  these rules after broader write allowances in the generated Seatbelt policy.
- Apply full write denies to unreadable glob matches and protect their directory
  ancestors against renames.
- Support brace alternation and backslash escapes when translating filesystem
  globs into Seatbelt regular expressions.

## Testing

Add coverage for ancestor rename attempts across explicit read-only and deny
entries, multiple glob forms, canonicalized glob paths, and the new glob syntax.

GitOrigin-RevId: edfda9d4c2bc7ba2ecd6b67744446871e526084f
2026-08-20 06:47:30 +00:00
Adam Perry @ OpenAI
f1e06b3865 Stream executor capability and skill file reads (#39620)
## What changed

- Use `ExecutorFileSystem::read_file_stream` for capability files and executor skill resources regardless of whether filesystem sandboxing is active.
- Enforce per-file and bundle size limits incrementally as chunks arrive.
- Preserve the existing error for Windows resources when the required filesystem sandbox is unavailable.

GitOrigin-RevId: 1a40602a8f913588ec9a6ad7edd2d62eb82436e1
2026-08-20 06:43:50 +00:00
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