Commit Graph

9505 Commits

Author SHA1 Message Date
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
thomas
f1087ff151 Expand OAuth metadata redirect test coverage (#39320)
## What changed

- Cover same-origin redirects for protected-resource and authorization-server metadata.
- Verify that cross-origin redirects are rejected before contacting their targets and that redirect cycles fail within a bounded timeout.
- Exercise issuer validation and resource-header isolation for both direct and redirected metadata across legacy and Agent Plugin discovery modes.
- Reuse the test environment's local HTTP client throughout the discovery tests.

GitOrigin-RevId: bd12ac232c3b020a1c098a413361f8e205699699
2026-08-19 00:05:23 +00:00
rka-oai
71dbf72b05 Add the async user message tool (#39319)
## What changed

- Add `send_user_message_async` for root agents when the async-message feature is enabled and the model advertises tool support.
- Emit the supplied text as an asynchronous agent message and immediately return an accepted result so the turn can continue.
- Keep the user-visible update out of the model's input context.

## Testing

- Add an integration test covering tool registration, item events, continued turn execution, and model context.

GitOrigin-RevId: 13d5168cb8cd6742db17bb74a15c910994e9c98b
2026-08-18 23:59:19 +00:00
joeflorencio-openai
657bd889ae Support Edu Plus and Edu Pro account plans (#39316)
## What changed

- Recognize `edu_plus` and `edu_pro` as distinct education workspace plans across authentication, backend rate-limit mapping, and app-server account schemas.
- Include both plans in cloud configuration eligibility and use the education usage-limit behavior.
- Display the plans as `Edu Plus` and `Edu Pro` in the TUI status view.

## Testing

- Cover parsing, workspace classification, account and rate-limit responses, cloud configuration eligibility, usage-limit messages, and TUI display names for the new variants.

GitOrigin-RevId: bf8add780ae03a3c6d10c4f4afa0da262c37928e
2026-08-18 23:47:00 +00:00
jif
8ae72a9314 Evict guardian transcript entries in cacheable chunks (#39315)
## Why

Selecting only the newest entries changes the retained transcript prefix whenever a new entry arrives, reducing cache stability.

## What changed

- Replay non-user transcript entries through a bounded buffer and evict half of the applicable pool when an entry or token limit overflows.
- Keep message and tool token budgets independent, and reject entries that cannot fit without evicting retained evidence.
- Preserve user-message selection and emit retained entries in transcript order.

## Testing

Added coverage for stable tool prefixes, message-budget overflow, rejected messages, and chunked entry-count eviction.

GitOrigin-RevId: e6181f5a229a6de06c7ef5db21a5c74980a53e97
2026-08-18 23:43:31 +00:00
Abhinav
4d8c664a49 Run hooks with the captured session environment (#39314)
## What changed

- Capture the process environment when the hook registry is created and reuse
  that snapshot across configuration reloads.
- Clear the live environment before launching command hooks and legacy notify
  commands, then apply hook-specific overrides and scrub non-inheritable
  credentials.
- Resolve the default shell from the captured environment.

## Testing

Add coverage for snapshot replay, overrides, credential scrubbing, default
shell selection, non-Unicode values, and runtime reconfiguration.

GitOrigin-RevId: fee60c88e842980cdfc1bd49b14b62b9a56b08cd
2026-08-18 23:23:23 +00:00
rka-oai
fb356f3d2c Add async delivery metadata to agent messages (#39312)
## What changed

- Add an optional `delivery` field to agent message events and app-server
  `agentMessage` items, with `"async"` identifying a user-visible message sent
  without ending the current turn.
- Preserve the marker through legacy event conversion, thread history
  materialization, replay, and generated JSON and TypeScript schemas.
- Require delivery of async agent message completion notifications on the
  in-process app-server transport.

## Testing

- Cover preservation of async delivery metadata in thread history.
- Cover delivery-required classification for async agent messages.

GitOrigin-RevId: f92ba25de1293ee271404badfdf0d117d6530329
2026-08-18 23:05:52 +00:00
jif
7d9990fa30 Bind unified exec approvals to shell executables (#39311)
## Why

An unfamiliar executable can ignore its arguments, so trust in an apparent
inner command must not implicitly trust the executable that runs it.

## What changed

- Evaluate unfamiliar shell executables alongside their parsed commands when
  determining unified exec approval requirements. Inner commands can add
  restrictions, but cannot grant trust to the executable.
- Include the executable in reusable approval keys so approval for one custom
  shell does not apply to another.
- Parse literal PowerShell scripts without launching the requested executable,
  preserving command policy checks before approval.

## Testing

Add cross-platform coverage for spoofed shell paths, allowed and forbidden
inner commands, explicit custom-shell approval, and session approval isolation.

GitOrigin-RevId: 0dd2c7e9a2ac30965ef5fe5de1a8d2968bb5f9d0
2026-08-18 23:00:53 +00:00
rphilizaire-openai
280d56b1d8 Attribute executor skill invocations to plugins (#39309)
## What changed

- Carry selected plugin identities from MCP discovery into per-turn extension data, limited to capability roots that are ready for the turn.
- Annotate executor skill catalog entries with the matching plugin ID and `user` scope.
- Include that attribution in `skill_invocation` analytics for both explicit and implicit executor skill invocations.

## Testing

- Extend the executor skills app-server test to verify plugin ID, skill scope, and invocation type for explicit and implicit analytics events.

GitOrigin-RevId: 9345600ae29bcb8eb894fffd2d6f7b05f22ebf74
2026-08-18 22:53:31 +00:00
felixxia-oai
c97bd2dcb5 Fail closed on Guardian V2 risk scoring errors (#39307)
## What changed

- Treat configuration, action serialization, thread lookup, and classification errors as elevated risk instead of retaining a prior low-risk result.
- Track asynchronous scoring failures separately from completed scores so approval review falls back to strict review when the latest tool call could not be scored.
- Preserve newer classification results when recording a fail-closed score.

## Testing

- Add coverage for each failure path and for ordering fail-closed scores with concurrent classifications.

GitOrigin-RevId: 7012f078a24031848f2943354a206866286ad9f4
2026-08-18 22:47:54 +00:00
joeflorencio-openai
6ec012668b Honor managed config during project discovery (#39306)
## What changed

- Include legacy managed-file and MDM settings when resolving project root markers and project trust in both canonical and executor-local config loads.
- Preserve the existing managed-layer precedence in the final config stack and resolve managed relative paths against the same bases used by the final loader.
- Update explicit-untrusted warnings to describe the effective configuration and direct users to an administrator when the setting is managed.

## Testing

- Cover managed root markers, managed trust overrides, MDM precedence, app-server config reads, and the remote TUI warning.

GitOrigin-RevId: 9b5ddd54b4530f73589d6842a15cbab7e6d6bbb9
2026-08-18 22:44:28 +00:00
felixxia-oai
e51a91b2f4 Keep Guardian v2 risk scores in memory (#39304)
## What changed

- Stop writing Guardian v2 security risk scores to rollout history.
- Treat resumed and forked threads as having no previous Guardian score, so their
  first tool approval is classified and reviewed normally.
- Remove the now-unused `codex-history` dependency from the Guardian v2
  extension.

## Testing

- Update app-server coverage for new, resumed, and forked threads to wait for
  classification completion and verify the expected approval reviews.

GitOrigin-RevId: 74d9caa903a1ff9d38e577b4697b5f8970f11ebb
2026-08-18 22:37:50 +00:00
felixxia-oai
b473c4e6ab Record Guardian v2 classification token usage (#39303)
## What changed

- Pass session-attributed extension metrics to the Guardian v2 sampler.
- Record `codex.guardian_v2.classification.token_usage` histograms for total, input, cached input, cache-write input, non-cached input, output, and reasoning output tokens.
- Preserve token accounting when streamed JSON produces an early score by recording usage from the terminal response in the background.

## Testing

- Cover token metrics through the Guardian v2 extension and the sampler's early-score path.

GitOrigin-RevId: 04fadc07f3b9cbe83f9fa3737536860b5cf5b4be
2026-08-18 22:33:28 +00:00
epanero-openai
fe50b61689 Prevent Node REPL auth tokens from reaching child processes (#39301)
## What changed

- Add `NODE_REPL_AUTH_TOKEN` to the environment variables that model-reachable child processes cannot inherit.
- Remove the variable case-insensitively after shell environment policy overrides and from explicitly configured child command environments.
- Extend the environment scrubber tests to cover inherited and configured forms of the token.

GitOrigin-RevId: 716c65e0a9e222f705c226b7c86545251d3ea580
2026-08-18 22:29:58 +00:00
jif
1a6e07a4fe Restrict agent roles to bounded configuration overrides (#39299)
## Why

Agent roles should customize a child agent without expanding the authority or changing the provider configuration inherited from its parent session.

## What changed

- Apply only supported role overrides for model behavior, developer instructions, personality, service tier, and capability reductions.
- Preserve parent-owned permissions, model providers, endpoints, MCP servers, notifications, and other unrestricted configuration.
- Keep managed feature requirements effective when a role disables capabilities, and reject symlinked user role files.
- Use the same bounded role application path for both multi-agent implementations and resumed agents.

## Testing

Add coverage for authority preservation, managed feature requirements, symlink rejection, provider inheritance, and provider routing after resume.

GitOrigin-RevId: c528d615b691f9c02bfbc21154d514ea07743010
2026-08-18 22:20:32 +00:00
Adam Perry @ OpenAI
45528c5132 Allow overriding Codex package versions (#39298)
## What changed

- Add `--package-version` to set the version written to `codex-package.json`, while retaining the workspace package version as the default.
- Reject values that are not runtime-compatible semantic versions, including overflowing numeric components and numeric prerelease identifiers with leading zeroes.
- Document the new option.

## Testing

- Add unit coverage for valid release, prerelease, and build versions, plus malformed and out-of-range values.

GitOrigin-RevId: cee996a6721e3fac9bd88f0bc0302a7ec7d2b2fb
2026-08-18 22:16:48 +00:00
Abhinav
87070a7792 Enable MCP tool hooks in Codex sessions (#39296)
## What changed

- Execute `mcp_tool` hook handlers through the session's shared MCP runtime, including managed hook configurations.
- Restrict hook calls to already-connected, cataloged, and policy-allowed tools. Unavailable servers fail immediately without starting or reconnecting them.
- Pass session metadata to hook tools, cap hook timeouts by the server timeout, and invoke hooks without model-tool approval or recursive hook dispatch.
- Record handler type and execution mode in hook telemetry, and mark memory as externally influenced after successful or blocking MCP hooks when configured.

## Testing

- Added end-to-end coverage for prompt interpolation, hidden tools, blocking decisions, unavailable servers, thread metadata, approval bypass, and memory-mode handling.
- Added MCP runtime coverage for startup readiness, tool filters, catalog revisions, and managed connector policy.

GitOrigin-RevId: 1647cb801ebc5fa385c7bda9d9c266a389c611b8
2026-08-18 22:10:43 +00:00
Eric Traut
701db965e5 Increase SQLite log sink batching (#39294)
## What changed

- Increase the default bounded log queue capacity from 512 to 2,048 entries.
- Raise the default insert batch size from 128 to 512 entries.
- Extend the default periodic flush interval from 2 to 10 seconds.

GitOrigin-RevId: e96be0996152b4a2a84d88c23d36959436685682
2026-08-18 22:05:07 +00:00
Celia Chen
17de14558b Remove app-server's direct reqwest dependency (#39293)
## Why

`codex-http-client` is the intended owner of `reqwest`, while direct first-party
dependencies are tracked as migration debt.

## What changed

- Build app-server test HTTP clients through `HttpClientBuilder`.
- Use `http` and `url` types directly where only protocol types are needed.
- Remove `reqwest` from `codex-app-server` and its temporary dependency-policy
  exception.

GitOrigin-RevId: ff9f14a54bc20ec1ea39050bbe08c381ee376119
2026-08-18 22:00:25 +00:00
chess
633bd4abf7 Add Windows sandbox diagnostics to codex doctor (#39290)
## What changed

- Report the configured Windows sandbox backend and whether denied-read restrictions are active.
- Diagnose incompatible backend policy, incomplete or failed elevated sandbox provisioning, unreadable setup failure reports, and missing, locked, disabled, or expired sandbox accounts.
- Provide issue-specific remediation and promote the sandbox check status and summary to the highest detected severity.
- Export the Windows sandbox setup data needed by the diagnostic check.

## Testing

- Cover missing Linux helpers and malformed or oversized Windows setup failure reports.
- Cover a recorded Windows sandbox refresh failure after setup completed.

GitOrigin-RevId: e965b703578a5c0597dcce9f836d2e1f510ad0c8
2026-08-18 21:56:54 +00:00
rka-oai
ccf4191582 Register the async message feature flag (#39288)
## What changed

- Add the under-development `send_async_message` feature, disabled by default.
- Expose the feature key in the generated configuration schema.

GitOrigin-RevId: dd27483f2ef802dba49e47f3ce03146ee6a58f1e
2026-08-18 21:49:49 +00:00
Eric Traut
997a80020f Report diagnostic upload failures (#39287)
## Why

Submitting a diagnostic report could appear successful without confirming that Sentry accepted the upload, leaving callers unable to detect transport or HTTP failures.

## What changed

- Send report envelopes through the route-aware HTTP client and await the response.
- Reject redirects, propagate transport and non-success HTTP responses, and include the full error chain in upload JSON-RPC errors.
- Add structured logs for upload attempts, successes, and failures without including report contents.

## Testing

Added coverage for successful uploads, rejected responses, blocked redirects, transport failures, and app-server JSON-RPC error reporting.

GitOrigin-RevId: 07b5cfccd7a65f35d51a720537d2cd8962ed6cdb
2026-08-18 21:46:18 +00:00
Eric Traut
e7f9fa9cd9 Show file destinations in TUI change approvals (#39285)
## What changed

- Show a description and the destination paths affected by each file-change approval.
- Include both source and target paths for moves, format cross-platform paths for display, and show `unavailable` when change details are missing.
- Recover file changes from buffered events and thread snapshots so live and replayed approvals retain their destination details.

## Testing

- Add coverage for active and replayed approvals, moved and cross-platform paths, and the missing-destination fallback.

GitOrigin-RevId: 24f90b313fd8643f90cbead1504c788b140d7fed
2026-08-18 21:43:22 +00:00
Dylan Hurd
ba37d0c45b Report network disconnects during approval (#39284)
## Why

When a local proxy request disconnects before network approval completes, the
owning tool call needs a model-visible explanation instead of remaining tied to
the abandoned request.

## What changed

- Track disconnect timing while plain HTTP and CONNECT requests await policy
  decisions.
- Cancel the owning execution and report how long the request waited when it
  disconnects before approval completes.
- Preserve an explicit approval outcome when disconnect cleanup runs afterward.

## Testing

Added unit coverage for disconnect tracking and outcome precedence, plus
end-to-end coverage for plain HTTP and CONNECT requests.

GitOrigin-RevId: b354b29bbe86f38e252fcaf529541f177480136b
2026-08-18 21:30:45 +00:00
viyatb-oai
2fe4e06cc2 Document secure devcontainer DNS exfiltration risk (#39283)
## Why

The secure devcontainer's firewall does not apply its domain allowlist to DNS
traffic, so it does not provide secure DNS resolution for untrusted code.

## What changed

Document the DNS exfiltration risk, limit the devcontainer recommendation to
trusted repositories, and describe filtering DNS through a restricted resolver
as a partial mitigation. Clarify that allowlisted HTTPS destinations remain a
possible exfiltration path.

GitOrigin-RevId: 73cc7d29f8de17013c01411f8c20b8b5e1199b24
2026-08-18 21:18:48 +00:00
jif
681c82f497 Move shell snapshot scripts into codex-shell-command (#39281)
## What changed

- Add a public `snapshot_script` helper to `codex-shell-command` for Bash,
  Zsh, POSIX shell, and PowerShell, returning `None` for Command Prompt.
- Update `codex-core` and its shell snapshot tests to use the shared helper
  without changing snapshot behavior.

GitOrigin-RevId: 779b9dc964635b717922ea9f5646b94c4dbb0da1
2026-08-18 21:11:30 +00:00
iceweasel-oai
88c39c4578 Propagate Windows sandbox ACL update failures (#39279)
## Why

Windows sandbox preflight could report success when applying a deny ACE failed,
leaving a detected world-writable path without the intended capability
restriction.

## What changed

- Return errors from `SetEntriesInAclW` and `SetNamedSecurityInfoW`, including the
  affected path in ACL API errors.
- Attempt every flagged path, aggregate deny-ACE failures, and fail preflight
  after logging them.
- Preserve cleanup of security descriptors and newly allocated ACLs on failure.

## Testing

Added tests that verify ACL API failures are returned and that preflight keeps
processing remaining paths before propagating an error.

GitOrigin-RevId: e2be1c70f72840046dc55760364de7bcf3b1bdc9
2026-08-18 20:56:10 +00:00
sayan-oai
392328ed5d Preserve owner-provided environment configuration (#39278)
## Why

Thread settings could replace an owner-provided environment configuration with
`FromThread`, allowing the thread to take ownership of that configuration.

## What changed

Reject environment settings updates that change an existing owner-provided
configuration to `FromThread`.

## Testing

Cover preview and turn settings updates for pending, ready, and failed
owner-provided environments.

GitOrigin-RevId: c516954819447ceb29e2ff9f29fe781ca101ae54
2026-08-18 20:49:36 +00:00
alexsong-oai
884a193b78 Declare experimental Amazon Bedrock setup APIs (#39277)
## What changed

- Add experimental `account/bedrock/discover` and `account/bedrock/setup`
  requests to the app-server protocol.
- Define discovery results for AWS profiles and environment credentials, plus
  setup inputs for profiles, environment credentials, and access keys.
- Export the new types in the experimental protocol schema. The app server
  currently returns `method not found` for both requests because setup is not
  yet implemented.

GitOrigin-RevId: 656b4bc11231a417e97041068cecc5dc692786e3
2026-08-18 20:44:19 +00:00
alexsong-oai
22b860e80b Add provider-owned authentication recovery (#39274)
## What changed

- Let model providers identify recoverable authentication errors and refresh their own authentication state before falling back to `AuthManager` recovery.
- Apply provider recovery to both HTTP and WebSocket response requests, with at most one provider-owned recovery attempt per request.
- Preserve existing `401 Unauthorized` handling as the default for providers that do not customize recovery.

## Testing

- Add coverage for successful and failed provider recovery, including the single-attempt bound and preservation of the original unauthorized error.

GitOrigin-RevId: 9a737e3be96354699586f97dd88e544a45082969
2026-08-18 20:14:17 +00:00
Owen Lin
f950a1ba0b Preserve thread names during rollout migration (#39273)
## Why

Legacy threads and paginated threads read their displayed names from different metadata. Moving a rollout to paginated history must carry over its legacy-visible name so renamed threads do not lose it.

## What changed

- Load legacy indexed names once for an apply run.
- When promoting a thread, preserve an existing canonical name or copy its distinct legacy title, falling back to the legacy name index.
- Repair missing names when migration encounters an already-paginated rollout.

## Testing

Added migration tests covering preservation from both legacy name sources and repair on a rerun.

GitOrigin-RevId: 5fc526570b1cf358a159ef174c159ac091ccc40f
2026-08-18 20:07:26 +00:00
olliem-oai
4a3e829c56 Inject Node REPL policy into Guardian review sessions (#39267)
## What changed

- Add a dedicated developer policy for Guardian reviews of Node REPL browser and computer-use actions.
- Inject the policy once before the first eligible Node REPL approval and retain it when the reviewer session is reused.
- Include Node REPL policy eligibility in the reviewer reuse key so sessions are not reused across incompatible model settings.
- Keep the approval request itself on the generic planned-action format.

## Testing

- Cover first-action injection, reuse after a shell review, repeated Node REPL reviews, and ineligible parent models through the production approval path.

GitOrigin-RevId: bfce190ff8599788aa85e388cc6a959d27fb489c
2026-08-18 19:22:31 +00:00
Dylan Hurd
d68b85a097 Require fresh approval beneath denied permission paths (#39266)
## Why

A stored permission grant may allow access to a parent while explicitly denying
a child path. A later request for that child must not be treated as already
approved by the broader parent grant.

## What changed

- Compare materialized permission profiles without intersecting away denied or
  reopened paths before deciding that a request is preapproved.
- Execute preapproved commands with the stored grant itself so its denied paths
  remain enforced.
- Fail closed when permission profiles cannot be materialized.

## Testing

Added unit and integration coverage for turn and session grants across
`exec_command`, `shell_command`, and `apply_patch`, including approval-disabled
and `Never` approval modes.

GitOrigin-RevId: 5455880328a89c7958f859c7ce87805dff9704fb
2026-08-18 19:17:09 +00:00
olliem-oai
846a16852f Improve Guardian v2 risk classification (#39264)
## What changed

- Replace the minimal default classifier prompt with predictive security-review guidance covering authorization, action risk, untrusted evidence, and browser or computer use.
- Trigger full Guardian review at an `action_risk` score of `0.5` or higher for the new default prompt, while retaining the `0.8` calibration for custom and model-provided prompts unless they specify a threshold.
- Render security policy configuration into prompt templates before enforcing the classifier instruction token limit. Prompts without the policy placeholder retain the existing append-and-truncate behavior.

## Testing

- Cover default, custom, and model-provided prompt thresholds and precedence.
- Verify policy substitution, truncation, sampling requests, and full review at the threshold boundary.

GitOrigin-RevId: 7aad9e2d8c9fbea453dc52147a3d0a46bf191aec
2026-08-18 19:12:30 +00:00
iceweasel-oai
726ec7ecbf Prevent ConPTY DLL loading from the current directory (#39262)
## Why

The Windows PTY implementation probed `conpty.dll` by bare name. Windows could
resolve that lookup to a DLL in the process current directory and load it when
creating a pseudoconsole.

## What changed

Resolve the ConPTY entry points from `kernel32.dll` without probing
`conpty.dll`.

## Testing

Add a Windows regression test that places a compatible `conpty.dll` in the
current directory, creates a ConPTY, and verifies that the DLL was not loaded.

GitOrigin-RevId: be78974362a99dce0c18186cf3e7bbd86a8de73c
2026-08-18 19:09:33 +00:00
Eric Traut
785ecd7452 Stop TUI chats on misalignment policy violations (#39261)
## Why

When the app server reports a misalignment policy violation, the TUI must stop the affected chat rather than allow more work to continue in it.

## What changed

- Finalize the active turn, clear queued and draft input, disable the composer, and reject further operations and interactive requests for the stopped chat.
- Interrupt an active side conversation when its parent reports the violation, and prevent queued turns, forks, approvals, or goal resumption from restarting work.
- Show a non-dismissible precaution view that directs users to start a new chat or resume another one, with agent command center navigation for remote sessions.

## Testing

Added coverage for stopped-chat behavior, parent/side-thread handling, blocked goal resumption, navigation actions, and narrow and remote-session rendering.

GitOrigin-RevId: 0268c46a19294a17765ea4099f389f15ffaaf030
2026-08-18 18:50:58 +00:00
Tamir Duberstein
3006151ad4 Simplify unified exec output snapshots (#39259)
## What changed

- Return retained unified-exec output as one contiguous byte buffer.
- Use the buffer directly for sandbox-denial checks, removing intermediate
  chunk aggregation and an unnecessary owned string conversion.
- Update the output-retention test to assert the flattened snapshot.

GitOrigin-RevId: 84eacee0166b86d3cb2d6a37e96125977fad0267
2026-08-18 18:46:44 +00:00
Peter Bakkum
ecb8013dfa Reconnect WebRTC Realtime sideband transports (#39257)
## What changed

- Reconnect frameless bidirectional WebRTC sideband sockets after unexpected transport loss with capped exponential backoff.
- Preserve pending text or handoff output and bounded transcript state across reconnects.
- Treat `404 Not Found` and `410 Gone` handshake responses as terminal session completion, and preserve HTTP status information from failed WebSocket handshakes.
- Bound Realtime delegation input and transcript fields while retaining the most relevant portion of each.

## Testing

- Add unit coverage for reconnect backoff, terminal status handling, transport error classification, transcript continuity and truncation, and pending outbound messages.
- Add an end-to-end WebRTC conversation test covering an unclean disconnect, reconnect, transcript reconciliation, outbound progress during sustained inbound traffic, and terminal session completion.

GitOrigin-RevId: 544fd7e542c3434d0bb42cfbcc7143604419a037
2026-08-18 18:41:40 +00:00
Jeremy Rose
fa9a05f2d2 Deduplicate rollout moves when archiving threads (#39256)
## Why

SQLite metadata can identify a rollout through a non-canonical path. When that
path resolves to a rollout already found on disk, archive and unarchive
operations could schedule the same source file to be moved twice.

## What changed

- Deduplicate archive and unarchive moves by canonical source path.
- Cover both operations with metadata-backed tests that use equivalent rollout
  paths.

GitOrigin-RevId: d190915264214413667fc2c83d360a7e8504d0aa
2026-08-18 18:38:12 +00:00
pakrym-oai
77e6889601 Add exec-server forwarding mode (#39249)
## What changed

- Add `codex exec-server forward --connect ws://HOST:PORT` to register an
  existing WebSocket exec-server as a remote environment.
- Open a separate destination WebSocket for each authenticated Noise relay
  stream and forward complete payloads unchanged in both directions.
- Preserve large messages through WebSocket fragmentation and coordinate
  disconnects, close acknowledgements, and pending output delivery.

## Testing

- Cover CLI validation, opaque payload forwarding, disconnect handling, and
  destination close behavior.
- Verify commands and large file transfers through the complete relay and
  forwarding path.

GitOrigin-RevId: 6e2dccff05b9e3571865611f4d432b0e2b4cdbac
2026-08-18 18:15:21 +00:00
Dylan Hurd
8193c56a59 Give Guardian classifier connections distinct thread identities (#39246)
## Why

Guardian sampling uses a pool of WebSockets, while the bridge routes each
connection by thread ID. Each socket therefore needs its own identity instead
of reusing the source thread ID across the pool.

## What changed

- Generate a classifier thread ID for every pooled connection and use it for
  request, window, and subagent attribution.
- Preserve the originating thread ID in turn metadata alongside the Guardian
  classifier request kind.
- Build request metadata after leasing a connection so retries use the identity
  of the socket that carries the request.

## Testing

- Cover unique identities across pooled and replacement connections.
- Verify classifier attribution metadata for extension requests and retries.

GitOrigin-RevId: 1c36207125157ff05cab9487a2fa37bf85e5fdd8
2026-08-18 18:08:17 +00:00
victor-openai
a1dc95d5af Scope MCP resource reads by connector (#39244)
## What changed

- Add an optional `connectorId` to `mcpServer/resource/read`.
- Forward the selected connector through `x-codex-turn-metadata` for threaded and threadless resource reads, restricting hosted app resources to that connector.
- Update the generated protocol schemas and app-server documentation.

GitOrigin-RevId: 5cc94d703abbbb6086665910c1c9ed5dc7075210
2026-08-18 18:01:39 +00:00
jif
19d185fec8 Add safe permission profile intersection (#39242)
## What changed

- Add `intersect_effective_permission_profiles` to derive the permissions shared by an authority profile and a requested profile.
- Preserve the more restrictive filesystem access, read denials, protected metadata paths, temporary-directory access, and network policy.
- Canonicalize concrete paths so symlinks cannot expand authority, and fail closed for policy shapes that cannot be intersected safely.

## Testing

Add coverage for workspace intersections, nested carveouts, deny patterns, unsupported policies, temporary-directory restrictions, symlink escapes, and macOS path aliases.

GitOrigin-RevId: a35bdc47e41afad13630f92c032514b300c14a0d
2026-08-18 17:53:36 +00:00
felixxia-oai
e683c3118b Record Guardian v2 classification metrics (#39241)
## What changed

- Emit a `codex.guardian_v2.classification` counter for each classification.
- Record classification latency in `codex.guardian_v2.classification.duration_ms`.
- Tag both metrics with `success`, `failure`, or `superseded` outcomes.

## Testing

- Verify metrics for successful classification and fail-closed handling.

GitOrigin-RevId: 021702f3b26565d6da5708d2b8f1f8881942a441
2026-08-18 17:48:35 +00:00
Matthew Zeng
a998c7a1ce Deduplicate remote plugin bundle syncs with shared semaphores (#39240)
## What changed

- Give plugin managers for the same cache root a shared semaphore that permits
  only one background installed-plugin bundle sync at a time.
- Hold the permit for the lifetime of the spawned sync task and refresh the
  installed-plugin cache after a successful local cache change.

## Testing

- Add a test that starts bundle syncs from two plugin managers sharing a Codex
  home and verifies that only one request is made.

GitOrigin-RevId: 86c39476c3a9015b9862ab75e8f11f110b0284fc
2026-08-18 17:42:48 +00:00
pakrym-oai
3df5087f75 Decouple Noise relay streams from JSON-RPC processing (#39235)
## What changed

- Add a `NoiseStreamHandler` abstraction that owns payload encoding, decoding,
  and connection processing while the virtual stream handles framing,
  encryption, and multiplexing.
- Reassemble authenticated payloads as opaque bytes, with the existing
  JSON-RPC processor supplied as a handler implementation.
- Have the physical relay send a reset after the current stream instance
  closes, including when its processor exits before the writer task.

## Testing

- Verify local JSON-RPC decoding creates the queued request span before queue
  admission.
- Verify a processor exit resets the corresponding Noise harness stream.

GitOrigin-RevId: 270befcc8bfbf27e46c84d6a2c6e349cb98ea3f8
2026-08-18 17:18:50 +00:00
jif
9b9b614b02 Include node_repl screenshots in Guardian v2 reviews (#39227)
## Why

`node_repl` screenshots are nested tool results and do not appear in the parent
conversation history, so Guardian v2 transcript image collection could miss
them.

## What changed

- Allow Guardian v2 to enable bounded, thread-scoped `node_repl` image capture
  when transcript images are configured.
- Add retained `node_repl` screenshots to review requests when transcript
  sources include tool outputs, while deduplicating images and keeping them out
  of the parent turn input.

## Testing

- Add an integration test covering screenshot capture without the synchronous
  Guardian transcript feature flags and verifying that screenshots stay out of
  the parent request.

GitOrigin-RevId: 5f70c5f2e80389aa8b2a286c3b7f9b1104865486
2026-08-18 16:38:52 +00:00