Commit Graph

10553 Commits

Author SHA1 Message Date
Eric Traut
3ef3cecd20 Open tasks with Right from the agents overview (#44344)
## What changed

Allow `Right` to open the selected task from the task list or an empty, focused composer. Preserve editor keybindings and guard against pending input, active popups, and offline state. Keep metadata editing unaffected and show the shortcut in navigation hints.

## Testing

Add regression tests for opening the current or highlighted task, preserving cursor movement and renaming, and preventing navigation while offline. Update snapshots to cover the new hints.

GitOrigin-RevId: 9fc01b62ad0829b964509ae6286a041fc4936b9d
2026-09-10 00:07:20 +00:00
Anton Panasenko
1bff94edb6 Bind remote-control sessions to their authentication owner (#44341)
## Why

Remote-control connections and queued operations must not carry over to a different signed-in user or account. Token refreshes for the same identity should preserve the live relay connection.

## What changed

- Scope relay state and authentication recovery to a login lifetime. Retire the session on logout or identity changes and leave remote control disabled until enabled again.
- Reject stale incoming messages and queued RPCs, and cancel pending remote-control operations when their authentication owner changes.
- Start replacement sessions with fresh client, replay, and enrollment state, and prevent retired sessions from publishing status into their replacements.
- Serialize enrollment and preference persistence across sessions, retaining write permits through caller cancellation and draining admitted writes on shutdown.

## Testing

Add regression coverage for same-owner refreshes, user and account changes, stale pairing and client-revocation work, unauthorized enrollment recovery after logging in again, and persistence during cancellation.

GitOrigin-RevId: 5e6ecd23588aab1e2e6168a21f575fb24bbb341c
2026-09-09 23:59:14 +00:00
Eric Traut
d390f0a09c Return to the agent command center after archiving on shared servers (#44337)
## Why

`/archive` exits the TUI even when connected to a local daemon or remote app server, interrupting access to other tasks.

## What changed

- Keep the TUI running after a successful archive on local daemon and remote connections, and reopen the agent command center.
- Shut down side conversations before archiving, then clear the archived thread's local state, transcript, and unsent draft.
- Preserve exit-on-archive behavior for the embedded app server and remove the exit promise from `/archive` help and confirmation text.

## Testing

Add coverage for local daemon and remote connections, including side-thread cleanup, archive requests, cleared session state, and the resulting command center snapshot. Retain coverage for embedded archive success and failure.

GitOrigin-RevId: 36c61ec76a13a3fc1b5d6725e3b8f42a97fe6793
2026-09-09 23:50:28 +00:00
ningyi-oai
0df6366a87 Add bounded tool-result metadata support to executed tool calls (#44336)
## What changed

- Add host-recorded `tool_result_metadata` snapshots with size limits, redacted debug output, and protection against deserialization from untrusted input. MCP capture remains disabled.
- Preserve accepted metadata across retries and delayed Code Mode results. Shed raw metadata before source evidence, calls, or completion markers when the request budget is exceeded.
- Send raw metadata only to allowed OpenAI and ChatGPT HTTPS endpoints, filtering by the resolved destination for HTTP and WebSocket requests.
- Encode source parse failures as an array entry with type `parse_failed` and an empty ID.

## Testing

Add coverage for metadata bounds and redaction, retained-call updates, budget shedding, disabled MCP capture, and HTTP/WebSocket destination filtering.

GitOrigin-RevId: b1a396323ad0623167cdd9e20ff9453f0d01bbf7
2026-09-09 23:46:17 +00:00
Matthew Zeng
b5544d5732 Persist disabled plugin IDs in thread settings (#44332)
## What changed

- Add `disabled_plugin_ids` to thread startup options, settings overrides, snapshots, and persisted turn contexts. Omitted overrides preserve the current list; an empty list clears it.
- Restore the selection on resume and capture it before truncating history for a fork. Prefer the owning thread's latest settings snapshot, falling back only to the latest turn context so stale history cannot resurrect an older selection.
- Freeze the selection at turn admission and retain compatibility with histories that lack the new fields.

## Testing

Add coverage for owned settings, explicit clears, latest-turn fallback, and legacy snapshots. Extend settings tests to cover plugin selection during runtime restoration and compaction, and verify initial turn persistence without extra settings checkpoints in both history modes.

GitOrigin-RevId: 75ffbff5763cd93cc5ac69d73b08b237f59bc009
2026-09-09 23:23:59 +00:00
Benjamin Carlsson
e722303e38 Expose voice conversations in experimental features (#44331)
## What changed

- Mark `realtime_conversation` as experimental, keeping it disabled by default, and label it “Voice conversations” in `/experimental`.
- Add an announcement directing users to enable the feature, restart Codex, and run `/voice`.
- Hide server-discovered voice entries and the announcement when the client lacks native voice runtime support.

## Testing

Add tests and snapshots for voice discovery and announcement visibility with and without runtime support, and update the experimental features popup snapshot.

GitOrigin-RevId: 709655f3733cb88191eb78b40ac1f67e27c9816e
2026-09-09 23:16:06 +00:00
joeytrasatti-openai
130d6e4fba Add paginated thread attachment listing to the state runtime (#44330)
## What changed

Add `StateRuntime::list_thread_attachments` with page sizes from 1 to 100 and stable keyset ordering by `created_at` and `id`. Return a continuation cursor when more attachments remain, and reject malformed cursors or cursors belonging to another thread.

## Testing

Add coverage for thread-scoped pagination, cursor validation, and attachment persistence across reopening the database and archiving/unarchiving a thread. Verify listings reflect attachment removal and cascading deletion when a thread is deleted.

GitOrigin-RevId: e07433e1a675669082cc58f86b0dc4535d365ba3
2026-09-09 23:04:22 +00:00
Ian MacLeod
2808a9c348 Clear pending TUI questions when accepting a new prompt (#44328)
## Why

Unanswered questions from the previous prompt remain visible after a new follow-up. Clear them when the user moves on to new work.

## What changed

- Clear pending questions when a model prompt is submitted or queued, and when a review starts. Clear again on queued prompt delivery to remove questions that arrived while waiting.
- Retain seen question IDs so replay cannot restore cleared questions.
- Track question answers separately from prompts through queues, retries, thread restoration, and reconnects so delivering an answer preserves other pending questions.
- Preserve questions for local commands and rejected submissions.

## Testing

Add regression tests for immediate and queued follow-ups, replay suppression, slash prompts, reviews, rejected input, and answer preservation across delivery and recovery. Add a snapshot of the composer after questions are cleared.

GitOrigin-RevId: 76353c6ee098c1505678ac43b1dc6391ea9fa738
2026-09-09 22:51:36 +00:00
iceweasel-oai
f11d0dd012 Prevent filesystem-root read denies in the Windows sandbox (#44327)
## Why

The elevated Windows sandbox requires effective `:root` read access and cannot safely enforce policies that deny reads at the filesystem root.

## What changed

- Validate root read access before elevated setup, service provisioning, and setup refresh, rejecting root-denying globs before expansion.
- Reject filesystem-root deny-read ACL targets after canonicalization and check the opened handle before applying an ACL, so aliases cannot bypass the root guard.
- Read and update deny ACLs through the same handle, and allow an existing deny ACE to be recognized when write access to the ACL is unavailable.

## Testing

Add regression coverage for default root denial, root-denying globs, allowed root reads with narrower deny rules, handle-based root detection, and reading existing deny ACEs without `WRITE_DAC`.

GitOrigin-RevId: b904e7cdbc09ee0147e1818c898b0382b5820c1b
2026-09-09 22:50:03 +00:00
Felicia Chen
0adfc1f2f2 Return the prompt hash in upload responses (#44325)
## What changed

Add nullable `promptHash` to the upload response, populated from the uploaded `prompt_hash` tag. It identifies the whitespace-normalized SHA-256 of the session base instructions, excludes later developer messages, and is `null` when the reported rollout has no prompt metadata.

Update the protocol schemas, precomputed exports, and generated TypeScript and Python types.

GitOrigin-RevId: 6fa70fbe7a06604ac1cd0ea363eb4f192083dad9
2026-09-09 22:45:00 +00:00
Eric Traut
0735c51978 Block goals after three empty automatic continuation turns (#44320)
## Why

Automatic goal continuations can repeatedly return empty final answers without
making progress. Stop this loop by marking the goal as `blocked` after three
consecutive empty turns with no other activity.

## What changed

- Observe completed turn items through a new `on_item_completed` lifecycle hook.
- Track empty final answers only for automatically admitted goal turns, resetting
  the streak on activity, user turns, or goal changes.
- Preserve normal turn completion and streamed message deltas when blocking a goal.

## Testing

Add accounting coverage for the three-turn threshold and streak resets, plus
app-server tests for empty continuations and recovery through final-answer text,
commentary, or tool activity.

GitOrigin-RevId: 4b9d2cb2e306b0adc316972429cc35000115b88b
2026-09-09 22:27:37 +00:00
thomas
eb680c0558 Give hosted Codex Apps an independent MCP protocol opt-in (#44318)
## Why

Hosted Codex Apps shared the `mcp_2026_07_28` protocol setting with other MCP servers, preventing independent protocol selection.

## What changed

- Add `features.codex_apps_mcp_2026_07_28`, disabled by default, for the host-owned HTTP `codex_apps` server. Enabling it attempts 2026-07-28 discovery with Legacy fallback.
- Keep other servers, including third-party registrations with Apps-like names or URLs and local stdio servers, governed by `mcp_2026_07_28`.
- Support the new flag through `experimentalFeature/enablement/set` and refresh protocol settings in existing sessions. Track protocol mode per server when deciding whether to reuse connections.

## Testing

Add coverage for independent feature and protocol selection, hosted event-stream protocol selection, standalone Legacy defaults and discovery fallback, and runtime enablement refreshing an existing app-server thread.

GitOrigin-RevId: 640e8e251f0c45e5f4829cc2b73c3082cf42f715
2026-09-09 22:22:08 +00:00
Eric Traut
e1b23086ac Restore saved threads when the managed daemon restarts (#44314)
## Why

Saved threads need to resume after a managed daemon restart so active goals can continue without waiting for a client to reconnect.

## What changed

- Consume the recovery snapshot at startup and restore threads in the background through the shared cold-resume path.
- Trigger idle lifecycle work without attaching a client subscription, and leave already-loaded threads untouched.
- Continue recovery after individual thread failures and abort background recovery during shutdown.

## Testing

Extend the daemon restart integration test to verify goal continuation before client reconnection, restored conversation history and tools, idle-thread restoration, and recovery snapshot consumption. Include malformed snapshots and an invalid thread ID.

GitOrigin-RevId: 90e7b8f74ddc0ae327bacde1b2108b9749c65f2a
2026-09-09 22:04:47 +00:00
cooper-oai
434efa95e6 Honor shared Retry-After deadlines for remote control (#44311)
## Why

Remote-control requests could bypass a server's `Retry-After` deadline through pairing, auth changes, or reconnects. Proactive token refresh could also continue using a valid token despite an explicit server delay.

## What changed

- Share retry deadlines across enrollment, token refresh, pairing, pairing status, and WebSocket handshakes, preserving them across enrollment replacement and disable/enable transitions.
- Honor `Retry-After` on HTTP `429` and `503` pairing and handshake responses, including incomplete pairing response bodies.
- Add up to 30 seconds of jitter once per response without shortening the server's deadline, including for `Retry-After: 0`.
- Defer new requests while retaining valid tokens, and prevent auth changes from shortening the server delay while keeping shutdown responsive.

## Testing

Add regression coverage for shared deadlines, concurrent pairing and handshake failures, auth recovery, disable/enable transitions, retries after expiry, prompt shutdown, and jitter bounds.

GitOrigin-RevId: 69a5a46559031709a4558190c3142eb65e2ae634
2026-09-09 21:50:16 +00:00
Eric Burke
45eec73b11 Add opt-in provisioned macOS CLI release candidates (#44307)
## What changed

- Add a tag-release workflow gated by `CODEX_PROVISIONED_MACOS_CANDIDATE` for Apple Silicon and Intel macOS candidate artifacts.
- Package the CLI in `CodexCLI.app` with an embedded provisioning profile and a relocatable `bin/codex` launcher. Validate independently supplied profile, certificate, and team expectations before signing.
- Sign and notarize candidates, then verify signatures, entitlements, architecture, stapling, and Gatekeeper acceptance on macOS. Retain verified artifacts after package smoke tests pass.
- Filter code-mode smoke-test requests to `/v1/responses` so analytics requests are excluded from response parsing.

## Testing

Add tests for profile validation, launcher relocation and symlink handling, standard and provisioned signing flows, and rejection of signing, notarization, identity, and entitlement failures. The candidate workflow runs package smoke tests, including sandboxed code mode.

GitOrigin-RevId: f214f6a23dd10df62cd72a2c63c20cb0864fbc9c
2026-09-09 21:28:49 +00:00
Eric Traut
7c88f037d9 Record thread recovery candidates on managed daemon shutdown (#44299)
## What changed

- Atomically save successfully persisted, loaded root thread IDs to `app-server-daemon/loaded-threads.json` during graceful managed shutdown, excluding ephemeral threads and threads pending unload.
- Clear stale recovery state at startup and around daemon lifecycle operations, including explicit stops and fresh starts.
- Probe support for `--managed-daemon` before launching managed app servers, and clear recovery state best-effort when launching older binaries.
- Keep forced shutdown responsive while saving the snapshot and log snapshot failures without preventing shutdown.

## Testing

Add coverage for snapshots after active turns finish, forced shutdown without a snapshot, excluded threads, snapshot write failures, and recovery-state cleanup for stops, fresh starts, and legacy launches.

GitOrigin-RevId: 422dc32b85355510f7e4c57b7540597b47d9f0b2
2026-09-09 20:39:33 +00:00
joeytrasatti-openai
742472c525 Set turn triggers for guardian and memory requests (#44298)
## What changed

Populate `turn_trigger` in request metadata with `guardian_review` for guardian reviews, `guardian_classifier` for classifier requests, and `memory_consolidation` for both detached memory requests and consolidation agent turns.

## Testing

Extend request metadata assertions to cover each trigger across guardian reviews, classifier requests, and both memory startup phases.

GitOrigin-RevId: 2dc3c173ede6563b942b8099ad9901c32967b969
2026-09-09 20:32:57 +00:00
jif
87cf20ee49 Isolate the hook pipe I/O timeout test from shell startup files (#44297)
Run `hook_drains_output_and_times_out_while_stdin_is_blocked` with
`cmd.exe /D /C` on Windows and `/bin/sh -c` elsewhere to keep user shell
startup files out of the test.

GitOrigin-RevId: 296e65cf76b74543e91c9ed9024ba2442e7e33af
2026-09-09 20:26:55 +00:00
felixxia-oai
72348693ec Enforce the async Guardian classifier's complete input budget (#44293)
## Why

Async classifications need to account for the complete request, including parent compaction checkpoints and images, before sending it to the classifier.

## What changed

- Resolve the input allowance from the classifier's model metadata, independently of parent-model context-window overrides.
- Reject requests whose estimated input exceeds that allowance minus a 256-token reserve. Record `input_too_large` and defer to synchronous review without sending the oversized request or dropping evidence to make it fit.

## Testing

Add integration coverage for checkpoint and image budgets, verifying that oversized inputs defer to synchronous review and inputs that fit retain their evidence. Update Guardian context-budget tests to exercise V2 remote compaction.

GitOrigin-RevId: 765060e08d2d5f3028ef5207508d256d4bf8d856
2026-09-09 20:10:01 +00:00
Eric Traut
fa7af3883d Allow user-requested goal pauses through update_goal (#44290)
## Why

`update_goal` only accepted `complete` and `blocked`, preventing the agent from pausing a goal in response to an explicit user request.

## What changed

- Accept `paused` and account for final goal progress when pausing, with budget limits taking precedence.
- Update tool instructions and goal prompts to allow pauses only at the user's explicit request, report the returned status, and stop goal work. A later resume revokes the pause request.

## Testing

Extend coverage for pause accounting, budget-limit precedence, rejection of resume and system-limit statuses, and preservation of a tool-paused goal when resuming a thread.

GitOrigin-RevId: c3c15a51f848ce6eb65854d51b1a1bc75bb456a7
2026-09-09 20:03:38 +00:00
iceweasel-oai
d117c2eb02 Expand MXC volume grants and resolve deny globs (#44289)
## Why

MXC volume-root grants are nonrecursive, and filesystem deny globs were rejected before launch.

## What changed

- Expand volume-root grants to include existing immediate children, preserving read-only carveouts and denies. Children created directly under a volume root after policy construction are not granted access.
- Normalize filesystem object aliases before and after expansion so generated grants preserve tighter access restrictions.
- Skip unavailable volumes and uninspectable generated children.
- Resolve deny globs into concrete file and directory paths using the Windows sandbox resolver.

## Testing

Add regression tests for read-only children and aliases, normalized root access, uninspectable children, and deny glob expansion alongside explicit denies.

GitOrigin-RevId: 3242e9a30d16581d6fe5b7b6e39e0e0f71ca6ef4
2026-09-09 20:02:40 +00:00
jif
885113aa1d Prevent command hooks from hanging on blocked stdin (#44288)
## Why

Writing hook input before draining output can deadlock when pipe buffers fill. Stdin writes also ran outside the hook timeout, allowing hooks that never read input to hang indefinitely.

## What changed

Write stdin concurrently with draining stdout and stderr, and apply the configured timeout to both input delivery and command completion. Preserve handling of broken pipes and distinct stdin and wait errors.

## Testing

Add a regression test that sends a large input to a hook that fills stdout and stderr without reading stdin. Verify that output drains and the hook reports its configured two-second timeout.

GitOrigin-RevId: 48cf33a2acfebbc5122a4522660d7a6b3fb1e9b0
2026-09-09 19:49:47 +00:00
Ian MacLeod
f71543813f Block WSL interop escapes from restricted filesystem sandboxes (#44286)
## Why

With network access enabled, WSL interop can launch Windows processes outside the Linux filesystem sandbox, including using `wsl.exe` to reenter the distribution as root.

## What changed

- Mask WSL interop sockets in bubblewrap when filesystem write access is restricted, and hide inherited procfs when running without a fresh proc mount.
- Deny `AF_VSOCK` sockets and `io_uring` under restricted filesystem policies even when ordinary network access is allowed, closing the VM socket route to host services.
- Reject legacy Landlock configurations that combine restricted filesystem access with unrestricted networking when the WSL interop directory exists.

## Testing

Add unit coverage for mount masking and legacy policy rejection, plus WSL integration tests for Windows process launch, bind aliases, direct `/init` invocation, root reentry, and `--no-proc` isolation. WSL tests skip when host prerequisites are unavailable.

GitOrigin-RevId: 1e8b97ac43675807ee541ca614534d9b1febf410
2026-09-09 19:43:41 +00:00
felixxia-oai
5d3f8752fc Preserve prewarmed reasoning effort across replay and early rollback (#44285)
## Why

Initial history replay and rollback before the first turn could clear the reasoning-effort baseline established by startup prewarm, preventing the first request from preserving that baseline when the selected effort changes.

## What changed

Preserve the reasoning-effort pin during history reconstruction. Clear it on rollback only after startup prewarm has been consumed. With reasoning-effort overrides enabled, a prewarmed `medium` baseline remains on the request while a subsequent `high` selection is sent as a `configuration_update`.

## Testing

Add regression coverage for prewarm completing before initial replay on resume and fork. Expand WebSocket tests to cover resumed and forked threads with overrides enabled and disabled, plus rollback before the first turn.

GitOrigin-RevId: 2e2d0e8a06b24f01b717458ca0576d63107c7697
2026-09-09 19:38:24 +00:00
iceweasel-oai
bb71d758cd Add telemetry for the Windows system config namespace (#44284)
## What changed

Probe the default Windows system config namespace at session start and record `codex.windows_system_config.namespace_squatting_probe` once per process when metrics are available.

When `config.toml` or `requirements.toml` exists, check the containing directories for expected ownership and broad standard-user mutation allow ACEs, including permissions inherited by child files. Report coarse results for missing files, expected directories, unexpected types or owners, mutation permissions, and check errors.

The probe is observational: it does not change configuration loading or enforce a trust decision.

GitOrigin-RevId: e1c79dca5548e16e83c7b84b44ab0de4e2643d0d
2026-09-09 19:31:12 +00:00
Eric Traut
c1840dc55e Persist loaded threads before managed daemon shutdown (#44283)
## Why

Loaded threads, including idle threads whose rollout files are still deferred, need to survive a managed daemon restart. Shutdown must also remain forceable when rollout I/O is blocked.

## What changed

- Add a hidden `--managed-daemon` option for app-server Unix socket transports. After active turns and admitted requests drain, save loaded persistent root threads before exiting.
- Skip ephemeral threads, non-root agent threads, and threads pending unload. Log persistence failures and continue saving other threads.
- Apply shutdown admission checks to thread and turn settings updates, thread deletion, and archiving.
- Keep force signals and daemon shutdown requests responsive during persistence. Return `AppServerExit::Forced` so executables can exit without waiting for runtime teardown.

## Testing

Add integration coverage for resuming active and idle threads after restart, forcing shutdown during active work, and forcing shutdown with a blocked rollout writer. Extend shutdown rejection coverage to deletion and settings updates.

GitOrigin-RevId: 4344e97d39f9f80c5d84c41c17300fd6aa99b4cc
2026-09-09 19:22:22 +00:00
felixxia-oai
fcd90d8f07 Enforce complete request budgets for Guardian reviews (#44281)
## Why

Review evidence can fit its own limits while exceeding the reviewer context window once history, tools, output format, and reminders are included. Tool continuations can also push an existing review over budget.

## What changed

- Select evidence after tools and turn context are resolved, reserving request overhead and a 256-token margin. Omit optional evidence while preserving required sections, and reject required evidence that cannot fit.
- Keep incoming evidence pending until budget selection succeeds so cancellation and compaction cannot record unselected input in reusable history.
- Check the assembled prompt before sampling, including retries and tool continuations. Retry budget failures with summary compaction once per model step, and retire reviewers whose budgets remain exhausted. Avoid history-resetting token-budget compaction for this recovery.
- Record section costs after budget selection.

## Testing

Add unit and integration coverage for required-evidence rejection, optional-evidence omission, reminder overhead, cancellation safety, incoming-review and tool-continuation compaction, and reviewer retirement after ineffective compaction.

GitOrigin-RevId: 2f7ef191b3f46032d295ad363eb7debf9d7a9684
2026-09-09 19:21:08 +00:00
Rasmus Rygaard
9caddc5cf5 Surface environment startup failure reasons to the model (#44277)
## Why

Failed environments were omitted from environment context, and `wait_for_environment` returned a generic failure or treated an already-failed environment as unselected. The model needs the failure reason to explain problems such as an empty repository.

## What changed

- Preserve the selected environment and error when startup or configuration fails.
- Include failed status and XML-escaped error details in environment context, and return the reason from `wait_for_environment` for failures detected before or during a wait.
- Limit error details to 256 bytes per environment and 512 bytes total in context, preserving UTF-8 boundaries. Limit wait failure details to 256 bytes.

## Testing

Add coverage for failures before a turn and while waiting, verifying that the model receives the reason and the turn completes. Add unit tests for XML escaping, incremental context updates, clearing errors on recovery, and UTF-8-safe truncation.

GitOrigin-RevId: 093ab9b447c7b3243fbb53b665180db95479f2a7
2026-09-09 18:50:32 +00:00
felixxia-oai
f5c5d9b2b0 Avoid duplicate reasoning effort updates during turn recovery (#44276)
## Why

Recovering a suspended turn can append a duplicate reasoning effort update when history already ends with a matching trusted update but the runtime has not established its effort pin.

## What changed

Reuse a matching harness-authored `ConfigurationUpdate` at the end of history even when the runtime effort pin is unset.

## Testing

Add a regression test that suspends and recovers a turn without WebSocket prewarming, then verifies the recovered request contains exactly one effort update and retains `high` reasoning effort.

GitOrigin-RevId: 2e49073eb5e8d4fae39a8dc1d9d2b07f77802adb
2026-09-09 18:48:01 +00:00
rka-oai
1ac689cc7d Remove the unused legacy remote compaction implementation (#44273)
## Why

Remote compaction already uses the normal Responses API, leaving the legacy `/responses/compact` runner unused.

## What changed

- Remove the legacy runner, endpoint client, request types, analytics variant, and obsolete test helpers and snapshots.
- Move tool-output trimming and its metadata tests into `compact_remote_history` for reuse by remote compaction v2.
- Consolidate retained-history filtering in the v2 implementation and remove redundant `RemoteCompactionV2` settings from tests.

## Testing

Extend the retained-history unit test to explicitly check that hook prompts survive compaction.

GitOrigin-RevId: 999bb1391aa22c3c281d6a96f98817d6c9e46ed9
2026-09-09 18:40:53 +00:00
Eric Traut
a3ba42b010 Remove the Windows /sandbox-add-read-dir slash command (#44259)
## What changed

Remove the TUI command introduced in https://github.com/openai/codex/pull/11512 for granting sandbox read access to additional directories, along with its event handlers and non-elevated read-root grant helper.

## Testing

Enable the existing voice command popup snapshot test on Windows as well as macOS.

GitOrigin-RevId: 8a3a06b76749420101e34aa6587a8beab8eb5fdd
2026-09-09 18:11:39 +00:00
rka-oai
3dc1e2a584 Always use streamed remote compaction for supported providers (#44255)
## What changed

- Route manual and automatic remote compaction through the v2 implementation.
- Retire the `remote_compaction_v2` feature toggle while continuing to advertise it in the model client beta features header.
- Migrate compaction tests from `/responses/compact` to streamed `/responses` requests with `compaction_trigger` items and remove legacy parity coverage.

## Testing

Add streamed compaction coverage for tool search output trimming and session base instruction token estimates. Update app-server tests to verify started/completed notifications for both local and streamed remote compaction.

GitOrigin-RevId: cea392a6166a9b116ff83708fd9126d5546476e4
2026-09-09 18:04:04 +00:00
jif
2617ed2e1c Move synchronous Guardian orchestration into the reviewer extension (#44252)
## What changed

Move the synchronous review loop, outcome mapping, deadline helpers, and session pool into `codex-guardian-reviewer`. Core supplies adapters for evidence capture, authorization checks, session creation, and event publication through the new host interfaces.

Have `guardian-v2` initialize the reviewer pool and host separately, with the pool managing prewarming, session reuse, concurrent forks, invalidation, and shutdown.

## Testing

Extend the app-server reviewer lifecycle test to cover interrupted concurrent reviews as well as completed reviews, including resuming a reviewer after parent shutdown. Adapt core reviewer tests to use the pool and factory interfaces.

GitOrigin-RevId: 2d69bd20c169b20534764b98cbdb63f38564a530
2026-09-09 17:59:10 +00:00
rhan-oai
eb7bd64ef9 Remove retired model entries while preserving migration prompts (#44250)
## Why

Saved model selections can outlive their bundled catalog entries and still need migration guidance.

## What changed

- Remove `gpt-5.2` and `gpt-5.4-mini` from the bundled model catalog.
- Preserve migration from saved `gpt-5.4-mini` selections to `gpt-5.6-luna` when the old model is absent, while respecting catalog-provided migration metadata.
- Update tests and snapshots to use current models or explicit test fixtures, and remove the obsolete prompt fixture.

## Testing

Extend migration tests to cover catalog metadata precedence, saved selections, replacement model and reasoning-effort persistence, acknowledged prompts, and missing or hidden migration targets.

GitOrigin-RevId: 82beea504cc4a15699677c28a61ec0939af3069c
2026-09-09 17:56:33 +00:00
Abhinav
6eecd04fc1 Normalize image detail for the receiving model (#44249)
## Why

Switching models can send images from conversation history with `detail: original` to a model that does not support it.

## What changed

Normalize image details on request copies using the receiving model's capabilities. Downgrade `original` to `high` when unsupported, covering user messages and function and custom tool outputs. Preserve stored image details so switching back to a supporting model retains `original`, and continue stripping details for Responses Lite.

## Testing

Expand unit coverage across image detail values and model capabilities. Extend integration coverage for model switches within and between turns, text-only models, and resumed and forked threads, including assertions that persisted tool outputs remain unchanged.

GitOrigin-RevId: 2561651ea74f045e00f708ae53771a41dcd49c94
2026-09-09 17:56:06 +00:00
Abhinav
aa88a0333c Preserve tool output truncation budgets across resume and fork (#44248)
## Why

Replaying tool outputs under a different model can expand or shrink the history shown to the model if truncation uses the new model's budget.

## What changed

Save the originating history truncation budget on function and custom tool outputs and reuse it during replay, preserving existing tool-specific overrides. Include the existing 20% serialization allowance once, before converting byte budgets to tokens.

Rename the metadata field to `history_truncation_token_limit` while retaining `fallback_token_limit_override` as its serialized name for compatibility.

## Testing

Add regression coverage for resume and fork with different model budgets, including custom tool outputs. Extend unit coverage for existing overrides and byte-budget conversion.

GitOrigin-RevId: a62c8fd3e43198e2252b150fba72f022939c1070
2026-09-09 17:55:00 +00:00
Abhinav
b64de2f3ad Use the originating model when recording conversation history (#44243)
## Why

History recording used the model captured at turn start, so switching models within a turn could apply stale image preparation and tool-output truncation rules.

## What changed

Pass explicit model metadata through conversation recording. Record model responses and tool results using their originating step's settings, and capture the current model for pending input recorded during startup interruption or task completion.

## Testing

Add regression coverage for tool results across a model switch, explicit model selection for plain and annotated history, and image input retained during interruption and completion. Extend model-switching tests to verify that prepared media and item identity survive switching back to a multimodal model in live, resumed, and forked threads.

GitOrigin-RevId: 5bc750c30c334acb9b802cb80fdea01daffa84a1
2026-09-09 17:46:00 +00:00
Abhinav
205f3671e1 Use captured step settings for tool planning and execution (#44242)
## Why

After a model change within a turn, tools could still use the turn's original model capabilities, output limits, and telemetry attribution.

## What changed

- Build each step's tool plan from its captured model settings.
- Use those settings for image support and detail, command and MCP output truncation, extension metadata, and tool telemetry.
- Preserve the issuing step's model for delayed command completion events while allowing later `write_stdin` calls to use their own step's output limits.

## Testing

Add regression coverage for model changes within a turn, including tool replanning, Code Mode execution, image handling, MCP tool and resource output limits, extension settings, and delayed command completion.

GitOrigin-RevId: ef991598e89a846889baf770a0c9e12e56886d5d
2026-09-09 17:45:37 +00:00
Winston Howes
ed4ca07ba6 Handle credential provider source remapping across config layers (#44241)
## What changed

- Let higher-priority providers in `features.network_proxy.credentials` displace lower-priority providers with overlapping `env` sources, including in profiles. Preserve inherited settings when providers swap sources, and compare environment names case-insensitively on Windows.
- Preserve provider definitions across ordered batch remaps and persist displaced-provider removals without overwriting unrelated sibling updates.
- Validate remapped providers using the credential broker's compilation rules before persisting writes, while allowing incomplete drafts and explicit deletions.
- Omit displaced providers from config origins and report writes overridden by another provider's source ownership.
- Build trusted credential-broker configuration before merging managed layers for project discovery, preserving remapped providers' environment protections.

## Testing

Add unit and config RPC regression tests for source precedence, source swaps, ordered edits, concurrent sibling updates, atomic rejection of invalid remaps, persistence, and override reporting. Add a macOS managed-config regression test for remapped provider bindings during project discovery.

GitOrigin-RevId: b7d402727acf4e5b0f25946db1cf18811f5e2679
2026-09-09 17:45:17 +00:00
jif
3436cad5ab Fix MCP elicitation cancellation and reset state on reconnect (#44238)
## Why

Form and URL elicitations could keep waiting for a response and leave tool timeouts paused after cancellation. Remembered cancellations could also affect reused request IDs on a new connection.

## What changed

- Honor request cancellation and server cancellation notifications for all elicitations, without requiring user-verification support. Return `cancel` and release pending response routes and timeout pauses.
- Create a fresh elicitation service for each connection attempt, including initialization retries and session recovery, so cancellation state stays scoped to its connection.

## Testing

Add regression tests for form and URL elicitation cancellation, cleanup on service shutdown, and acceptance of previously cancelled request IDs after connection recovery.

GitOrigin-RevId: 388a8d72e55e89ad3d44d4739d8434485588aa1a
2026-09-09 17:42:20 +00:00
jif
e8e7103cb9 Extract Guardian review policy into a dedicated crate (#44227)
## What changed

Move assessment parsing and schema, model selection, review outcomes, retry handling, and rejection circuit breakers into `codex-guardian-reviewer`. Update core to use the extracted APIs while retaining session execution and decision enforcement in the host.

## Testing

Move existing assessment, circuit breaker, and retry tests into the new crate, including coverage for transient errors, cancellation, and deadlines.

GitOrigin-RevId: 96ec9989a0066acb012bf3bec0b9f7d8bf11a4ef
2026-09-09 17:31:37 +00:00
jif
a2e83a783e Continue rollout searches when a compressed rollout cannot be searched (#44226)
## Why

An error searching a single compressed rollout could abort the entire search and prevent results from other rollouts from being returned.

## What changed

Log a warning with the rollout path and error, skip that compressed rollout, and continue searching. Apply this behavior to both the compressed scan used alongside `ripgrep` and the fallback scan used when `ripgrep` is unavailable.

GitOrigin-RevId: 07a0d7109456a374244bb84f32cf18e60a69c206
2026-09-09 17:31:15 +00:00
bkotsopoulos
4f2449b4b2 Measure total exec-server request duration including queueing (#44207)
## Why

The existing request duration metric starts at dispatch, leaving out time spent waiting before dispatch.

## What changed

Add `exec_server_request_total_duration_seconds` to measure time from decoded receipt until response enqueue or disconnection, including queueing. Record it alongside the existing duration metric with the same `method` and `result` labels for success, error, and disconnection paths. Preserve existing dispatch and queue timing semantics.

## Testing

Add coverage for successful requests, route errors, unknown methods, response delivery failures, and disconnection during execution. Extend admission-wait coverage to verify total timing includes queueing and route setup without double-counting, and assert each completion and duration is recorded once.

GitOrigin-RevId: ed0f719751b821b8f9f9556914b0f67dc6c5ad8f
2026-09-09 17:03:57 +00:00
Abhinav
8ff4aa8ee4 Use captured step model settings for extension context (#44202)
## Why

Model switches within a turn can leave extension context using stale model metadata. Skill catalogs, context windows, and metric attribution need to match the model captured for each sampling step.

## What changed

- Pass captured model metadata and step-specific telemetry to world-state contributors.
- Use that metadata for skill catalog budgets and usage instructions, preserving configured budget overrides.
- Supply the captured model's usable context window to turn-context contributors, including when rebuilding context.

## Testing

Add regression coverage for model switches during skill discovery, catalog budgets and metric attribution, and extension context windows after `new_context` and retained-step context rebuilds.

GitOrigin-RevId: c51b40b739a380b9767a54ea8c8ee6de45bf01c8
2026-09-09 16:48:49 +00:00
Abhinav
b4507997e0 Use captured step settings when building model context (#44200)
## Why

Model changes during an active turn could leave context using the turn's initial model and settings, even after requests switched to the new model.

## What changed

- Build model, personality, approval, collaboration, app, plugin, and multi-agent instructions from captured step settings.
- Resolve multi-agent policy from the step's effective reasoning effort.
- Use the captured step's context window for full-context metadata and retain that step when rebuilding initial context for compaction.

## Testing

Add regression coverage for model switches updating context without duplicating updates, delegation policy following selected or model-default reasoning effort, and compaction preserving retained context after a model change.

GitOrigin-RevId: 3615c7a3f13f15fdcce9ad13d23311340e0aea88
2026-09-09 16:48:03 +00:00
Benjamin Carlsson
ccf470c060 Preserve voice indicator styles during composer sparkle effects (#44198)
## Why

Rendering the voice strip over sparkle stars can leave voice indicators with a star's color even when their glyphs are unchanged.

## What changed

Render the voice strip after effort ignition and before sparkle effects so stars skip its text and preserve its styles.

## Testing

Add a regression test comparing all nonblank composer cells, including their styles, across 80 sparkle frames while confirming stars still appear. Add a snapshot of the active voice composer.

GitOrigin-RevId: 48774408646c1281df3a6f7b1e12ab9d03a1babd
2026-09-09 16:43:50 +00:00
jif
ce2c2759eb Release persistent writers when session startup is cancelled (#44183)
## Why

Cancelling a session after persistence opens but while MCP startup is still pending can leave its writer held, blocking a subsequent resume.

## What changed

Create `LiveThreadInitGuard` inside the persistence startup future so it protects the live thread while `tokio::join!` waits for other startup work. Dropping the startup future then schedules writer cleanup.

## Testing

Add a regression test that cancels a resume while MCP startup is blocked, verifies the local writer is released, and resumes the same thread successfully.

GitOrigin-RevId: 57d8624e783a7b993579a6386aea35ba845da0e3
2026-09-09 15:54:07 +00:00
felixxia-oai
2bba3a29a0 Use explicit histogram buckets for Guardian context metrics (#44181)
## Why

Guardian request and section cost distributions need shared bucket boundaries across synchronous and asynchronous reviewers so their measurements align.

## What changed

- Add `histogram_with_boundaries` to session telemetry and extension metrics while preserving session attribution.
- Use shared request-token buckets up to 2,000,000 tokens and section-cost buckets up to 16,777,216 for both review paths.

## Testing

Extend telemetry tests to verify explicit bucket boundaries and sample counts, and Guardian integration coverage to check exported request and section metric bounds for both synchronous and asynchronous reviews.

GitOrigin-RevId: e34f6972b3418bac3b061939b62eeeccaec5a299
2026-09-09 15:48:39 +00:00
Eric Traut
c77c34ed33 Reduce TUI stack usage during session transitions (#44176)
## Why

Session transitions need stack headroom to rebuild configuration and the chat widget. Tokio stores task outputs inline even when it boxes the task future, so returning a large `Config` adds stack pressure during task allocation.

## What changed

Box the configuration build result inside the runtime worker and unbox it after joining. Box the `App::run` future to keep the large event loop out of enclosing startup futures.

## Testing

Extend the production-stack TUI integration test to enter `/side`, verify the process remains running, and return to the saved conversation with Ctrl+C.

GitOrigin-RevId: 44975300bb837bf3645ff762cf7bcdc44a277f41
2026-09-09 15:20:47 +00:00
jif
0df1daf526 Attach compressed rollouts to diagnostic reports as JSONL (#44175)
## Why

Diagnostic attachment reads assume the queued file path still exists and contains plain bytes. Compressed rollouts can therefore be omitted when only the logical `.jsonl` path is available, or attached as compressed data when a `.jsonl.zst` path is supplied.

## What changed

- Read rollout attachments through a bounded decoder that resolves plain or compressed representations without materializing a durable JSONL file.
- Use canonical `.jsonl` filenames for attachments and app-server report metadata, while preserving filename overrides.
- Apply size limits to decoded bytes and preserve JSONL prefix truncation.

## Testing

Add regression tests for compressed attachments, representation changes after queuing, plain-sibling preference, filename overrides, decoded size limits, truncation, nonregular files, and unrelated `.zst` attachments.

GitOrigin-RevId: b30f7dd08a741b0c99283460a1ce8933d2920ddf
2026-09-09 15:12:19 +00:00