Commit Graph
11579 Commits
Author SHA1 Message Date
jif 65c3f40bef Model exec-server session attachment state as an enum (#49286)
Replace the three optional fields in `AttachmentState` with `Attached` and
`Detached` variants, making inconsistent field combinations unrepresentable.
Keep the connection ID in both variants and the expiration deadline only in
`Detached`, and update attachment and expiration checks to match on the state.

GitOrigin-RevId: 6a5f05f0ce2f064acc8f5cacd00bc374c4f47986
2026-09-29 15:41:22 +00:00
Michael Zeng 18194bfd35 Restrict capability roots to captured turn environments (#49280)
## Why

Stale thread capability roots can reconnect executors that are not selected for the current turn and shadow selected roots with the same ID.

## What changed

Filter out roots whose environments are absent from the turn snapshot before deduplication and readiness resolution. Update app-server capability tests to explicitly select the executor environments used by each turn, including after resume.

## Testing

Add regression coverage for full-access and workspace-write permissions, verifying that stale roots never connect an unselected executor, selected roots with matching IDs remain available, and turns with no environments expose no roots.

GitOrigin-RevId: afe375047cc5e8aad06df83334149510460dcdcc
2026-09-29 15:10:17 +00:00
felixxia-oai d515b2f85e Avoid a turn teardown race in the Guardian agent message test (#49277)
## Why

`TurnComplete` can arrive before the previous turn finishes teardown, making `start_turn_if_idle` race with cleanup in the encrypted parent reply scenario.

## What changed

Submit the reply through `Op::InterAgentCommunication` so it queues through the same mailbox path as real agent messages. The scenario continues to verify that the encrypted parent reply appears exactly once in each incremental Guardian review.

GitOrigin-RevId: 3d356c274442aa839324b9425490feafacd47313
2026-09-29 14:52:58 +00:00
Nick Steele 4994306e9f Enable enterprise MCP sign-in and account-scoped grant cleanup (#49276)
## Why

The app server previously rejected OAuth login for enterprise-managed MCP servers. These servers need an explicit sign-in flow that ties saved authorization to the active Codex user and workspace and prevents canceled or superseded attempts from saving credentials.

## What changed

- Enable enterprise sign-in through `mcpServer/oauth/login` for configured servers with a connected thread, trusted IdP registration, and `features.use_xaa` enabled. Scope shared enterprise credentials by user, workspace, issuer, and client ID.
- Add `loginId` to MCP OAuth login responses and completion notifications, preserving compatibility with older servers that omit it.
- Support enterprise login replacement and `account/login/cancel`, wait for callback listener shutdown before replacement, and recheck account and configuration before saving grants. Fence stale attempts across processes and account changes.
- Remove shared enterprise authorization during account logout and `codex mcp logout`, including when the feature is disabled. Continue account logout if enterprise cleanup fails, and invalidate MCP runtimes on account changes.

Start a fresh session after successful enterprise sign-in to use the saved grant.

## Testing

Add regression coverage for login replacement and cancellation, callback port reuse, account changes during setup, cross-process logout invalidation, persisted workspace policy selection, cleanup failures, and responses from older servers without `loginId`.

GitOrigin-RevId: 7ed4caaab4659ed1e67064262cf5cee48e3a26ac
2026-09-29 14:46:33 +00:00
felixxia-oai 677b07eca0 Isolate realtime conversation tests from Responses prewarm connections (#49275)
## Why

Responses prewarm can reconnect and consume scripted WebSocket replies intended for realtime conversations when both share a test server.

## What changed

- Give realtime conversations a separate scripted server in tests for runtime replacement, prompts, and voice selection.
- Disable Responses WebSocket prewarm in the audio/text round-trip test while preserving coverage of the default realtime endpoint.
- Update connection counts and request assertions to address only realtime connections.

GitOrigin-RevId: 8e3b5ac86ee80777cf94063db468c80203966999
2026-09-29 14:45:09 +00:00
Nick Steele 0b1b78a4f1 Preserve thread overrides and cloud policy validity during config reloads (#49269)
## Why

Reloads can reject a valid thread configuration when the host configuration references a missing model provider that thread overrides replace. Concurrent cloud refreshes can also leave older policy snapshots or staged cache writes eligible for publication.

## What changed

- Compose preserved session layers before materializing refreshed configuration, retaining source-aware validation errors.
- Carry cloud policy revision bindings through config loading and role overrides. Reject stale MCP refreshes and disable enterprise MCP authorization when the policy is suspended. Retire the old policy when replacing or clearing its loader.
- Stage cloud cache writes in temporary files and publish them atomically only while their policy revision remains current.
- Route file reloads through the shared runtime refresh path, resolve paths relative to each config file, and preserve session settings. Restore host defaults for `secret_auth_storage` and `mcp_oauth_refresh_coordination` when explicit overrides are removed.

## Testing

Add regressions for thread-provided model providers, managed plugin and feature requirement refreshes, stale and suspended policy snapshots, superseded and retired cache writes, and file reloads preserving runtime settings and restoring feature defaults.

GitOrigin-RevId: 3280a2445eeb7074a142f720690bb0e4f01d174b
2026-09-29 13:58:09 +00:00
jif 68e1a421f5 Support remote agent message boards in multi-agent sessions (#49267)
## What changed

Add `features.multi_agent_v2.message_board_remote` with a board URL and a bearer token supplied directly or through an environment variable. When configured, use the remote board in preference to local or in-memory storage, including in ephemeral sessions, while preserving the existing board tools and session identity.

Ignore remote board settings in project-local configuration and use the runtime HTTP client and clock for remote requests.

## Testing

Add a mock-server integration test and snapshot covering an ephemeral session posting through the existing tool, with the expected bearer authentication, session identity, timestamp, and returned post.

GitOrigin-RevId: 263413d90a1ee4c0bdba8c1b08ba9f68bdd7a986
2026-09-29 13:52:04 +00:00
jif 5f7d5add2a Remove the remote agent message board client README (#49266)
GitOrigin-RevId: b165bcc82473b5896f830ad8e56cca06b6f8bf7a
2026-09-29 13:49:49 +00:00
jif a7660cd154 Trace turn phases and correlate accepted input with turns (#49262)
## Why

Steering and recovery requests can have different traces from the turn they join. Sampling can also finish while tools remain in flight. Tracing needs to preserve that correlation and distinguish sampling time from time spent waiting for tools.

## What changed

- Add `codex.turn_input` spans with `conversation.id` and the accepted `turn.id` for started, steered, and recovered turns.
- Add sampling, tool-blocking, and automatic and manual compaction spans with `codex.turn.phase` and conversation and turn IDs. End the sampling span before draining outstanding tools.
- Emit a `codex.mailbox_preemption` event when pending mailbox input preempts sampling.

## Testing

Add integration coverage for cross-trace steering and recovery, sampling and tool-blocking boundaries through a blocked dynamic tool, and completion or interruption. Extend mailbox preemption tests to check event emission with preemption enabled or deferred.

GitOrigin-RevId: 59893c2d463c02cbd05f5c332e5afc2351cc8b62
2026-09-29 13:09:30 +00:00
zm-oai f35a0fdc5d Preserve Windows sandbox runner launch errors (#49261)
## Why

Restoring the error mode with `SetErrorMode` can overwrite the failure code from `CreateProcessWithLogonW`, causing `RunnerLogonError` to report the wrong error.

## What changed

Capture `GetLastError()` immediately after a failed runner launch, before restoring the previous error mode, and use the saved code for `RunnerLogonError`.

GitOrigin-RevId: c0f4267232306be4d06e7e8accd60f7b77b8d6f3
2026-09-29 13:09:03 +00:00
Nick Steele af0d68a236 Restrict enterprise MCP auth and fail closed on config refresh (#49260)
## Why

Configuration reloads must honor current managed restrictions without granting new enterprise MCP authority to existing sessions or overwriting newer configuration with stale snapshots.

## What changed

- Allow enterprise managed authentication only for configured MCP servers. Remove plugin `ema_auth` overlays from the schema and disable servers that still use them.
- Refresh ordinary MCP settings while preserving session settings and initially admitted enterprise registrations. Disable enterprise MCP when its registration changes, policy revokes access, or configuration loading or resolution fails; require a new session to restore enterprise authority.
- Publish refreshes only when their captured configuration is still current, with bounded retries in app-server reloads. Preserve updated managed restrictions even when a refresh is rejected.
- Finish processing other thread refreshes before `config/mcpServer/reload` reports a rejection, and document that an error can accompany partially applied changes.

## Testing

Add regression coverage for stale refreshes, bounded retries, managed-policy revocation, persistent enterprise disablement, ordinary MCP transport changes, and rejection of plugin enterprise authentication. Verify that denied enterprise servers receive no requests.

GitOrigin-RevId: 34429cd339c1ec152a2ee8697cb29f0cff5d9e5f
2026-09-29 13:08:37 +00:00
felixxia-oai 4f16bdc265 Allow Guardian cached approvals with incomplete root context (#49257)
## Why

Missing retained root instructions could indefinitely block a worker's matching low-risk cached score from approving an action.

## What changed

Require complete retained local context for cached approvals, while allowing incomplete root context when the cached score matches the current authorization. Root omissions remain visible to the classifier.

## Testing

Extend the cached-delivery regression test to verify that a worker with complete local context and an `IncompleteRootInstructions` marker can approve using a matching low-risk cached score.

GitOrigin-RevId: 06feda47fe47feb933c67239d32bf154b2032615
2026-09-29 12:56:14 +00:00
felixxia-oai 0462dcc062 Use executable fixture copying in the bundled bwrap test (#49246)
## Why

Copying executable fixtures in the test process can expose writable file descriptors to sibling spawns. The shared `copy_executable` helper completes copies in a separate process on Linux before launching the fixtures.

## What changed

Use `copy_executable` for both `codex-linux-sandbox` and `bwrap` in `bazel_build_rejects_tampered_bundled_bwrap`, and add `codex-utils-cargo-bin` as a Linux test dependency.

GitOrigin-RevId: 05fb1381eeefb64568b525925c9e81863acc2b54
2026-09-29 11:51:21 +00:00
Eric Traut c248f6d48b Fix model provider lookup for TUI history (#49171)
Read `model_provider` from the effective configuration's nested `config`
field in `history_model_provider`, retaining the `openai` fallback.

GitOrigin-RevId: 06a8b3da1b499e673f80b8827951020c469c3970
2026-09-29 05:10:13 +00:00
Eric Traut fbc169827e Suppress Windows console windows for background subprocesses (#49164)
## Why

Background helpers launched from a detached Windows process can allocate console windows. Job Object launches and containment fallbacks need to preserve console suppression as well.

## What changed

- Add `codex_utils_process::background_command` to set `CREATE_NO_WINDOW` on Windows, and use it across background subprocess launches, including Git, plugins, authentication, diagnostics, and sandbox helpers.
- Centralize console suppression in Job Object launches. Keep `CREATE_NO_WINDOW` when retrying without containment, and clear `CREATE_SUSPENDED` so the fallback child can run.
- Preserve console inheritance for interactive shell launches and interactive AWS authentication refreshes.

## Testing

Add Windows regression tests covering console-free launches from detached parents through standard and Tokio commands, stdout/stderr capture, successful containment, Job Object creation and assignment failures, and sandbox setup refresh helpers.

GitOrigin-RevId: b2c238fa7d4f9fbd868e5adf7d4be9958ff01e6c
2026-09-29 04:38:37 +00:00
Eric Traut 3226512d47 Honor app-server provider defaults in the TUI (#49161)
## Why

Client provider defaults can override the app server's configured provider and hide its sessions from resume and fork history.

## What changed

- Omit implicit provider overrides from thread start, resume, and fork requests so the server can resolve its defaults.
- Use the server's effective provider for named history lookup, `--last`, and resume and fork pickers, while honoring explicit CLI and selected-profile choices.
- Respect managed provider requirements when resolving history filters and preserve the active session's provider when forking it.

## Testing

Add app-server regression tests for provider defaults, explicit choices, configuration changes, selected profiles, and managed requirements. Add CLI coverage for resume and fork pickers and `--last` with local daemon and embedded servers, plus a picker rendering snapshot.

GitOrigin-RevId: a077758b13a5e55552b52e5532ad4bebe86dce7e
2026-09-29 04:17:32 +00:00
Eric Traut 0d7b8117d3 Support projectless TUI sessions with workspace defaults (#49160)
## What changed

- Skip folder trust prompts for locally discovered projectless directories without a saved trust decision. Apply workspace-write permissions and granular approval defaults only when local execution, configuration, and managed policy allow them.
- Prompt for Windows sandbox setup when needed before enabling implicit workspace-write permissions.
- Restore saved task permissions on resume unless explicitly overridden, and keep ordinary turns from overwriting the server's saved permission profile. Track explicit approval reviewer choices separately from restored permissions.
- Let `/cd` request folder trust with a “Keep current directory” option. Recheck task activity and background terminals before switching, and enforce destination permission requirements.

## Testing

Add regression coverage for projectless defaults and session transitions, explicit permission overrides, saved profile preservation, trust discovery, destination policy conflicts, and the directory consent and Windows sandbox prompts.

GitOrigin-RevId: cf74f5a90245f2aee96caa80d76de64da6ec1ebd
2026-09-29 04:13:14 +00:00
Benjamin Carlsson c6c7c8d270 Omit blockquote markers when copying quoted selections in the TUI (#49153)
## Why

Copying text selected within a blockquote adds Markdown quote markers that are not part of the selected content.

## What changed

Return plain text for selections containing only quoted content, preserving literal `>` characters and selected whitespace. For quoted tables and task lists, remove quote prefixes while retaining table reconstruction and checkbox states. Selections spanning quoted and unquoted content continue to preserve Markdown structure.

Preserve the existing logical source when marking list separator lines as omitted from Markdown copying.

## Testing

Add coverage for partial and nested blockquote selections, quoted tables and task lists at narrow and wide widths and after rewrapping, and copying a mouse-selected blockquote.

GitOrigin-RevId: 5ac0c8c47a77937e5a35c376d8908065217ad2dc
2026-09-29 03:49:47 +00:00
akira-oai 3a16c0b707 Simplify cloud task base URL normalization (#49147)
Replace the trailing-slash removal loop in `normalize_base_url` with
`trim_end_matches('/')`, preserving existing behavior.

Add regression coverage for unchanged URLs, single and repeated trailing
slashes, empty and slash-only inputs, and ChatGPT URLs with and without
`/backend-api`.

GitOrigin-RevId: db71e80c4dcaac33b308a45684b14e7edbd71528
2026-09-29 03:32:19 +00:00
Eric Traut 8d48f71922 Hide reasoning summary settings in /status for server connections (#49145)
## What changed

Omit the reasoning summaries setting from the model details when connected to a remote server or local background server. Continue displaying it when no server connection is present.

## Testing

Expand status snapshots to cover no server connection, a remote server, and a local background server, including the reasoning summary setting visibility in each case.

GitOrigin-RevId: f7213e7ad7439107705461ccf4e070501729113b
2026-09-29 03:24:14 +00:00
Eric Traut ff3c82c8a9 Preserve server reasoning summary and verbosity settings in the TUI (#49144)
## Why

Forwarding local defaults as request overrides can replace server defaults or saved thread settings for reasoning summaries and verbosity.

## What changed

Only forward `model_reasoning_summary` and `model_verbosity` as shared thread request overrides when their winning configuration layer is a session flag or an explicitly selected user profile. Use the effective values from that layer, and omit values whose winning source is ordinary user or project configuration. Preserve the existing reasoning-summary defaults for new embedded threads.

## Testing

Add coverage for profile, project, and CLI precedence. Extend outbound model request tests to verify that remote-mode thread start and resume preserve server reasoning summary and verbosity settings despite conflicting local values.

GitOrigin-RevId: 5e14254a51ed7506118a46847bb7466ab58908ef
2026-09-29 03:23:49 +00:00
Bryan Ashley f53f5a6fed Expose original error details to turn lifecycle contributors (#49138)
## Why

Turn error hooks receive only a `CodexErrorInfo` category, which omits backend metadata such as usage-limit reset times and rate-limit snapshots.

## What changed

Add borrowed `CodexErrorDetails` to `TurnErrorInput` and pass the original details through turn and compaction error notifications, alongside the existing error category.

## Testing

Add coverage for usage-limit metadata during sampling, manual compaction, and post-turn compaction, including preservation of completed answers and existing error events. Extend lifecycle tests to verify that an `InvalidImageRequest` retains its details when surfaced as `BadRequest`.

GitOrigin-RevId: 6f2058992126da0f69508ef51998e7581557deea
2026-09-29 02:40:51 +00:00
Benjamin Carlsson d7f7fa4106 Remove the plus separator after Option symbols in TUI key hints (#49136)
## What changed

Render macOS Option shortcuts as `⌥t` and `ctrl+⌥t` instead of `⌥+t` and `ctrl+⌥+t`. Keep `+` separators after text modifier labels such as `ctrl`, `shift`, and `alt`.

## Testing

Update key-label and chord assertions and UI snapshots to expect the compact labels across shortcut help, navigation hints, and tooltips.

GitOrigin-RevId: 7d52088ebce3dfa3f8bdad65eb159ca0fead8a31
2026-09-29 02:37:23 +00:00
andrewgu-oai 458f7046a5 Treat explicit provider model catalogs as authoritative (#49135)
## Why

Providers with `model_catalog_url` could advertise bundled models absent from their catalog or reuse stale models after a failed refresh. Model metadata could also match by prefix or namespaced suffix instead of the provider's exact model ID.

## What changed

- Suppress bundled model fallback and merging for explicit provider catalogs, including when discovery is disabled.
- Require unique, non-empty catalog slugs and match metadata by exact model ID.
- Serialize explicit catalog refreshes and invalidate in-memory and persisted catalog entries after fetch failures, preventing stale cache reuse.
- Report a clear configuration error when startup has no available model, while allowing an explicitly configured `model`.

## Testing

Add regression coverage for exact model matching, hidden catalog entries, cache invalidation across restart and recovery, invalid slugs, and empty-catalog startup with and without an explicit model. Update app-server model-list expectations and verify the TUI configuration error.

GitOrigin-RevId: ac323a94178e3c48df8d4a159a86fdbac20b03a2
2026-09-29 02:33:55 +00:00
Won Park a9118edae8 Move content-filter guidance into the shared Responses retry handler (#49130)
## What changed

Move content-filter guidance recording from the sampling loop into
`handle_response_stream_error`. Pass `StepContext` so the handler can resolve
model-specific guidance and record it before retry decisions for sampling
requests. Keep remote compaction excluded from guidance recording and update
callers and the existing retry-deadline test to use the new signature.

GitOrigin-RevId: 030bde1d4f1597fc4f3971ad837478e5304c5aa9
2026-09-29 02:05:56 +00:00
Anthony Tafoya 13f580ef09 Deduplicate cloud and executor skill listings before budgeting (#49127)
## Why

Skills available from both cloud and executor providers consume duplicate catalog space, leaving less room for descriptions of unique skills.

## What changed

- Prefer model-visible cloud skills over executor listings with the same `plugin:skill` name before allocating the metadata budget.
- Preserve aliases from the full visible executor inventory so filtering duplicates does not renumber remaining packages. Continue choosing full locators when they fit the budget better.
- Keep executor packages available through `skills.list` and `skills.read`, and retain executor listings when cloud skills are disabled.

## Testing

Add regression tests and a model-request snapshot covering description retention, stable aliases across turns, executor availability changes, package reads, and full-locator selection after deduplication.

GitOrigin-RevId: 477e4cf16b8968dbe61438dd5af1eca9cbfa78c8
2026-09-29 01:57:57 +00:00
Won Park 8bd5a136ff Add recovery guidance to content-filter retries (#49119)
## Why

Responses stopped by `content_filter` previously followed generic stream-error retry handling without guidance about the block. Retried requests need instructions to explain the limitation and offer a permitted alternative.

## What changed

- Recognize content-filter failures as a distinct error while preserving retryability and the existing public error representation.
- Append developer guidance to the conversation after each sampling block, retaining delivered output and using the existing retry handling.
- Support a model catalog override through `model_messages.content_filter_guidance`. Missing, null, blank, or values exceeding 512 UTF-8 bytes fall back to bundled guidance.
- The bundled guidance tells the model to avoid reproducing or working around blocked content, briefly explain the limitation, offer a permitted alternative, and continue unrelated authorized work.

## Testing

Add a scenario and request-history snapshot covering repeated blocks, catalog guidance on each retry, retained partial output, and eventual completion. Add error-mapping assertions for retryability, public error classification, and error text.

GitOrigin-RevId: ba0c201b3a5a3acf5cfa971332027240e0690225
2026-09-29 01:14:41 +00:00
Celia Chen 6c49240565 Correct provider authentication storage documentation (#49118)
Clarify in the `requires_openai_auth` field documentation and configuration schema that credentials use the backend selected by `cli_auth_credentials_store`, rather than always being stored in `auth.json`. Also clarify that `env_key` specifies the environment variable containing the API key.

GitOrigin-RevId: e65753a72258e43b24c4e40b51ff26830c5b3756
2026-09-29 01:01:34 +00:00
papayo-oai 2e6cc4ed8d Attribute analytics requests to each thread's product SKU (#49117)
## Why

Sessions can share an analytics client while using different product SKUs. Analytics requests need per-thread attribution to reflect each session's configuration.

## What changed

- Register each thread's `apps_mcp_product_sku` and send `X-OpenAI-Product-Sku` on analytics requests grouped by product, without changing authentication.
- Send product groups concurrently while preserving event order within each group.
- Flush buffered tool events before changing or evicting their product attribution, and clear attribution when a session disables analytics.
- Bound retained thread registrations and concurrent product groups. Drop attribution when registration cannot be queued or a batch exceeds the product-group limit.

## Testing

Add tests for shared-session attribution, clearing attribution on resume with analytics disabled, buffered events across product changes, queue overflow recovery, registry limits, and concurrent delivery with preserved event order.

GitOrigin-RevId: 25a98788cd44d4a85f97ee87aadf3a6909607f6a
2026-09-29 00:49:23 +00:00
oli-oai 69043f05c4 Point remote compaction tests at the mock ChatGPT server (#49114)
Set `chatgpt_base_url` to the supplied mock server URI in
`make_remote_compaction_session`.

GitOrigin-RevId: de5c6e208fd104cbe07a8873e7e33c108dac7a57
2026-09-29 00:43:03 +00:00
Felipe Coury 0196495288 Add X11 primary selection and middle-click paste support (#49112)
## What changed

- Publish released mouse selections from both transcript views to X11 `PRIMARY` as plain text, even when copy-on-select is disabled. Preserve configured `CLIPBOARD` copying when it is enabled.
- Paste `PRIMARY` into the editable fullscreen composer on middle-click, including while a transcript selection remains active.
- Limit support to local Linux X11 sessions, excluding Wayland, SSH, tmux, WSL, and VS Code terminals.
- Retain the latest deferred selection publication and order it before a pending `PRIMARY` read, while giving explicit copies priority. Cancel stale deferred work when its selection or paste target is invalidated.
- Clarify that scrollback mode uses native terminal copy, paste, and scrollback.

## Testing

Add regression tests for selection publication with copy-on-select enabled and disabled, publication-before-read ordering, explicit-copy priority, cancellation of deferred work, and middle-click paste invalidation.

GitOrigin-RevId: 6ba7bddffda60183b7f9ad5cd69a97da8a4a8dcd
2026-09-29 00:40:54 +00:00
Benjamin Carlsson 8f6517772b Add history pagination to the agent command center (#49106)
## Why

The command center seeded only ten recent sessions, with no way to browse older history from the task list.

## What changed

- Add a keyboard-selectable “Show more” row that discovers up to ten more tasks, with loading and retry states that remain accessible during search.
- Retain per-source cursors and buffered rows across requests, merging interactive and non-interactive history by recency without discarding existing tasks on failure.
- Refill vacancies after tasks are archived or deleted, and prevent stale refreshes from restoring removed tasks.
- Limit routine detail refreshes to recent and loaded tasks, plus explicitly targeted threads, as retained history grows.

## Testing

Add regression coverage for pagination across mixed sources, cursor retries without row loss, automatic refill, queued pagination, and “Show more” navigation, loading, search, and retry rendering.

GitOrigin-RevId: 0bfcc970c9adf0c8d509b275a92ecf01c29595ad
2026-09-29 00:18:20 +00:00
Eric Traut 136391a23e Resume unsent TUI input after reconnecting (#49105)
## Why

Reconnecting paused all recovered input, including queued messages that had never been sent. Those messages can resume automatically once any uncertain submissions are resolved.

## What changed

- Track unsent and unconfirmed messages separately. Reconcile submitted prompts and steers using exact client message IDs from restored history, buffered events, and later receipts.
- Remove confirmed submissions from the recovered queue and resume unsent input after replay. Keep uncertain submissions paused without resending them, and show a notice identifying the message whose delivery could not be confirmed.
- Preserve pauses for unavailable conversations, pending compact/review requests, and existing input recovery failures.
- Simplify reconnect status text and remove blanket disconnect/reconnect transcript notices.

## Testing

Update reconnect integration tests and snapshots for automatic queue resumption. Add coverage for matching and unrelated receipts, missing history, late confirmations across navigation, pending compaction, and preservation of image-failure recovery pauses.

GitOrigin-RevId: d0b9aa43c4019d472985d12bbce8ba9bbfb9253b
2026-09-29 00:17:56 +00:00
jgershen-oai 7e049b3eaa Balance Windows Bazel test shards using duration estimates (#49103)
## Why

Hash-based sharding does not account for differences in test duration. Use estimated test time to balance the Windows Bazel workload across shards.

## What changed

- Add checked-in duration weights and a deterministic selector that assigns the longest targets first to the least-loaded shard.
- Assign every queried target exactly once, default missing weights to one second, and ignore stale weights.
- Run queries and selection in the foreground so failures stop the job before tests run with a partial target list.
- Emit LF-delimited target labels for Git Bash and report estimated shard loads on stderr.

## Testing

Add seven passing selector tests covering deterministic coverage and balancing, missing and stale weights, invalid inputs, duration-file overrides, and CLI output. Run them on the first Windows CI shard.

GitOrigin-RevId: d415ae093bfe57794ee53a2eb9d712022202dad8
2026-09-28 23:52:19 +00:00
Benjamin Carlsson c2d2f422e6 Preserve SQLite vacuum modes and surface pool initialization errors (#49102)
## Why

Changing an existing database from `FULL` to `INCREMENTAL` auto-vacuum requires a writer lock and can block pool initialization. SQLx also retries connection initialization failures, masking the original error as `PoolTimedOut`.

## What changed

Preserve existing auto-vacuum modes when opening writable pools, while continuing to initialize empty databases with incremental auto-vacuum. Return the first connection initialization error directly to the caller, retaining SQLx's normal error handling for later lazy connections.

## Testing

Add regression tests for fresh database settings, opening an existing `FULL` auto-vacuum database under a write lock, and preserving the WAL conversion lock error while allowing a subsequent open to succeed after the lock is released.

GitOrigin-RevId: b586c68e43a5a0d3b47268378716919d01b749cf
2026-09-28 23:44:39 +00:00
Dmitriy Kovalenko bfdb157178 Reuse the HTTP connection pool for remote plugin requests (#49100)
## Why

Each call to `PluginsConfigInput::remote_plugin_service_config` created a new HTTP client pool, preventing connection reuse across service configurations.

## What changed

Share one lazily initialized, route-aware pool across a `PluginsConfigInput` and its clones. Newly constructed inputs retain separate pools, while service configurations continue to use the current endpoint and product SKU and requests use the supplied authentication.

## Testing

Add tests for lazy initialization, pool sharing across repeated calls and early clones, isolation between new inputs, and requests using updated endpoints, product SKUs, and authentication with the shared pool.

GitOrigin-RevId: 3e929c34052798779a4f153e4db03b3f75b6f87d
2026-09-28 23:33:10 +00:00
Dmitriy Kovalenko 1260716393 Cache parsed plugin manifests across plugin workflows (#49099)
## Why

Repeated plugin discovery and loading reparse unchanged manifests and repeat warnings for invalid fields.

## What changed

- Share a manifest cache through `PluginStore` across marketplace listing, plugin loading, capability inspection, and tool suggestion metadata.
- Reuse successful parses by plugin root, manifest path, and content digests, including the Codex overlay. Reread files on each load so manifest edits and overlay changes or removal remain visible.
- Bound the cache to 128 entries and bypass caching for inputs larger than 64 KiB. Retry failed parses and share entries across store clones while keeping independent stores isolated.
- Reuse loaded manifest data when loading apps and MCP metadata.

## Testing

Add unit coverage for parse reuse, warning deduplication, revision invalidation, repair after parse failures, equivalent Windows paths, store isolation, and oversized inputs. Add an app-server regression test that verifies repeated `plugin/list` requests observe manifest and overlay revisions in one running server.

GitOrigin-RevId: ed082cd7d198015cd8ed35db7f2af74e13f49915
2026-09-28 23:32:45 +00:00
zm-oai f5430515a8 Resolve Windows sandbox PowerShell fallbacks on the exec server (#49098)
## Why

Remote controllers cannot resolve a sandbox-compatible PowerShell executable on the execution host.

## What changed

Apply the existing PowerShell fallback during exec-server request preparation for the `Elevated` and `Mxc` Windows sandbox backends. Match `pwsh` and `powershell` executable names case-insensitively and replace inaccessible Store PowerShell paths when a compatible executable is available.

## Testing

Add Windows RPC regression tests for lowercase and mixed-case PowerShell aliases with a restricted server `PATH`, verifying successful command execution in the `Mxc` sandbox.

GitOrigin-RevId: 365541af2f026a662b1988429f5d182c98e4a236
2026-09-28 23:21:26 +00:00
xli-oai 9563713df2 Notify lifecycle extensions of compaction usage limits (#49097)
## Why

Usage-limit failures during manual or post-turn compaction did not notify turn lifecycle extensions, leaving them unable to react to these errors.

## What changed

Emit the turn error lifecycle notification for `UsageLimitExceeded` in both compaction paths. Preserve the completed answer after post-turn compaction fails, and avoid duplicating the error already emitted by manual compaction.

GitOrigin-RevId: f31155e5991d762a0779030921aedbd1f818cfbb
2026-09-28 23:00:28 +00:00
cassirer-openai 2ce64843be Update h2 from 0.4.16 to 0.4.19 in Cargo and Bazel lockfiles (#49096)
GitOrigin-RevId: d38aedc1363465faf4aa5d8c61d10f4d32c8e1bf
2026-09-28 22:55:43 +00:00
Eric Traut 19892aee0c Simplify startup promotions to platform-specific desktop app tips (#49093)
## What changed

- Replace plan-specific and Fast-mode promotions with the desktop app tip for the current platform, while preserving announcement priority and random-tip fallback.
- Share desktop app tips between the preferred slot and random tip pool, including Windows. Keep Linux app tips limited to graphical sessions outside WSL.
- Clarify installation and launch instructions for macOS, Windows, and Linux, and format launcher commands as code.
- Remove the Fast-mode status plumbing used by tooltip selection.

## Testing

Add snapshots for all three platform tips at a narrow terminal width. Update tests to cover plan-independent tip selection and platform availability.

GitOrigin-RevId: 34bbc95c47c83618f9ac1691a1b69ca4690b8665
2026-09-28 22:40:35 +00:00
Eric Traut 222e24b737 Render follow-up directive labels in the TUI and copied responses (#49089)
## Why

Follow-up directives contain display labels and prompt attributes. Show the labels without exposing directive syntax or prompt text in rendered responses and streaming previews.

## What changed

- Render `:codex-followup[label]{prompt="..."}` as its label, preserving inline Markdown styling and source offsets.
- Replace recognized follow-up directives with their labels when copying whole responses, while retaining the original source.
- Withhold unfinished directives in rich streaming previews and avoid cropping into prompt attributes when the preview window advances.
- Preserve literal code, escaped directives, and malformed source when rendering completed messages or copying responses.

## Testing

Add regression coverage for label formatting, nested brackets and backticks, literal and malformed directives, whole-response copying, and streaming holdback across long prompts and preview window boundaries.

GitOrigin-RevId: dce61d1164de0a576fe95fb2c67b177a1ed414e8
2026-09-28 22:20:29 +00:00
Tamir Duberstein 88e9a8329d Track app-server running turns incrementally (#49084)
## Why

Every thread state mutation scanned all tracked runtimes to recount running turns while holding the state lock. This count supports graceful restart draining introduced in https://github.com/openai/codex/pull/12517.

## What changed

Maintain `running_turn_count` in `ThreadWatchState`, adjusting it when a runtime's `running` flag changes or a running thread is removed. Publish the cached count while preserving notifications only when the count changes.

## Testing

Extend the running-turn watch test to cover duplicate starts, two simultaneous running threads, and removal of a running thread, with counts checked against the runtime map.

GitOrigin-RevId: e7d7ebb33b9ff4d24dc70d8f01ae981378fed5f8
2026-09-28 21:33:00 +00:00
jif 46d2585ea4 Skip remote Git discovery for Guardian diff paths (#49082)
## Why

An offline secondary executor can stall Guardian approval revalidation while diff display setup searches for Git roots, even when the review concerns another executor.

## What changed

Use each environment's working directory as the diff display root for Guardian sessions, regardless of `CwdRelativeTurnDiffs`, so this setup does not wait for remote Git discovery.

## Testing

Add a regression test that withdraws authorization during a pending approval and disconnects an unrelated secondary executor. Verify that Guardian retries with the updated authorization and denies the request.

GitOrigin-RevId: 3661759119935c68539e9eab8df2e862987d0d92
2026-09-28 21:18:17 +00:00
Eric Traut fe50d010e2 Update and centralize TUI subscription labels (#49079)
## What changed

Use a shared subscription label mapping for status and analytics views. Rename
`Pro Extra` to `Pro 200`, `Pro Standard` to `Pro 100`, and `Pro Max` to `Pro 500`,
while preserving the existing differences between status and analytics labels
for other plans.

## Testing

Update the status plan-label test expectations for the three Pro tiers.

GitOrigin-RevId: 47af1e7d56ef9f7701caff8af315f530087920b8
2026-09-28 20:59:25 +00:00
Tamir Duberstein 011f803f3c Avoid collecting unused Git metadata in skill analytics (#49076)
## Why

Skill invocation analytics only needs the repository's origin URL, but
`collect_git_info` also checks the repository and reads its commit and branch.

## What changed

Extract and export `get_git_origin_url` and use it directly in skill analytics
to skip the extra Git commands. Reuse the helper in `collect_git_info`,
preserving URL sanitization and command timeouts.

GitOrigin-RevId: f878936937d0ff8c6313bb8168448e0b25ba1a39
2026-09-28 20:45:16 +00:00
sayan-oai 3749d1eff7 Preserve pending environments when spawning subagents (#49075)
## Why

Spawning a subagent before an environment was ready dropped the starting environment from the child's selections. The child needs to retain that environment and receive its configuration or failure when preparation finishes.

## What changed

- Pass the spawning step's environment snapshot to children, preserving ready and starting environments and configuration ownership.
- Propagate the original owner's first configuration result through descendants, applying each session's validation and leaving independently configured children unchanged.
- Preserve pending configuration waits across executor retries. Later owner updates do not overwrite the child's inherited configuration.

## Testing

Add regression coverage for fresh and forked subagents, readiness through turn-settings updates, failure propagation to children and grandchildren, child configuration precedence, and executor retries. Add a request snapshot showing a child using `wait_for_environment` before execution tools become available.

GitOrigin-RevId: a2afed740391f88d195596cfe28e418332b60d43
2026-09-28 20:42:04 +00:00
Tamir Duberstein 22d1d9336f Propagate Cargo package versions to Bazel Rust targets (#49074)
## What changed

Expose resolved Cargo package versions in `rules_rs` workspace `DEP_DATA` and pass them through `codex_rust_crate` to build scripts, libraries, binaries, and tests. This replaces the hardcoded `0.0.0` build-script version and supplies explicit versions to the other Rust targets.

GitOrigin-RevId: a3555beec3c5ecfc38d69c352b43696986352c49
2026-09-28 20:34:59 +00:00
Eric Traut 15c08beee2 Surface realtime voice catalog failures in the TUI (#49073)
## Why

Failed `thread/realtime/listVoices` requests silently fell back to the built-in catalog, allowing voice selection and conversation startup to proceed without the server's voice catalog.

## What changed

- Propagate catalog errors and show an error instead of opening the voice picker or starting a realtime conversation.
- If the catalog lookup fails after saving a preference, report that the preference was saved but the effective voice could not be confirmed. Leave the in-memory voice settings unchanged.

## Testing

Extend remote voice tests and snapshots to cover catalog failures when opening the picker, saving a preference, and starting a conversation. Verify that the preference is persisted, in-memory settings stay unchanged, and failed startup clears realtime state without sending `thread/realtime/start`.

GitOrigin-RevId: ba40800d6f9002e02e2b33de8dc858188c3cddd7
2026-09-28 20:34:33 +00:00
Dmitriy Kovalenko 33a0f766a6 Reclaim unused SQLite log database pages in the background (#49069)
## Why

Deleting logs leaves free SQLite pages available for reuse without shrinking the database file. Reclaim excess free space while preserving a reserve for future writes.

## What changed

- Start a background incremental-vacuum worker with `StateRuntime`, enabling reclamation only for the logs database. Use a per-home file lock to select one worker and wait for it to finish during shutdown.
- Reclaim pages when at least 64 MiB and 25% of the database are free, preserving a reserve of at least 16 MiB or 10% of the database.
- Use short transactions with page and cooperative time budgets, defer work on contention, and reduce batch sizes with exponential backoff when interrupted passes make no progress.
- Record reclamation counts, durations, and reclaimed pages in telemetry.

## Testing

Add a regression test that interrupts a vacuum commit, verifies foreground writes can resume without data loss, then confirms a resumed pass shrinks the database and passes `PRAGMA integrity_check`.

GitOrigin-RevId: 8421f87b0aeef6540eda5690c84216906673c72e
2026-09-28 20:19:10 +00:00