Commit Graph
12208 Commits
Author SHA1 Message Date
jif 0d58012ec2 Test memory extraction budgets with excluded items and ciphertext (#53963)
Extend phase-one request tests for both memory versions with reasoning,
developer messages, and assistant ciphertext whose combined size exceeds
the reader budget while individual records remain below the record limit.
Verify that earlier extraction evidence and assistant text alongside large
ciphertext remain in the request, with `encrypted_content` excluded.

GitOrigin-RevId: f0e85e368e5a94d491d0aa4ae1688f47d873ccd9
2026-10-14 12:07:20 +00:00
jif 78dc250384 Stop rollout reads when the calling task is cancelled (#53947)
## Why

Blocking rollout reads can continue decompressing and scanning history after the calling async task is dropped.

## What changed

Propagate caller cancellation through rollout readers, prefix validation, model-context scans, history materialization, and working-directory lookup. Check cancellation during compressed input and output, bounded reads, seeks, and between history records. Return an error on cancellation so partial history cannot be mistaken for a complete read.

## Testing

Add regression coverage for dropping a caller during decompression, cancelling compressed input and output (including skippable frames), cancelling reads and seeks on plain and decoded snapshots, and cancelling history materialization between records.

GitOrigin-RevId: e3dac952789b53402f2a5f17c2a2232506feb9d6
2026-10-14 10:46:14 +00:00
jif 5670b1c18e Bound rollout input for memory extraction (#53940)
## What changed

Read rollout evidence from newest to oldest for both memory versions, retaining up to 8 MiB of sanitized response items and inter-agent communications, then restore chronological order. Skip malformed records and records larger than 1 MiB, and require valid session metadata in the first record within that limit.

## Testing

Add coverage for the retained byte budget, newest-record ordering, malformed and oversized records, and unsupported session metadata. Extend extraction request tests for both memory versions to verify that evidence after an oversized record reaches the model.

GitOrigin-RevId: 55ccbc2477ecb059830d3a55be12bcbc21235303
2026-10-14 10:19:14 +00:00
jif 400f2356d6 Preserve conversation history when compaction fails (#53932)
## Why

Compaction could record partial output before the response completed, leaving failed summaries in conversation history and persisted rollouts.

## What changed

Buffer compaction output until `response.completed` so failed or incomplete attempts leave no partial output in history. Record successful output before the response completion notification, preserving its compaction metadata.

## Testing

Add regression coverage for preserving messages, tool results, and token usage after a disconnected compaction stream, including after restart. Verify incomplete compaction output is excluded from subsequent requests and successful output remains observable and persisted.

GitOrigin-RevId: 8651200b2aae616000c55c1ed63283f3e2c1b8d5
2026-10-14 09:44:24 +00:00
Eric Traut 95273b84fb Keep the agent dashboard browsable during task removal (#53908)
## Why

Archiving or deleting a task blocked dashboard navigation until the server request finished.

## What changed

Keep the dashboard interactive for browsing while archive and delete requests are pending. Hide the affected task immediately and show an inline progress message. Allow selection movement and search while preventing task switching, new tasks, and leaving the dashboard until the request completes.

Preserve the dashboard selection when removing the current task detaches the session.

## Testing

Update archive and delete progress tests and snapshots to cover navigation, resize handling, immediate task hiding, and suppression of task switching and creation while requests are pending.

GitOrigin-RevId: ff6555602bcd84d38e00de55c3032f442589fdcb
2026-10-14 08:05:19 +00:00
Eric Traut 97771b1d78 Isolate daemon package tests to reduce disk contention (#53897)
## Why

Daemon package tests copy full debug CLI packages. Running these I/O-heavy cases alongside other tests can increase shared-disk writeback pressure.

## What changed

- Move package installation and replacement coverage into the `app_server_daemon_package` test binary, sharing daemon fixtures with the lifecycle tests.
- Reserve all nextest test threads for each package test and add an exclusive Bazel target that runs the cases serially on Linux and macOS.
- Hard-link the prepared fixture executable during package setup, while retaining real independent package copies in the installer.

GitOrigin-RevId: 255ac8caf75d9eb61bafe68f1f9bcfa99ee72484
2026-10-14 07:13:22 +00:00
Eric Traut 4906ddf5b8 Resume unloaded subagent threads when selected in the TUI (#53895)
## Why

Persisted subagent threads could be reported as unavailable when selected after unloading, even though their saved history could be restored.

## What changed

Attempt to resume selected threads marked closed, including those with a cached live channel, and restore their transcript through the existing attachment flow.

## Testing

Extend coverage for V1 and V2 subagents to verify saved transcript restoration, the appropriate direct-input behavior, and reattachment when a close notification from the previous runtime is still queued.

GitOrigin-RevId: f45d16b954ce5f9f30ca4c6c6f640937390dd78d
2026-10-14 07:07:30 +00:00
Benjamin Carlsson 7eed30ad1b Preserve running turn recovery across thread settings updates (#53879)
## Why

Standalone thread settings updates cleared the running turn's continuation lineage, preventing recovery after a daemon restart.

## What changed

Preserve continuation lineage while a task is registered. Continue invalidating pending continuations for idle, reserved, and finishing turns, and record started-turn lineage atomically with task registration.

## Testing

Extend settings invalidation coverage to idle, reserved, and finishing turns. Exercise an in-flight reasoning effort update before compaction, then verify cold resume preserves the turn's frozen settings and allows continuation. Wait for thread idle before testing idle continuation.

GitOrigin-RevId: d7c316af6a4c871790bb57f0af9892bb30871ac8
2026-10-14 06:03:02 +00:00
rhan-oai cb03f28a40 Refresh model instructions in incremental-tool context windows (#53872)
## Why

Incremental-tool windows recorded base instructions only at setup, so a catalog refresh for the same model could leave active instructions stale. Instruction changes need to reach the model without rewriting the existing history prefix.

## What changed

- Track model identity and instruction content independently, appending a `model_instructions` developer message when either changes. Explicitly mark replacement or removal of base instructions, and avoid repeating unchanged updates.
- Start new windows after compaction with the latest model instructions while preserving custom base instructions.
- Preserve the recorded window base during local compaction retries, including empty instructions, and rebuild current model instructions when reconstructing child context.

## Testing

Add integration tests and request snapshots for catalog refreshes, instruction removal, model switches, compaction, restart, and forks. Extend regression coverage for legacy snapshots and local compaction retries.

GitOrigin-RevId: eeca69067b4d9cd91c817732d79b4d5c1faa18b9
2026-10-14 05:36:44 +00:00
Ian MacLeod c22a06c180 Record bucketed terminal sizes in TUI telemetry (#53859)
## What changed

- Add `terminal_columns` and `terminal_rows` buckets to `codex.tui.start`.
- Record `codex.tui.terminal_size` for new turns in the active thread and for resize bucket changes after the terminal size settles for 15 seconds. Reuse launch context and suppress duplicate turn notifications.
- Respect analytics consent for the built-in metrics exporter while allowing explicitly configured OTLP collectors. Apply consent checks to the active exporter across provider replacements.

## Testing

Add coverage for exporter replacement and consent after config reloads. Extend the PTY integration test to verify startup size buckets, turn-start observations, and delayed resize observations with analytics disabled and an explicit OTLP collector.

GitOrigin-RevId: e01a900cd3f04a36731078f725c75374596cb01b
2026-10-14 03:52:30 +00:00
Charlie Marsh e342df7b66 Reuse staged file digests when preparing daemon installs (#53853)
## Why

Daemon installation rereads staged files to verify the executable and hash the normalized WinGet package, even though staging already computed their digests.

## What changed

Cache file digests while copying the package and reuse them for the staged executable comparison and final WinGet tree hash. Update cached paths when moving WinGet executables and refresh digests when rewriting manifests.

Continue hashing source packages and existing releases from disk so digest reuse does not bypass content validation.

## Testing

Extend the installation test to corrupt an existing release's `codex-package.json` and verify that reinstalling rejects it while preserving the current selection.

GitOrigin-RevId: 429da2ad8b2ee50f07ffb14b79281ab262a2d1a1
2026-10-14 03:26:47 +00:00
Eric Traut 2f05c0a71f Fix daemon updater socket binding and bootstrap readiness on Unix (#53845)
## Why

The updater bound its socket directly beneath `CODEX_HOME`, which can exceed Unix socket path limits. Bootstrap could also report success before the updater's manual-update socket was ready.

## What changed

- Reuse the control socket's protected binding and cleanup guard for the updater, with a symlink at the advertised socket path.
- Remove stale updater socket entries before startup while preserving regular files.
- Wait up to 30 seconds for supported automatic updaters to publish their socket, without connecting as a readiness probe. Report updater exit or timeout with stderr log context.
- Preserve compatibility with older updaters that lack the manual-update command.

## Testing

Add Unix integration tests for updater readiness with a long `CODEX_HOME` path and bootstrap failure when a regular file blocks the updater socket, verifying that the file is preserved and the daemon remains running.

GitOrigin-RevId: 57fdcbe4e6907ece68ba66178cf81f258527560c
2026-10-14 02:51:53 +00:00
tongzhou wang 1b6e0d8145 Track content provenance through prompt assembly and compaction (#53831)
## Why

Message roles and content classifications do not identify who supplied each context part. Source attribution needs to survive prompt assembly and history truncation, including messages that combine text from different producers.

## What changed

- Add per-part `ContentItemMetadata` for user input, developer instructions, `AGENTS.md`, skills, harness context, command hooks, and tool context with optional callable namespaces.
- Carry attribution alongside content and classifications through contextual fragments, extension prompts, hook output, and agent messages. Keep tool-provided context-window hints separate from harness text.
- Preserve the source of retained text slices during compaction and attribute generated truncation notices to the harness. Default missing historical attribution to unknown.
- Attribute host MCP calls using cached tool namespaces only when catalog revisions remain stable, without starting servers or refreshing catalogs for attribution.
- Send the new metadata to Responses Lite and strip it from requests to endpoints that do not support it.

## Testing

Extend compaction tests to cover mixed sources, missing or extra metadata entries, and discarded media. Update Responses Lite request assertions to verify endpoint-specific attribution handling.

GitOrigin-RevId: b0ebc929b7c60f3ec49d1affbf897312d63edcc8
2026-10-14 02:01:49 +00:00
Eric Traut 0960e379a5 Prune unused app-server daemon releases safely (#53827)
## What changed

- Record the current and previous dedicated daemon selections in `selection-history`, bound to the selection link's identity. Preserve that history when an install leaves the selection unchanged.
- Prune unused releases after package preparation and scheduled update processing, including updates that require no restart. Retain the current and previous selections, packages used by the daemon or updater, and the calling executable's package.
- Require lifecycle and installer locks, valid selection history, and verified package boundaries before cleanup. Skip unsafe or unrecognized packages and retire releases before best-effort deletion so partial failures are not retried.
- Resolve the updater's actual executable identity after an executable handoff that preserves its PID.

## Testing

Extend coverage for stale selection history, retention of the last two selections, packages containing external symlinks, partial deletion and reinstall, cleanup without restarting the daemon, and repeated installs preserving selection history.

GitOrigin-RevId: 19a04db1cc356a2219f2afb137b9525e249ab6fb
2026-10-14 01:49:56 +00:00
Dylan Hurd c3733756a9 Reject Guardian review threads during interactive CLI resume (#53816)
## What changed

Check the selected thread's app-server metadata before resuming it in the TUI. Reject Guardian review threads with a clear error and suggest `codex resume <parent_thread_id>` when a parent session is available. Preserve existing resume behavior if the metadata read fails.

## Testing

Add a regression test for Guardian thread rejection and the parent-session hint. Update daemon startup coverage to select a saved session when testing `resume`.

GitOrigin-RevId: 64b43bb24b5e24eec14c8204c6e15232387dade8
2026-10-14 01:07:57 +00:00
Eric Traut eb1d7065f8 Support daemon installation from Windows WinGet packages (#53811)
## Why

WinGet archives place the CLI and code mode host at the package root, while daemon installation expects them under `bin/`. This layout mismatch prevents installing the daemon from a WinGet CLI package.

## What changed

Validate WinGet packages in their original layout before converting the staged copy to the daemon layout. Move the executables under `bin/`, update the package entrypoint and optional voice manifest checksum key, and hash the final tree for release reuse. Leave the source package unchanged.

## Testing

Add a Windows integration test covering daemon startup, repeated `update --from-cli --yes` calls, rewritten manifests, and rejection of an incomplete package without changing the selected release or source manifests.

GitOrigin-RevId: e78c461a557a4d005fe1f5fe37fb5ba05bb38608
2026-10-14 00:49:27 +00:00
Eric Traut ca2b076fff Add safe diagnostics to workspace routing configuration errors (#53805)
## Why

Workspace routing reported generic requirements load and reload failures, hiding the cause. Raw configuration errors can contain secrets, so exposing their messages directly is unsafe.

## What changed

Include a safe reason in configuration load and reload errors: file locations or non-file line and column numbers, cloud error categories and HTTP status codes, known network policy denials, or OS error details. Exclude raw parser messages, configuration contents, and backend-supplied policy names and IDs.

## Testing

Add regression coverage for configuration locations, cloud failures, and network policy denials. Verify that malformed local and cloud configuration reports useful errors without exposing secret values or policy identifiers, and still prevents workspace routing from falling back to startup configuration.

GitOrigin-RevId: a71484c700d32662ced9e19041dbedda5d1da8a5
2026-10-13 23:59:56 +00:00
Eric Traut 923f276f57 Keep the Agent command center visible during archive and delete (#53804)
## Why

Archive and delete progress replaced the task list, hiding the selected task and surrounding context while the request was pending.

## What changed

Render progress as a centered dialog over the Agent command center. Preserve the selected task and shared scroll/filter state, and re-render the backdrop on terminal resize.

## Testing

Update narrow-terminal snapshots for both archive and delete to cover the progress overlay, task list, and selected row. Adapt the existing modal input-isolation test to supply a backdrop.

GitOrigin-RevId: e155478aeaddef189fbc53b27b8ff05d54bc3711
2026-10-13 23:58:39 +00:00
rka-oai 9e03960cf8 Wire background compaction into the turn lifecycle (#53800)
## What changed

- Launch background compaction at eligible pre-turn, mid-turn, and post-turn checkpoints when `AsyncCompaction` is enabled, capturing the current world state and client routing state.
- Adopt ready results at compaction checkpoints while preserving newer messages, tool outputs, and world-state updates. Continue normally if an optional result is rejected.
- Run one foreground compaction if an adopted result still exceeds the context limit.
- Prevent cancelled turns from launching new background work while preserving already-running work for later reuse.

## Testing

Add unit and scenario coverage for stale history and account changes, cancellation, pending-result reuse and fallback, retained tool outputs, compaction event pairing, and token usage accounting. Add a context snapshot covering a collaboration-mode change while compaction runs.

GitOrigin-RevId: 04ac028d9fe2e3ea64aacaaeb351c3c776cf3940
2026-10-13 23:51:47 +00:00
jif 2b2d792305 Refresh Guardian reviews when review context changes (#53797)
## Why

Assistant messages delivered during a pending Guardian review can change its evidence. Previously, these context changes aborted the review instead of triggering a fresh assessment.

## What changed

Treat changes to local or root review context as stale authorization so Guardian retries with updated evidence. Cancellation and history resets still abort the review.

## Testing

Extend local and worker delivery tests to cover refreshed allow and deny decisions, verify that the new review includes the delivered message, and ensure commands execute exactly once after approval and never on stale approval or denial.

GitOrigin-RevId: 019205bee6d3f4e8cf6b9268f72bbc5db6b3899e
2026-10-13 23:29:53 +00:00
oli-oai 8af93416dd Use the bundled model catalog in the MCP startup invalidation test (#53795)
Set `config.model_catalog` to the bundled catalog in
`mcp_invalidation_refreshes_threads_that_are_still_starting` so model
resolution completes locally before the test waits for the startup
lifecycle hook.

GitOrigin-RevId: fd12df5140670dad4c9e2d22fabe73b0437af2b4
2026-10-13 23:08:06 +00:00
jif a373281e9e Retain rollout migration locks across worker cancellation (#53794)
## Why

Cancelling an async migration caller can leave its blocking compression or decompression worker running. Releasing migration locks before that worker finishes allows other writers or migrations to access files still being processed.

## What changed

Share maintenance, cross-process writer, and local writer locks with blocking workers during migration and recovery. Keep those locks held until file work completes, releasing cross-process locks before allowing local writers to proceed.

## Testing

Add a regression test for cancelled compression and decompression callers that verifies locks remain held until the worker finishes and the output is complete. Preserve the Unix check that decompression temporaries have owner-only permissions.

GitOrigin-RevId: 74855250d89ecab81eaadc2956e328d37b65e72e
2026-10-13 23:06:58 +00:00
ben zhang 815ef9bbc4 Fix cancellation of macOS user-verification prompts (#53790)
## Why

Keychain signing reconstructs its own authentication context, so invalidating the caller's context does not reliably cancel the context that owns the biometric prompt.

## What changed

Evaluate the stored key's access-control policy explicitly with `LAContext` before signing. On cancellation, invalidate that context and wait for its authorization callback before releasing the lifecycle lock, rejecting any late success. Reload the key with the authorized context and disable further interaction so signing cannot open another prompt.

## Testing

Update unit tests to cover waiting for cancellation completion and rejecting completed authorization after cancellation. Add an ignored macOS hardware test and setup instructions covering persisted Secure Enclave key reuse, signature verification, cancellation, retry signing, and cleanup.

GitOrigin-RevId: 4ea9756430c5649654e95e047d1666617503072c
2026-10-13 22:40:57 +00:00
Chris Dong 6786dccbe7 Forward client voice session IDs in realtime requests (#53784)
## What changed

Add optional `voiceSessionId` to realtime start parameters and forward it as the `voice-session-id` header for WebSocket, WebRTC, and existing-call transports. Keep this client-generated voice session identifier distinct from `realtimeSessionId`, which uses `x-session-id`.

## Testing

Extend serialization tests and add coverage for distinct session ID headers, WebRTC request forwarding, and existing-call handshake forwarding.

GitOrigin-RevId: cb558dbb9d438f2d34e281199a7e81fe5d33b879
2026-10-13 22:21:31 +00:00
Konstantine Kahadze b56a579fc6 Remove the product-gating TODO from SkillPolicy (#53781)
GitOrigin-RevId: 8cfd2ba212fc944d09ede97d569fea13142ba389
2026-10-13 22:07:59 +00:00
Konstantine Kahadze 8b507a8e45 Remove redundant Codex manual cache directory check (#53780)
`nearestExistingParent` already checks whether the cache path exists and is a directory. Remove the duplicate `stat` check from `usableCacheDir` in the OpenAI docs manual fetcher, retaining the existing parent lookup and write/execute permission checks.

GitOrigin-RevId: 42583353bfdd06881171d8b24fa2b2d5b6fb3135
2026-10-13 22:06:50 +00:00
Anthony Tafoya 20b4ff2f35 Enrich V2 capability discovery with resolved plugin and skill metadata (#53763)
## What changed

- Return qualified skill names such as `team:deploy` and parsed `dependencies` and `policy` instead of a separate namespace and raw metadata file. Share `agents/openai.yaml` parsing and validation between skill loaders and executor discovery.
- Include each standalone skill's search-root ID and path in `discoveryRoot`, while accepting responses from older executors that omit it.
- Add plugin `displayName`, falling back to the manifest name or installation directory.
- Materialize inline MCP declarations in `mcpConfig` with the manifest as their source path, and report incomplete discovery when declared MCP or Apps configuration files have no returned contents.

## Testing

Add coverage for JSON round trips, omitted `discoveryRoot`, optional and invalid skill metadata, qualified names, display-name fallbacks, and inline MCP configuration. Verify standalone search roots survive cached discovery and sandboxed RPC responses.

GitOrigin-RevId: 4124972444ad7c2fb8c6418acbf9a589d797fad2
2026-10-13 20:40:38 +00:00
Felipe Coury 21c1616119 Support Command/Super shortcuts in the TUI keymap (#53754)
## What changed

- Accept `super` modifiers and normalize `cmd` and `command` aliases to `super`. Support capturing, displaying, and using these bindings in shortcuts, chords, and leaders.
- Add `super-left`, `super-right`, and `super-backspace` editor defaults for moving to the start or end of a line and deleting to its start.
- Honor safe Super-modified editor shortcuts during startup without treating them as text or inserting a pending paste newline.
- Save keymap edits through `config/value/write` when connected to a local daemon so it can validate bindings before they are saved or applied. Preserve the configuration and active keymap if the daemon rejects the edit.

## Testing

Add coverage for modifier aliases, shortcut capture and labels, chords and leaders, line editing, startup input, and daemon acceptance or rejection of keymap edits. Extend the startup PTY test with Command editing sequences.

GitOrigin-RevId: 8ed74f8253c89d423d5dfe87aa092844ce834454
2026-10-13 19:55:22 +00:00
Felipe Coury 3517671c60 Extend copy-on-select to composer text (#53753)
## What changed

Apply `tui.copy_on_select` to composer mouse selections on release, including X11 PRIMARY publication when enabled. Keep editable selections highlighted so typing can replace the selected text, even when `tui.copy_on_select_clear_selection` is enabled.

Share clipboard destination handling across the transcript, footer, and composer. Apply automatic deselection to footer selections after confirmed delivery, and release composer and footer PRIMARY ownership on focus loss or resume. Update configuration descriptions to clarify the behavior across all three surfaces.

## Testing

Add composer tests covering copy on release, retained selection highlights, replacement by typing, PRIMARY ownership lifetime, and clipboard-only status reporting for pending copies.

GitOrigin-RevId: 46999a32170149193fca561741000e97dfc458cf
2026-10-13 19:45:14 +00:00
jif e762c05bd6 Apply feature overrides when restarting the app-server daemon (#53751)
## Why

`codex app-server daemon restart` previously reused saved settings without applying feature flags supplied on the command line.

## What changed

Apply `--enable`, `--disable`, and boolean `-c features.*` overrides during an explicit restart and persist them for subsequent restarts. Accept nested `enabled` values, normalize feature aliases, and replace conflicting saved aliases while preserving unrelated settings.

Reject invalid feature toggles before stopping the daemon or saving settings.

## Testing

Add integration coverage for overrides on stopped and running daemons, alias replacement, preservation of saved settings, restarts without flags, and rejection of non-toggle keys without interrupting the running daemon.

GitOrigin-RevId: 14a657bc4758b9c248e363f9dac58f8887070a04
2026-10-13 19:36:44 +00:00
Philipp Spiess 5d4922595a Prefer remote Visualize installs over the bundled plugin (#53747)
## What changed

When the remote global catalog is active, let a cached `visualize@openai-curated-remote` install supersede `visualize@openai-bundled`, matching the existing Sites behavior. A disabled remote install also suppresses the bundled plugin; a missing remote bundle preserves the bundled fallback.

## Testing

Extend the agent-turn compatibility tests to cover Visualize with enabled, disabled, and missing remote bundles, asserting which skills appear in the developer prompt.

GitOrigin-RevId: 7d0cc564189249e597d5bd29b5800353d89a9060
2026-10-13 19:28:21 +00:00
Konstantine Kahadze c12cdc924b Remove modelSlug from the latest-model resolver output (#53745)
## What changed

Update the OpenAI docs sample resolver to return only `model`, `migrationGuideUrl`, and `promptingGuideUrl`, and remove the model-to-slug conversion helper.

GitOrigin-RevId: d7cea29ff8121b1a4df3b062d54dcbed6a1589bd
2026-10-13 19:01:27 +00:00
Anthony Tafoya cf0ed4c600 Acquire and cache opt-in executor capability inventories via V2 (#53736)
## What changed

- Add the disabled-by-default `executor_capability_discovery_v2` feature to acquire `capabilities/discoverV2` inventories from supporting remote executors using each selected environment's working directory and sandbox.
- Share snapshots with MCP and world-state contributors and skill providers without activating discovered plugins or publishing discovered skills to the model.
- Cache inventories by environment instance, executor session, working directory, and sandbox. Coalesce concurrent requests, refresh the cache at turn start, retry transient failures, and refresh MCP projections after recovery.
- Resolve the system skills root in the executor and pass it explicitly to capability location discovery.

## Testing

Add coverage for feature gating, unsupported executors, inert inventories, cache reuse and eviction, turn refreshes, failure recovery, executor replacement, and system skill locations.

GitOrigin-RevId: 1bdca28fa7f17622b27e2713ab3dcc0c13426889
2026-10-13 18:15:50 +00:00
felixxia-oai 4d82d36ccf Default Guardian v2 async classification to conversation mode (#53733)
## What changed

Use `conversation` when neither a local `async_classifier_mode` override nor a model default specifies a mode. Keep `snapshot` available as an explicit override and update the configuration documentation and schema to describe the new fallback.

## Testing

Expand configuration tests to cover all local override and model default combinations. Update app-server approval tests to exercise conversation mode without an explicit override, and explicitly select snapshot mode in tests that depend on it.

GitOrigin-RevId: a62479a3f6454bf28d589373a236d8b0ab5023b9
2026-10-13 18:08:10 +00:00
Dan Gillespie efa159f7aa Reuse compiled search patterns across compressed rollouts (#53732)
## Why

Compressed rollout searches recompiled the same query patterns for every file.

## What changed

Lazily compile and reuse the JSON-escaped and content search patterns across each scan, including the fallback scan when `ripgrep` is unavailable. Keep compilation failures within the existing per-file error handling and open files before compiling patterns.

## Testing

Add regression coverage verifying that an oversized query does not fail the compressed rollout scan and that a missing file still returns `NotFound` before query compilation.

GitOrigin-RevId: 0d41cbca6e1f716fc234c268493d8dd94c34975e
2026-10-13 17:54:31 +00:00
Felipe Coury 237b7d4323 Preserve the remote cwd filter in the in-app resume picker (#53728)
## Why

Opening the in-app resume picker created a new app-server session without the active session's remote working directory override, dropping the remote directory filter from the thread list.

## What changed

Pass the active session's remote working directory override to the picker session so its `thread/list` request retains the `cwd` filter.

## Testing

Add a regression test that opens the in-app picker against a recording remote server and verifies that `thread/list` includes the remote working directory in `cwd`.

GitOrigin-RevId: 0073ed77e9d9b0ffdd647fcb9f157d20ea2aa599
2026-10-13 17:41:03 +00:00
Benjamin Carlsson 72ad8747e9 Render Markdown web links as labels in Rex (#53725)
## What changed

Select label-only web link rendering when `TERM_PROGRAM` is `rex`, matched case-insensitively. Preserve the existing visible-destination fallback for multiplexers and `dumb`, `screen`, or `tmux` terminal modes.

## Testing

Add a regression test verifying that Rex renders `[label](https://example.com)` with the label-only policy.

GitOrigin-RevId: 615ca6186d84fc17cef9286e75848877b542b6ab
2026-10-13 17:30:45 +00:00
Anthony Tafoya 703d253ed6 Wire V2 capability discovery through exec-server RPC (#53723)
## What changed

- Register `capabilities/discoverV2` for initialized sessions and expose it through `ExecServerClient` and remote `Environment` APIs, checking executor support before calling it.
- Reuse startup discovery locations and retry failed prewarming on demand. Replay discovery once after executor recovery while preserving the request parameters.
- Track whether all required filesystem watches registered successfully and reload locations and metadata on each request when registration fails.

## Testing

Add coverage for RPC metadata refresh, omission of skill instruction bodies, sandbox isolation, startup scan recovery, disconnect replay, and successful or failed watch registration.

GitOrigin-RevId: 726e8f7e8b4d835b877f31d1d8a9f8eea1ad9c8b
2026-10-13 17:22:34 +00:00
Brian Lee 6cc7d9cc5c Enable Cyber access programs for API-key sessions by default (#53717)
## What changed

- Default `features.api_key_cyber_access_programs` to `true` and allow `codex exec` to select Daybreak with an OpenAI API key. Select the advertised standard program when `daybreak=false`, while respecting explicit feature opt-outs.
- Resolve API-key eligibility for TUI background turns from the target thread's feature settings, including project opt-outs. Omit access-program overrides when the server cannot report those settings.
- Preserve automatic server treatment for unlisted models and missing or empty Cyber program metadata in exec and TUI. Continue rejecting Daybreak when a nonempty program list does not offer it.

## Testing

Update regression coverage for API-key Daybreak selection, the off override, explicit opt-outs, resumed sessions, target-thread settings, and missing model metadata.

GitOrigin-RevId: f3cf7bd95a2754d4b4281bc70b18c7da4b177552
2026-10-13 16:57:54 +00:00
Michael Bolin 7d0b91d5d6 Separate MCP sandbox policy from launcher metadata (#53709)
## Why

MCP servers must forward sandbox policy unchanged to `codex sandbox --sandbox-state-json`, while interpreting launcher information to find the Codex CLI. Keep those contracts separate so consumers can preserve unknown policy fields.

## What changed

- Accept the experimental `codex/sandbox-state` capability alongside the deprecated `codex/sandbox-state-meta` capability, and send identical policy values under both `_meta` keys.
- Move `codexExecutable` out of the policy into `codex/sandbox-launcher`, supplied only when a verified CLI path is available for a local stdio server.
- Replace stale sandbox metadata while retaining unrelated entries, and remove stale launcher metadata when no launcher is available.
- Document the metadata contract and how servers should forward policy and retain authority for long-lived subprocesses.

## Testing

Update unit and integration coverage for policy serialization, identical state aliases, launcher availability across execution environments, and stale metadata replacement.

GitOrigin-RevId: e544c06e6e023953b1fc8069b7b1affa065262d1
2026-10-13 16:23:44 +00:00
jif cb7091b180 Preserve URLs and email addresses during external agent migration (#53706)
## Why

Rewriting source agent names and instruction filenames inside URLs and email addresses can change their destinations when importing external agent content.

## What changed

Use `linkify` to preserve recognized URLs and email addresses while rewriting surrounding text, including Markdown link labels and titles. Continue migrating instruction filename references to `AGENTS.md`, including relative links and references with line or column suffixes.

## Testing

Add rewrite coverage for URLs, email addresses, Markdown links, and surrounding Unicode text. Extend skill import and app-server configuration import tests to verify that link labels migrate while URL destinations remain unchanged.

GitOrigin-RevId: c4d210a287c99b6440438c99527364d379c568bd
2026-10-13 16:15:41 +00:00
Brian Lee 6fbfc352ca Enable CLI Daybreak by default and enforce background-turn eligibility (#53701)
## What changed

- Mark `cli_daybreak` as stable and enable it by default.
- Apply Daybreak to background turns only for eligible OpenAI accounts, allowing API-key accounts when `api_key_cyber_access_programs` is enabled. Preserve saved settings for ineligible accounts and report account lookup failures when Daybreak is enabled for the OpenAI provider.
- Skip inheriting Daybreak configuration when the app server does not support reading effective configuration.

## Testing

Expand dynamic-tool request tests to cover the feature toggle, ChatGPT and API-key authentication, API-key program eligibility, and unsupported configuration reads.

GitOrigin-RevId: 55a57315c9f527f977dd8305ea62d4096ed7dae9
2026-10-13 15:33:50 +00:00
felixxia-oai f6aca7dc46 Cancel Guardian V2 classifications that exceed the tool-call lag window (#53699)
## Why

Pending classifications can outlive the `max_tool_call_lag` window in which their scores are reusable, keeping metadata waits or classifier transports active after the result becomes stale.

## What changed

- Expire pending classifications when tool-call progress exceeds the configured lag allowance, preserving the wrapper discount while nested code-mode actions remain active.
- Cancel metadata waits and sampling in snapshot and conversation modes, including snapshot response drains after an early score.
- Treat expiry as supersession, preserving cached scores and the last completed conversation checkpoint and transcript cursor.

## Testing

Add regression coverage for lag boundaries, active wrapper discounts, transport cancellation before and after early scores, expired requests skipping preparation, and conversation history and transcript deltas surviving cancellation.

GitOrigin-RevId: 892ff13a05fd2b1573cef9842b934d1fc865d951
2026-10-13 15:25:12 +00:00
felixxia-oai ffc1402633 Interrupt and drain canceled classifier responses before socket reuse (#53698)
## Why

Canceled classifier requests need bounded cleanup that preserves received token usage and returns only safe WebSocket connections to the pool.

## What changed

- Own classifier response streams and connection leases together, interrupting dropped responses with a one-second cleanup deadline.
- Require a matching interruption acknowledgement and response completion before reusing a canceled response's socket. Retire sockets on rejection, invalid acknowledgements, or timeout while preserving any received completion and token usage.
- Skip requests canceled before dispatch and return their unused sockets to the pool.
- Distinguish cancellation from ordinary steering, which continues draining without requiring an interruption acknowledgement.

## Testing

Add regression coverage for cancellation, acknowledgement ordering and failures, cleanup timeouts, socket reuse, and token accounting under backpressure. Extend steering tests to cover rejected and missing acknowledgements.

GitOrigin-RevId: c4e7aac49d36cea2c2d0e9f2ba5f6147f67471dd
2026-10-13 15:24:00 +00:00
Felipe Coury 31434401fa Add keyboard selection support to the transcript view (#53693)
## What changed

Add transcript select-mode state with an underlined cursor, grapheme-aware movement via arrow keys or `h`/`j`/`k`/`l`, and vertical movement that preserves the preferred display column. Support marking with `v`, Space, or Shift-arrow keys and copying through the existing selection machinery.

Keep the displayed transcript snapshot and reading position paused during selection and after exiting the mode. Add entry and exit methods; this change does not yet bind mode entry to a user-facing key.

## Testing

Add unit tests for initial cursor placement, movement across empty lines and entry boundaries, wrapped text, preferred-column preservation, and Enter behavior with and without a marked range.

GitOrigin-RevId: e5bc380ea0eb6e2c6157ba73ac063d548a7de145
2026-10-13 15:11:10 +00:00
ioanbudea-OAI 979771476a Account for replay caches in encrypted compaction budgets (#53691)
## Why

Encrypted compaction payloads can include sampled-token replay caches that increase their size roughly threefold. Budgeting them as ordinary text can reject checkpoints that fit the model context budget.

## What changed

Use a shared estimate of one token per twelve ciphertext bytes, rounded up, for encrypted `Compaction` and `ContextCompaction` items in history and Guardian context budgeting. Guardian continues to count framing and metadata separately.

Check parent compactions against the configured token budget and a separate hard wire-size limit. Preserve the complete encrypted checkpoint when it fits. The token estimate remains a heuristic and can underestimate legacy checkpoints without replay caches.

## Testing

Add coverage for token-estimate rounding, parent compaction token and wire-size limits, and reviewer continuation with a cached compaction preserved intact.

GitOrigin-RevId: cc18ca29802491865167eef992830efcf93d97da
2026-10-13 15:05:16 +00:00
Brian Lee c03bbff483 Constrain API-key model access programs to server support (#53689)
## Why

Servers can advertise cyber access programs without accepting them for API-key accounts. The TUI must account for server support before exposing those programs.

## What changed

- Check `features.api_key_cyber_access_programs` at startup and when loading models for API-key accounts, clearing `available_access_programs` when forwarding is unavailable.
- Use thread-scoped feature settings after thread creation and honor feature requirements and CLI overrides at startup.
- Refresh account-scoped models when switching to or from API-key authentication or changing API-key thread context, clearing cached access programs while the refresh is pending.

## Testing

Extend session tests to cover enabled and disabled server settings, CLI overrides, and catalog filtering before and after thread creation. Update account-change tests to handle the model refresh.

GitOrigin-RevId: c80de30a0063b84949098d137715d8678bd70587
2026-10-13 15:03:34 +00:00
Keyan Zhang 044e74fef3 Preserve inherited context in prediction forks (#53678)
## Why

Prediction forks need to retain their parent's context even when it exceeds the automatic compaction threshold. Compaction or context resets can otherwise replace the history used for the prediction.

## What changed

- Apply a thread-local `AutoCompactionDisabled` policy to experimental prediction forks without changing model or skill budgets.
- Skip automatic compaction before, during, and after turns, including context-limit recovery, and suppress new token-budget reminders.
- Reject `new_context` requests for these threads and report context-limit failures without compacting their history.

## Testing

Add regression tests for legacy and paginated prediction forks across compaction thresholds, unchanged parent compaction and skill/tool inputs, context-limit failures, and rejected context resets. Add a request-history snapshot verifying inherited context and reminders survive without compaction or additional reminders after a tool call.

GitOrigin-RevId: 7df374287f4142f776981bb6c22e5caa564d74a5
2026-10-13 14:17:41 +00:00
jif 7b06e4af66 Publish Rust releases with the GitHub CLI (#53673)
## What changed

Replace `softprops/action-gh-release` in `.github/workflows/rust-release.yml` with explicit `gh` commands:

- Look up the release by tag, including drafts, and fail on API errors.
- Create stable releases as drafts until assets are uploaded. Create prereleases directly to preserve prerelease events.
- Upload sorted assets with `--clobber`, then publish the release with the configured title, notes, prerelease status, and latest status.
- Cap release notes at 124,999 characters, including a trailing newline.

GitOrigin-RevId: f343e4f265b06e047d85fe5a2b89a92690c7a7fb
2026-10-13 14:07:45 +00:00
jif 4c1cd8bbcc Keep discovered Apps tools available during startup recovery (#53672)
## Why

A transient Apps MCP startup failure can remove cached tools that the model has already discovered, preventing a later Code Mode invocation from using them.

## What changed

Keep cached Apps tools in the model's tool catalog while startup recovery runs. Let invocation readiness start or join a shared retry before acquiring the tool execution lock, while tool discovery remains nonblocking. Keep recovery running if a waiting invocation is cancelled.

## Testing

Extend connection-manager tests to cover cached tool bindings and shared recovery. Add a Code Mode regression test that discovers a cached Calendar tool, invokes it after startup fails, and verifies that it succeeds after recovery while unrelated tools remain able to execute.

GitOrigin-RevId: e888501a1050884a50a473e71b893cf6672fe256
2026-10-13 13:59:41 +00:00