Commit Graph
12500 Commits
Author SHA1 Message Date
smurching-oai 342ed69a17 Require managed configuration from the configured server (#56055)
## Why

Local administrators need to require managed configuration from a specific customer-hosted server before a session can start.

## What changed

- Add a local managed `config_server` requirement with an HTTPS base URL and optional OAuth settings. Validate endpoints and derive the bundle route as `codex/config/bundle` beneath the base URL.
- Replace the entire `config_server` block when a higher-priority requirements layer supplies one, keeping the endpoint and OAuth settings together. Reject this setting in fetched policy.
- Track the applied server through configuration snapshots, role overrides, and refreshes. Reject session startup and managed refreshes when the applied server does not match the requirement; user refreshes retain the session's managed configuration.

## Testing

Add coverage for missing, mismatched, and matching server configuration at session startup, whole-block replacement, rejection of server settings in fetched policy, and preservation across role overrides and refreshes.

GitOrigin-RevId: 51e8a1738dabdb117ae858120f6fb09ae2ff1261
2026-10-22 02:15:00 +00:00
viyatb-oai 2a77e82f09 Support configured credential providers in remote execution (#56049)
## Why

Remote credential masking previously fell back to unmasked execution whenever custom credential providers were configured.

## What changed

- Transport configured provider rules to the executor-local network proxy, where credential values and destination context are resolved.
- Advertise `credentialMaskingCustomProviders` and negotiate masking support. Keep the warning and unmasked fallback for executors that support only built-in providers.
- Discard provider rules when masking is disabled and omit their contents from debug output.

## Testing

Extend coverage for capability compatibility, provider configuration round trips, and fallback on older executors. Exercise configured-provider masking in remote request history and verify that masked placeholders are restored to real credentials in upstream request headers.

GitOrigin-RevId: b036f56900b343ddccc17b5293c82bc1f3426237
2026-10-22 01:54:51 +00:00
Anthony Tafoya 0769c6aeeb Enable executor cleanup hooks with V2 capability discovery (#56044)
## Why

Executor hooks depended on V1 discovery snapshots, so plugins discovered through V2 could not run their cleanup hooks.

## What changed

Prepare executor hook sources during step setup from either V1 or V2 discovery and capture them in `StepContext` for stop, interrupt, and memory consolidation hooks. Restrict V2 sources to selected plugin installations while preserving plugin enablement, hook admission, MCP routing, and app tool policy checks.

## Testing

Add unit coverage for V2 hook admission, environment routing, disabled plugins, and failed discovery. Add integration coverage showing that `Stop` and `Interrupt` cleanup hooks run with V2 discovery alone and remain silent when the plugin is disabled.

GitOrigin-RevId: a4c0e9c56bdebcdf22cea63f02f8fb4c5eed358e
2026-10-22 01:42:11 +00:00
Benjamin Carlsson 45179176e5 Add a channel-backed cloud app-server client (#56037)
## What changed

- Add `CloudClient` and integrate it with `AppServerClient` and `AppServerRequestHandle` for requests, notifications, server-request replies, events, and shutdown.
- Keep retained request and reply handles bound to their cloud backend, with event delivery independent of request completion and a timeout for shutdown.
- Return no platform or Codex home metadata for cloud clients, and reject TUI filesystem operations for this backend.

## Testing

Add tests for backend ownership of retained handles, independent event delivery, errors after the command receiver closes, and shutdown timeouts when the worker does not respond.

GitOrigin-RevId: 4cf308dc0ea6fa6e7b14dd4542d93e8030b0162d
2026-10-22 01:14:34 +00:00
smurching-oai 09ec2451bf Add request-scoped OAuth credentials and session lifecycle APIs (#56036)
## What changed

- Add `OAuthSessionRequest` to pair access tokens with their authorization identity and retain rejected-token recovery across transient failures and retries. New sign-ins receive an identity that survives token refresh.
- Expose explicit login, logout, and authorization identity lookup, plus a per-manager option to disable automatic browser login while allowing credential reuse and refresh.
- Move serializable `OAuthSessionConfig` into `codex-model-provider-info`, add an optional `device_authorization_url` field, and share endpoint URL validation through `codex-http-client`.
- Distinguish permission failures, transient token endpoint failures, and invalid responses using `io::ErrorKind`.

## Testing

Add coverage for sign-in identity preservation through refresh retries, removal of saved and cached credentials on logout, and suppression of automatic browser login. Extend token endpoint error classification coverage.

GitOrigin-RevId: ae9f72e787171e179fe139a3b840a9f7e1e46506
2026-10-22 01:07:13 +00:00
alexsong-oai 8440e76ae6 Enable the Bedrock setup wizard by default (#56033)
## What changed

Promote `bedrock_setup_wizard` to stable and enable it by default for eligible onboarding. Users can still disable it with `features.bedrock_setup_wizard = false`.

## Testing

Update onboarding coverage to check the enabled default and explicit opt-out. Remove the explicit opt-in from daemon startup tests so they exercise the default configuration.

GitOrigin-RevId: 5bd911088681a31d34aa444398e6d3f7d1d87955
2026-10-22 00:50:52 +00:00
Dmitriy Kovalenko 004c13292f Fix entrypoint lookup in package debug-symbol smoke tests (#56032)
## Why

Rust v0 symbols can mention `codex_code_mode_host` as the instantiating crate of a dependency's generic function, so matching the crate name alone can select the wrong function.

## What changed

Demangle `nm` output and match `codex_code_mode_host::main` exactly, preserving spaces within demangled names. Include local symbols in the Linux lookup by removing `--extern-only`.

GitOrigin-RevId: b4ea4face3fe861966d3643d13db168143bcefa3
2026-10-22 00:50:27 +00:00
liame-oai 943c70d8d2 Support client Responses API metadata in thread/sample (#56031)
## What changed

Add optional `responsesapiClientMetadata` to `ThreadSampleParams` and forward it to the sample turn's Responses API metadata. Update the experimental protocol schema.

## Testing

Extend the thread sample integration test to verify that client metadata appears in both the request header and body, preserves the explicit `turn_trigger` when client metadata supplies a conflicting value, and does not carry over to the next parent turn.

GitOrigin-RevId: eb1f80824d476fc6c584a2b35d97e59d51fd4273
2026-10-22 00:33:28 +00:00
richardopenai e8bb1b6641 Limit decoded HTTP/3 response headers in the TCP tunnel (#56024)
## Why

QPACK can expand compact response headers into large decoded field sections. Bound their size before `h3` constructs its capacity-limited `HeaderMap`.

## What changed

Set the HTTP/3 client's maximum field section size to 64 KiB so oversized responses are rejected with `HeaderTooBig`.

## Testing

Add a regression test that sends QPACK static references around the size limit and a much larger expansion. Verify that oversized responses are rejected and a subsequent valid response succeeds on the same connection.

GitOrigin-RevId: d7c83a7a755dfafae05919ec52542ffce40a1ef4
2026-10-22 00:19:02 +00:00
alexsong-oai d6a5c9d17e Group Bedrock API key entry with other AWS sign-in methods (#56023)
## What changed

When AWS profiles or environment credentials are detected, move manual Bedrock API key entry under “Other AWS sign-in methods” and update its description to include API keys. Keep API key entry directly available when no credentials are detected.

## Testing

Update onboarding method assertions and rendering snapshots to cover the grouped options and API key entry in the other sign-in methods menu.

GitOrigin-RevId: 992ecf7a2e3ac9f2f0eef2ef6534cf9beb88ea8e
2026-10-22 00:11:46 +00:00
Jeff Mickey 38da85f49e Preserve config overrides across CLI subcommand boundaries (#56022)
## Why

When `-c` or `--config` appears at multiple command levels, Clap retains only the deepest scope's values, dropping earlier overrides.

## What changed

Collect config overrides from each command scope in order while preserving typed child arguments and their existing precedence. Arguments forwarded after `--` remain unchanged.

## Testing

Add regression coverage for overrides split across nested `mcp add` commands, forwarded `-c` arguments, and validation of an invalid override before `app-server` when another override follows it.

GitOrigin-RevId: 40c64eda866497e2f59491a523c6777a8bfe5d5f
2026-10-22 00:07:50 +00:00
Benjamin Carlsson 233119375d Keep slash command prefixes in editable composer text (#56021)
## What changed

Keep the leading `/` in the textarea and render slash commands after the normal composer prompt, so `/model` appears as `› /model`.

Track the full `/command` token as a text element and remove stale slash-command elements when the draft changes. Update composer tests and snapshots for the new representation.

GitOrigin-RevId: 60119f18b69cec16f4e21839f45132231feb84b4
2026-10-22 00:07:27 +00:00
liame-oai 6f34d3d408 Allow thread sampling after failed or interrupted turns (#56020)
## Why

`thread/sample` previously required the latest source turn to have completed successfully, rejecting failed or interrupted turns even when the source was idle.

## What changed

Accept the latest completed, failed, or interrupted turn in both legacy and paginated history modes. Update the protocol documentation and validation error to reflect the accepted statuses, while continuing to reject stale or active sources.

## Testing

Expand integration coverage across all three terminal statuses and both history modes, checking that sampling preserves context and leaves the source unchanged. Also verify that sampling an active source is rejected before interrupting it.

GitOrigin-RevId: a5dfdb2800868ee178eae16b12ee7f6f9515898c
2026-10-22 00:06:08 +00:00
goodman-oai aafd81a7ad Avoid nested CLI startup in the MCP OAuth persistence test (#56018)
Use `ConfigEditsBuilder` to persist a concurrent MCP server edit during OAuth discovery without launching another CLI process inside the HTTP timeout. Preserve coverage that the concurrent server and issuer-bound callback are saved, and assert that OAuth fails with the expected invalid authorization endpoint error.

GitOrigin-RevId: 41d782f9dbbc96d528e4990171bffd87e95f6e4f
2026-10-21 23:58:33 +00:00
cassirer-openai deede7201d Keep rollout trace terminal sessions distinct when process IDs are reused (#56011)
## Why

Runtime process handles are recyclable and thread-local. Using them as terminal session identities can merge separate commands or associate `write_stdin` operations with the wrong exec.

## What changed

- Give each exec a distinct terminal session and track the latest session for each thread-local process handle.
- Record the exec selected by `write_stdin` at runtime and use it to correct session membership during replay, including when dispatch is delayed until a handle is reused.
- Fall back to the latest session for the thread and handle when replaying older traces without runtime target events.

## Testing

Extend reducer coverage for process ID reuse across threads and successive execs, stdin session membership, and delayed runtime target resolution.

GitOrigin-RevId: 330c6fd26a4eebdef03ae600a030dc76920e0dd9
2026-10-21 23:13:31 +00:00
taohong-oai 082900149c Add a critical-path timing recorder for direct tool calls (#56008)
## What changed

Add the `codex-direct-tool-timing` crate to record tool execution, automated reviews, human waits, and dependency paths. Human waits take precedence over overlapping reviews, and dependency waits with unavailable history are recorded as unknown time.

Invocation guards complete each call once, explicitly or on drop. Separate invocation identities prevent late review or wait guards from affecting calls that reuse an ID; duplicate active IDs disable ambiguous path attribution. Batch timing exposes the last-finishing invocation's path once all calls complete.

## Testing

Add unit tests for parallel batch completion, duplicate and reused call IDs, cancellation, missing dependency history, overlapping reviews and human waits, and nested wait guards.

GitOrigin-RevId: 8b251f51a0c52342657f2d244524b562a371bd8e
2026-10-21 22:49:54 +00:00
goodman-oai bc45d61a9a Pause Tokio time in the reused Guardian session test (#56007)
Pause the Tokio clock before spawning the review in
`run_review_on_reused_session_waits_for_submitted_turn` so its one-second
deadline uses simulated time while the test verifies that stale turn completions
are ignored.

GitOrigin-RevId: c6712219f894835b576f499eb080ec15a3f09a78
2026-10-21 22:49:31 +00:00
goodman-oai 3206e532d7 Assert shell tool overlap directly in the parallelism test (#56006)
## Why

A total-duration assertion does not prove that two shell commands overlap and depends on execution speed.

## What changed

Update `shell_tools_run_in_parallel` to wait for both commands to create start markers before releasing them through a shared file. Fail if both commands do not start within five seconds, and verify that each command exits successfully and returns its expected output.

GitOrigin-RevId: ba322157a60951ad5dd2f1b018ddc6007de1de89
2026-10-21 22:48:29 +00:00
viyatb-oai 82ef0672e3 Scope MITM credential substitution to trusted origins and placeholders (#56003)
## Why

Credential substitution needs to authorize the destination and the original request before exposing host secrets. Project configuration must not redirect trusted credential policies, and older clients must reject scoped policies rather than silently apply unconditional injection.

## What changed

- Add hook `schemes` and `ports` constraints and an exact whole-header `placeholder` for secret substitution. Require `network.mitm.version = 2` for these options in permission profiles.
- Restrict placeholder substitution to HTTPS on port 443 and reject missing, mismatched, or duplicate placeholder headers.
- Reject project changes to trusted MITM definitions and their inheritance chains. Allow self-contained project header-stripping policies only when no trusted MITM policy exists.
- Reject ambiguous query values, value-constrained headers, and semicolon paths during authorization, and preserve case-sensitive extension methods.
- Mark resolved secret headers sensitive, reject secret injection into `User-Agent`, restrict substitution headers, and limit secret files to 64 KiB.

## Testing

Add regression coverage for scoped TOML resolution, legacy-format rejection, unknown fields, project policy restrictions, origin and placeholder denials, ambiguous request matching, secret redaction, and hook application after credential brokerage.

GitOrigin-RevId: 78dc115ab6c88c9a734377626429bc4840731f89
2026-10-21 22:42:48 +00:00
jif 6203846fb3 Support confidential OAuth clients for enterprise-managed MCP auth (#56001)
## Why

Enterprise-managed MCP authentication previously required public OAuth clients at both the identity provider and the MCP authorization server, preventing use of registrations that require client secrets.

## What changed

- Accept separate `client_secret` and `token_endpoint_auth_method` settings for the enterprise IdP and MCP server OAuth registration. Support `client_secret_basic` and `client_secret_post`, defaulting to Basic when a secret is configured.
- Validate the registered method against server metadata and use it for enterprise login and both ID-JAG exchanges.
- Require a configured `oauth.authorization_server_issuer` for confidential MCP registrations and reject empty secrets or authentication methods without secrets.
- Require the account OAuth client to match the configured IdP client before reusing an account grant with a provisioned secret; otherwise use dedicated enterprise login.

## Testing

Extend configuration, login, exchange, and app-server lifecycle tests to cover confidential registrations, separate IdP and resource credentials, authentication method validation, and exclusion of client secrets from authorization URLs, stored login grants, and logs.

GitOrigin-RevId: b3be378c2b1bb67e6a3652c648e72fd2e21e956d
2026-10-21 22:30:35 +00:00
efrazer-oai f496b09bd1 Retry proxy CONNECT challenges with Windows authentication (#56000)
## Why

HTTPS requests and WebSocket connections on Windows need to authenticate when a proxy rejects `CONNECT` with status `407`.

## What changed

- Retry proxy challenges through the existing Windows authentication helper, using the signed-in user's Negotiate or NTLM credentials. Treat an origin `407` as a normal HTTP response.
- Bridge authenticated tunnels to the HTTP client through destination-specific named pipes, retaining redirect checks and TLS backend fallback without caching those tunnels across destinations.
- Carry explicit CA certificates and client identities into HTTPS proxy TLS configuration, and apply the configured connect timeout when opening authenticated HTTP tunnels.

GitOrigin-RevId: ec7d9168972a7a640350e5348cfca40307390fbf
2026-10-21 22:26:16 +00:00
efrazer-oai d5bc4161b6 Add a Windows proxy authentication tunnel helper (#55994)
## What changed

Expose `connect_windows_proxy` for callers handling a CONNECT `407` response. Use libcurl with the signed-in Windows user's Negotiate or NTLM credentials, then return the authenticated connection with buffered data preserved.

Support HTTP and HTTPS proxies, with default or caller-provided TLS configuration. HTTPS proxies requiring authentication tokens bound to their TLS connection are unsupported.

Enable libcurl's NTLM support in Cargo and Bazel builds.

## Testing

Add a Windows-only test asserting that libcurl provides NTLM, SPNEGO, and SSPI support.

GitOrigin-RevId: 4ed7d2208766404b6125ce2f4b5f91de5616a37f
2026-10-21 21:50:55 +00:00
bschoepke-openai d51e9c935f Preserve per-execution trace context in code-mode stdio callbacks (#55993)
## Why

Callbacks from the shared stdio host need to retain each execution's trace context after it yields, without keeping the execution span open until its background cell closes.

## What changed

Capture a W3C trace-context snapshot for each execution and restore it as the parent of tool callback and notification spans. Instrument delegate invocation and its returned future so the context is available on entry and across awaits.

## Testing

Add an integration test with overlapping yielded cells completed in reverse order. Cover sampled, unsampled, and untraced callers, trace isolation, callback and notification parentage, and execution spans finishing while callbacks remain blocked.

GitOrigin-RevId: 57924123d2c2f31bcfaf725688d8bba775235fa0
2026-10-21 21:46:56 +00:00
Dmitriy Kovalenko 07cc649c65 Avoid double-counting retained reasoning in token usage (#55991)
## Why

Responses Lite includes retained reasoning in its reported token usage even without an `X-Reasoning-Included` header. Adding a separate reasoning estimate can trigger automatic compaction prematurely. Locally recomputed usage also already includes retained reasoning.

## What changed

Initialize reasoning accounting from `use_responses_lite` before each sampling or compaction request, while allowing server events to override it. Mark locally recomputed token usage as including reasoning.

## Testing

Update the compaction regression test to verify that Responses Lite usage without the header stays below an 81-token limit at 80 tokens and triggers compaction at 81 tokens.

GitOrigin-RevId: 06f9272cb3c259e927941f1d2a1d7096310ffb2c
2026-10-21 21:23:01 +00:00
Anton Panasenko bd5a836567 Refresh remote exec-server credentials after unauthorized responses (#55987)
## Why

Remote registry requests need to recover when credentials are rejected or rotated while `exec-server` is running. Concurrent requests should reuse refreshed credentials rather than refresh the replacement token again.

## What changed

- Add an `AuthProvider` recovery hook and retry registry registration, connection, and harness-key validation once after a `401` when the provider supplies replacement credentials.
- Use live ChatGPT authentication for remote `exec-server` and guard proactive and unauthorized refreshes so concurrent callers share the completed refresh.
- Allow executor credentials to retry when the parent has already supplied a valid replacement.
- Keep connection authentication, refresh, and retry within the original connection deadline.

## Testing

Add coverage for concurrent refreshes, stored and parent-supplied credential rotation, refresh failures, retry limits, and connection deadlines, plus a CLI integration test for refresh and credential reload in a running executor.

GitOrigin-RevId: 9ed533e410762c7ac8b7c0c30bb93fd20d96778b
2026-10-21 21:05:08 +00:00
Dmitriy Kovalenko 17a0e6f63f Route SQLite logs to an explicitly configured log_dir (#55978)
## What changed

- Store `logs_2.sqlite` in `log_dir` when explicitly configured, unless a managed `sqlite_home` requirement applies. Keep other databases in `sqlite_home` and preserve the existing SQLite log location when `log_dir` is unset.
- Initialize and lock the selected log directory only when opening its database, so an unavailable directory does not prevent authentication commands from loading configuration. Share the cleanup lock across configuration clones and allow failed initialization to be retried.
- Leave existing logs in place. Read legacy logs for diagnostic submissions when the current query returns no logs, attaching them as `codex-logs-legacy.log`. Continue retention cleanup and page reclamation for both locations, with independent maintenance locks and filesystem checks.

## Testing

Add coverage for configuration routing and managed requirements, deferred initialization and lock lifetimes, authentication with an unavailable log directory, legacy log attachments, and cleanup of current and legacy databases.

GitOrigin-RevId: 48216694596d738eff1b3c5eef6c4e7ada6d0137
2026-10-21 19:53:00 +00:00
Dmitriy Kovalenko 3c4c04b224 Add an experimental command to migrate NFS databases to DELETE mode (#55975)
## What changed

Add `codex migrate-nfs-db` to replace configured SQLite WAL databases in place with validated copies in `DELETE` journal mode, retaining the originals and their sidecar files in backup directories. Stage conversion locally, check database integrity before installation, and support resuming an interrupted replacement.

Require confirmation and exclusive access, with all Codex instances stopped on every host until migration succeeds. The NFS mount must support cross-client POSIX locks. Reject unsupported file permissions and ACLs, and serialize migrations with a migration lock.

Support configuration overrides, `--profile`, and `--staging-dir`. Skip the logs database when `log_dir` is explicitly configured and leave databases already in `DELETE` mode unchanged. Reject remote mode.

GitOrigin-RevId: 7b48cc3a713113a3c09a2243e49b54258bef609d
2026-10-21 19:40:42 +00:00
felixxia-oai 8d06d62e15 Allow consumers to select message-board tools (#55973)
## Why

`message_board_tools` always exposed all nine discussion tools. Consumers need a way to expose a subset, such as `read_thread` and `list_threads`, over the same board.

## What changed

Accept an ordered slice of the new `MessageBoardTool` enum and optional description overrides in `message_board_tools`. Use the enum for schemas and dispatch, and keep the agent extension's existing tool set and order through `MessageBoardTool::DISCUSSION`.

## Testing

Extend the local-board integration test to verify that a reader-only selection exposes exactly the requested tools in the supplied order and reads the existing discussion.

GitOrigin-RevId: 60026d73768330ff4b694c3a9e99480e3ed7af27
2026-10-21 19:37:29 +00:00
felixxia-oai e41e882174 Add storage namespaces for local message boards (#55971)
## Why

Local message boards use a fixed database filename. Callers need separate storage for boards that share a session identity.

## What changed

- Add `LocalBoardOptions` with a validated `storage_namespace`, and support it when opening, configuring, and permanently deleting boards.
- Allow `LocalBoard::with_options` to select storage for its connections.
- Store custom namespaces in `message_board_<namespace>_1.sqlite`, while preserving `agent_message_board_1.sqlite` for the default namespace.
- Have the agent message board extension select the same namespace for opening, setup, and deletion.

## Testing

Add coverage for namespace isolation, reopening saved posts, and avoiding collisions with other runtime databases. Update setup tests to exercise a custom namespace through reopening and deletion.

GitOrigin-RevId: a6ea8d171809625edeedc3a8ac3ee2e1bbf1682a
2026-10-21 19:36:20 +00:00
felixxia-oai a47d1338c1 Extract shared message-board code into codex-message-board (#55970)
## What changed

Move the message-board API, types, permissions, storage backends, and tool implementations into the new `codex-message-board` crate. Keep extension registration in `codex-agent-message-board-extension`, and update core and the remote client to use the shared crate directly.

Move the existing board tests with the implementation and add the crate to the Cargo workspace and Bazel build.

GitOrigin-RevId: 33ce527c2bef7f862eba55cb9b32222902ccf4ad
2026-10-21 19:34:51 +00:00
jif 02c6a2d3f1 Drain WebSocket responses on mailbox preemption (#55969)
## Why

Mailbox preemption can discard completed response items and lose the response ID needed for incremental continuation. Buffered tool calls must also wait for queued agent messages to be read.

## What changed

- Gracefully interrupt and drain Responses Lite streams, retaining completed items and the response ID for the next request.
- Cancel buffered tool calls before dispatch and suppress partial items that may be discarded during the drain.
- Keep user steering queued until draining finishes. Include pending mail in follow-up requests after disconnects and preserve content-filter recovery guidance.

## Testing

Add WebSocket regression coverage for buffered completion, interrupts without acknowledgement, buffered tools and partial items, user steering during draining, disconnects, and content-filter recovery.

GitOrigin-RevId: c9d3fb87a81850e5686e07f28103e2ff4378ddec
2026-10-21 19:29:08 +00:00
Anthony Tafoya 3fd08b5405 Back off failed cloud skill and plugin catalog refreshes (#55968)
## Why

Failed cloud discovery previously retried before each model step. Apply a cooldown across steps and turns to avoid repeated discovery requests while a provider remains unavailable.

## What changed

- Share per-thread retry backoff logic between cloud skill and plugin catalogs, starting at 30 seconds and doubling to a maximum of 5 minutes.
- Scope cooldowns to authentication and MCP resource generations so account changes and reconnects permit immediate recovery.
- Clear backoff after successful discovery or configuration resets, while allowing cancelled refreshes to retry immediately.

## Testing

Update lifecycle and concurrency tests to cover shared cooldowns, reconnect recovery, and cancellation. Use paused time to verify exponential delays, the 5-minute cap, and backoff across turns.

GitOrigin-RevId: 30dab5ceba51e8ad64c0794c1729719e99f577ce
2026-10-21 19:22:57 +00:00
acrognale-oai 57232f111c Add managed Desktop workspace storage requirements (#55965)
## What changed

- Add `application.storage.default_project_parent` and `application.storage.projectless_workspace_root` requirements for new Desktop workspaces. Require absolute paths and reject unknown storage keys.
- Apply managed paths to `desktop.defaultProjectParent` and `desktop.projectlessWorkspaceRoot`, overriding local preferences and rejecting writes to managed settings or their containing table while preserving unrelated Desktop settings.
- Expose storage requirements through `config/requirements/read` and update generated JSON schemas, TypeScript types, and Python models.

## Testing

Add coverage for storage validation, per-setting layer precedence, config overrides, write protection, and requirements API responses. Adjust daemon shutdown test deadlines and TUI test synchronization, paste handling, and future allocation.

GitOrigin-RevId: 44b93fe69e6a471c3f485cbf5f9c9ebd34ac3234
2026-10-21 19:06:57 +00:00
Abhinav 067249a283 Preserve provider model catalogs when refreshes fail (#55958)
## Why

A failed provider catalog refresh could discard model metadata and disable tool search on subsequent turns, even after a successful discovery.

## What changed

Keep the last successful catalog, ETag, and original freshness when refreshes fail without an access rejection. Continue invalidating cached catalogs for HTTP `401`/`403`, rejected refresh tokens, and gateway credentials that require login. Distinguish `GatewayLoginRequired` from login in progress so only the former invalidates the catalog.

Successful empty responses remain authoritative, and cached catalogs remain scoped to the provider and authentication identity.

## Testing

Add regression coverage for catalog preservation across refresh errors and restarts, access rejection invalidation, identity isolation, and tool search and instruction stability on the next turn after a failed refresh.

GitOrigin-RevId: 9dd7c73ac2cc1fd49664efd93b839baa94e05c49
2026-10-21 18:43:15 +00:00
Anthony Tafoya 9e12b14891 Refresh cloud plugin and skill catalogs after mid-turn auth changes (#55957)
## Why

Authentication can change between model steps. Refresh cloud catalogs before the next step so plugin acceptance and skill instructions reflect the current auth scope, including plugins that are no longer available.

## What changed

- Add a `refresh_catalog_for_step` lifecycle hook and rebuild MCP when plugin catalogs change.
- Reuse successful discovery within a turn and auth scope, serialize concurrent refreshes, and allow retries after failures or cancellation. Limit cloud skill discovery warnings to once per turn.
- Skip cloud discovery during prewarm and other context-only captures, and check hosted plugins even when no executor roots are selected.

## Testing

Add regression coverage for mid-turn auth rotation and plugin removal, serialized refreshes and retries, stale discovery results, and prewarm boundaries.

GitOrigin-RevId: 355681e84dc765e8dc1a04608779d95c706c2188
2026-10-21 18:37:30 +00:00
ioanbudea-OAI d685e61e1f Separate retained instruction collection from budget policy (#55954)
## What changed

Represent collected fragments with `RetainedInstructionItem`, preserving their content, semantic kind, and source. Assign retention policy when composing context: user instructions, host notices, and framing remain required, while assistant context remains optional at commentary priority.

GitOrigin-RevId: 0080f3abd0d763bd402e78da0ac1b0fa0cd7678d
2026-10-21 18:14:58 +00:00
Matthew Zeng 9b39316997 Bound remote installed-plugin inventory pagination (#55946)
## Why

Installed-plugin inventory fetches could keep following pagination cursors
without an overall bound, delaying release of the plugin mutation gate.

## What changed

- Limit each inventory fetch to 60 seconds and 100 pages, and reject repeated
  pagination cursors.
- Request 200 items per page for scoped inventory fetches as well as all-scope
  fetches.
- Report overall fetch timeouts as `remote_catalog_timeout`.

## Testing

Add coverage for cursor cycles, completion at the page limit, and overall
timeout cancellation after successful pages. Verify that failed pagination
preserves the cached inventory and plugin files and releases the mutation gate.

GitOrigin-RevId: e8429dd804581041d102defa9d19db02bcb1739b
2026-10-21 17:28:24 +00:00
viktor-oai a3b685331f Add local diagnostic ZIP exports to the app server (#55940)
## What changed

Add a save RPC that accepts the existing report options and an absolute `savePath` on the server host. Save the report, selected attachments, and a manifest without uploading, and return `savedPath`, `threadId`, and `promptHash`. Local exports remain available when uploads are disabled by configuration.

Publish archives atomically without replacing existing files. Bound uncompressed contents to 200 MiB and attachments to 128, preserve duplicate attachment names safely, and fail without publishing a partial ZIP when a selected file cannot be read. Honor `includeLogs` and omit automatic rollouts for untouched threads without materializing them.

Update protocol schemas and generated TypeScript and Python types.

## Testing

Add coverage for local-only saves, disabled uploads, path validation, overwrite protection, log consent, archive budgets, duplicate names, missing files, and rollout selection before materialization and after writer shutdown.

GitOrigin-RevId: 222c0fe7ab923904de9c8a9f12ad27f7a0104875
2026-10-21 16:43:30 +00:00
Eric Traut 430a16799d Preserve thread model settings across resume and revert (#55923)
## Why

Resuming a thread can replace saved model settings with global defaults. A selected service tier can also be lost when the current model does not support it.

## What changed

- Restore saved service tier, reasoning summary, and personality on resume unless the caller explicitly overrides them, respecting thread ownership of settings snapshots.
- Retain the selected service tier for persistence, settings notifications, and resume comparisons while filtering the effective tier against the current model's capabilities.
- Carry the runtime model, service tier, and personality into thread revert reconstruction.
- Persist initial thread settings before user input during MCP startup so an interrupted first turn retains its settings checkpoint.

## Testing

Extend regression coverage for cold resume and explicit overrides, unsupported service tiers, settings preservation during revert, and settings checkpoints before user input when MCP startup is interrupted.

GitOrigin-RevId: e5ec012a5678048c5eedd443e524f38c142bf9fd
2026-10-21 15:34:43 +00:00
jif a6839a4812 Skip conversation scoring superseded by newer scores and history (#55913)
## Why

A delayed conversation classification can reach execution after a newer request has already published a score and committed history, leaving it with no useful work to contribute.

## What changed

Pass the classification's sampling timestamp into conversation requests and check for newer scores and retained history before starting inference. Return `Superseded` only when both have advanced; keep requests that can still contribute either a score or history.

## Testing

Add regression tests covering supersession of scores and history separately and together, including a classification delayed by permissions. Verify skipped requests send no inference request and preserve cached scores, approvals, and score progress.

GitOrigin-RevId: ef78a59e2010a82ac4f1fb93568a562447187099
2026-10-21 14:43:51 +00:00
jif d138398cef Expand enterprise MCP authorization lifecycle test coverage (#55883)
## What changed

- Extend app-server tests for account credential reuse, refresh races, stale bearer rejection, retry exhaustion, and step-up failures at the identity provider and resource authorization server.
- Assert token-exchange request fields and enterprise protocol negotiation while preserving the ordinary MCP handshake.
- Add core scenarios for permission and tool-policy refreshes, policy revocation, and thread removal, including cancellation of in-flight enterprise calls.
- Snapshot conversation history after revocation to verify that prior calls remain visible and ordinary tools continue working.
- Allow the existing startup-failure test to wait through the MCP startup deadline.

GitOrigin-RevId: 31cf71a28f91bd30746b74df8fa669edb6bc23a1
2026-10-21 12:39:12 +00:00
jif c419fd01a7 Fix enterprise MCP credential selection and reauthentication (#55859)
## What changed

- Prefer an eligible account grant over saved enterprise credentials, with a fallback to saved enterprise sign-in during initial connection if the account grant is rejected.
- Remember rejected account grants per enterprise MCP registration across threads and report authentication failures as requiring reauthentication. Keep administrator configuration errors distinct from sign-in failures.
- Compare account grants independently of access and ID token rotation, recheck the latest identity eligibility after exchange, and retry once when the refresh grant changes.
- Make MCP authentication status reflect usable account grants, saved enterprise credentials, and completed connection failures.

## Testing

Extend regression coverage for enterprise sign-in failures and recovery, MCP authentication status, account grant identity across token refreshes, and retries after transient credential failures.

GitOrigin-RevId: eeac65f668d5d2d55e9d8bf4547fbcbdd6a6c42d
2026-10-21 10:40:59 +00:00
jif 6bae551093 Bound managed app-server and updater stderr logging (#55856)
## Why

Managed stderr logs previously retained a tail only before a new launch, allowing logs to grow during a long-running process. Direct stderr writes could also block lifecycle operations on disk I/O.

## What changed

- Route managed app-server and updater logs through a shared nonblocking worker with a bounded queue. Drop records when the queue is full or a record exceeds 16 KiB, and avoid waiting for the worker at shutdown.
- Prune live logs when they exceed 1 MiB, preserving the latest 256 KiB in `.log.previous` before truncating the current file. Keep inherited stderr handles usable after truncation.
- Pause predecessor pruning during Windows updater handoff and resume it after a failed handoff only when ownership has been restored.
- Keep ordinary stderr output when managed logging has not been initialized.

## Testing

Add regression tests for stalled workers and queue overflow, tail retention, inherited append and nonappend handles, and pruning exclusion during updater handoff.

GitOrigin-RevId: b6301962b1180fa6cdb231a56edce2429dc20b54
2026-10-21 10:31:12 +00:00
jif 4faf60f126 Pause relay test time while inspecting handshake diagnostics (#55848)
Pause Tokio time after the validation timeout in
`malformed_handshakes_preserve_active_streams_and_admission_recovers`
while inspecting diagnostics, since that inspection does not poll the
harness WebSocket for pings. Resume time before closing the WebSocket so
the close handshake and its timeout run with an active clock.

GitOrigin-RevId: 733a1fa35f80561424be97c4beb233780a7796cb
2026-10-21 09:57:27 +00:00
jif 21b1f5f534 Bound retained turn analytics and clean up closed threads (#55847)
## Why

Dropped lifecycle facts can leave incomplete turns retaining analytics metadata indefinitely.

## What changed

- Limit retained turns to 256, evicting the oldest turn and its associated tool and review state when capacity is reached.
- Forward `ThreadClosed` notifications to analytics and discard the closed thread's turn and review state, including reviews received without turn lifecycle facts.

## Testing

Add regression tests covering metadata release after capacity eviction, continued reporting of new complete turns, cleanup isolated to the closed thread, and ignored approval responses after thread closure.

GitOrigin-RevId: eed0a1fef013381654345d535f03de42b99e8607
2026-10-21 09:54:36 +00:00
ioanbudea-OAI 2213359bd3 Measure Guardian review latency once with a monotonic clock (#55846)
## Why

Guardian review metrics derived duration from wall-clock timestamps, while analytics measured elapsed time when tracking the result. Clock changes and delayed tracking could produce inconsistent latencies.

## What changed

Capture one monotonic duration at review completion and pass it to both metrics and analytics. Preserve wall-clock timestamps for event ordering, and saturate analytics latency conversion at `u64::MAX`.

## Testing

Add a regression test covering skewed wall-clock timestamps and delayed tracking, verifying that the duration metric uses the captured interval and completion timestamps are preserved.

GitOrigin-RevId: 19eafb8e1f1a3d13a751bdc72c218e4cafeae410
2026-10-21 09:52:45 +00:00
taohong-oai af91f6ef2c Add a critical-path utility for exclusive duration attribution (#55804)
## What changed

Add `codex-utils-critical-path` to track shared dependency paths and attribute time to inference, automatic review, user waits, tools, overhead, and unknown work. Parallel joins retain the later-finishing branch, preserving its full history without double-counting overlapping work.

Clip attribution to the requested interval and count unrecorded gaps as overhead. Bound retained history by collapsing it into unknown work at the depth limit, with nonrecursive destruction and bounded debug output.

## Testing

Add unit tests for parallel joins, nested dependencies, ties, user waits, interval clipping, overlapping segments, history exhaustion, and safe formatting and concurrent release on small stacks.

GitOrigin-RevId: 2df7453162491d3ae97bf4bee942730c8a4d5e5c
2026-10-21 07:33:13 +00:00
Charlie Marsh c7234c1174 Box session metadata and compaction payloads in RolloutItem (#55733)
## What changed

Store `RolloutItem::SessionMeta` and `RolloutItem::Compacted` payloads in `Box` values and update their producers, consumers, and test fixtures. Preserve the existing serialized rollout format.

GitOrigin-RevId: 59fcc4beb47d23160872dcb6e95ace9b142d3d11
2026-10-21 02:41:05 +00:00
cassirer-openai d571eaf1f6 Preserve code cell response metadata in rollout traces (#55725)
## Why

Reducing code cell lifecycle events discarded their response payload references and lost the initial response status when the runtime status changed.

## What changed

Store the initial response status and separate raw payload IDs for the initial response and final result on `CodeCell`. Carry payload references through queued lifecycle events so they survive replay when the source item arrives later.

## Testing

Extend lifecycle tests to verify distinct initial and final payload IDs and the preserved initial status for yielded cells that complete and failed cells whose lifecycle events precede their source item.

GitOrigin-RevId: 8f49a3174ea487a5d91ebc2a6c97133aacaabfd2
2026-10-21 02:02:49 +00:00
Charlie Marsh 2744e8686c Share prepared MCP tool definitions across sessions (#55724)
## Why

Sessions using the same MCP catalog can repeat schema normalization and retain duplicate tool specifications.

## What changed

Split immutable MCP tool metadata and normalized specifications from per-handler caches, and reuse matching definitions within each `McpManager`. Require matching tool metadata, agent-plugin mode, and schema budget before reuse.

Keep shared definitions behind weak references and prune expired entries on cache misses so completed sessions do not keep their schemas alive. Build definitions outside the shared index lock.

GitOrigin-RevId: 02345359a1b0d297ca56f2f469de88aba89106f1
2026-10-21 01:55:56 +00:00