Commit Graph
12423 Commits
Author SHA1 Message Date
Francis Chalissery e776b27eb0 Add frozen cloud skill snapshots to the app server (#55631)
## What changed

- Add `--cloud-skills-snapshot PATH` to load a cloud skill catalog and resource contents from JSON once at app-server startup, without contacting a live skill service.
- Expose snapshot skills through the native `skills.list` and `skills.read` interface, preserving aliases and prompt visibility. Reads remain available after the snapshot file is removed.
- Validate package boundaries, required resources, duplicate packages, and size limits; fail startup for missing or invalid snapshots.
- Keep frozen cloud catalog and read caches independent of live MCP resource changes.

## Testing

Add provider, cache, app-server, and core scenario tests covering validation, exact resource contents, authority boundaries, startup failures, and listing and reading frozen skills alongside a named executor.

GitOrigin-RevId: d438a5d678121db3e17515fc5edcd00d4e20b900
2026-10-20 17:01:52 +00:00
ben zhang 48b6a9d8e0 Reserve a sibling rollout candidate slot for the first ancestor (#55627)
## Why

Sibling rollout prefetching returns no paths when its candidate set omits the first ancestor. With more than 64 sibling rollouts, the candidate limit could exclude that ancestor and prevent prefetching.

## What changed

Pass the first ancestor ID into candidate collection and reserve the final slot for it until it is found, preserving the 64-candidate limit.

## Testing

Add a regression test that creates more siblings than the candidate limit and verifies that an otherwise omitted ancestor is included when prioritized.

GitOrigin-RevId: 130508dfb1a190af68ccf1911c7501617be79a00
2026-10-20 16:40:36 +00:00
swastik-oai aa081afb1b Refactor Guardian v2 Decisions snapshot comparison (#55623)
## What changed

- Rename the snapshot comparison entry point to `start_snapshot_comparison` and extract request spawning into `spawn_request`.
- Accept a `ContentItem` rubric and an iterator of evidence in the request adapter.
- Read the Decisions comparison feature flag once per classification and simplify the budget rejection test setup.

GitOrigin-RevId: b4a294eeecb6069db0f80ff6e4f13f558cbd7815
2026-10-20 16:31:41 +00:00
Michael Bolin 5ac9888436 Move Linux sandbox unit tests into separate files (#55620)
## What changed

Extract the inline test modules for `bundled_bwrap`, `bwrap`, `exec_util`,
`launcher`, `proxy_routing`, and `seccomp` into sibling `*_tests.rs` files.
Keep them wired through `#[cfg(test)]` and explicit `#[path]` attributes,
with existing test coverage and runtime behavior unchanged.

GitOrigin-RevId: 79b70a092a19b10716939744542415bc1dcaf0b2
2026-10-20 16:25:02 +00:00
jif 61469096fe Update rustls-webpki and webpki-roots lockfile versions (#55616)
## What changed

- Update `rustls-webpki` from `0.103.15` to `0.103.16`.
- Update `webpki-roots` from `1.0.5` to `1.0.10`.
- Refresh the corresponding entries in `codex-rs/Cargo.lock` and `MODULE.bazel.lock`.

GitOrigin-RevId: c73d2afb6ce9f8bd8756d3cbe6f8114edc461262
2026-10-20 16:12:45 +00:00
cooper-oai f29d55ff06 Propagate authentication header failures before sending requests (#55607)
## Why

Synchronous auth header construction could silently return no credentials when managed authentication became unavailable. Callers need an error to avoid sending requests with missing or partial authentication.

## What changed

- Make `AuthProvider::add_auth_headers`, `to_auth_headers`, and auth header telemetry fallible, and propagate failures through request and WebSocket setup.
- Return a transient error when managed authentication is unavailable, and preserve network policy denials through auth error conversion.
- Retry transient MCP authentication errors while treating build errors and policy denials as terminal.
- Cancel local MCP event streams before resolving authentication so cleanup still works when credentials become unavailable.

## Testing

Add regression coverage for rejected partial authentication, async header resolution, terminal auth errors without sending requests, managed account changes, MCP retry classification, and local stream cancellation after authentication becomes unavailable.

GitOrigin-RevId: 39d981e232cba1e302de502a2fa6239101114ed1
2026-10-20 15:43:19 +00:00
Benjamin Carlsson 78d4c7c7fa Extract shared TUI user prompt helpers from IDE context (#55597)
Move context prefixing and request extraction into `user_prompt`, and update
IDE context injection, thread routing, thread titles, transcript export, and
user message rendering to use the shared helpers. Preserve the request
delimiter, text element byte offsets, and input ordering.

Move the existing last-delimiter extraction test alongside the shared helpers.

GitOrigin-RevId: 3ee350506a536a6dba9575e8311188bc92fed584
2026-10-20 15:15:24 +00:00
Benjamin Carlsson fa71afc8a7 Rank $ mentions by recent selection frequency (#55596)
## What changed

Prefer frequently selected entries in the TUI's `$` picker within exact, prefix, and fuzzy match tiers, keeping stronger match tiers ahead of usage preferences.

Track the last 50 confirmed selections and persist them in `mention_usage.json` under `CODEX_HOME` when history persistence is enabled. Preserve in-memory preferences across compatible chat widget replacements, including when history persistence is disabled. Serialize background writes, merge updates under a bounded file lock, and flush pending writes on shutdown.

## Testing

Add coverage for picker ordering, preference handoff and persistence, history-disabled widget replacement, selection expiry, malformed history, and lock contention.

GitOrigin-RevId: 7efa8c1c365e23000fcda10dbbc2a7e90f4e777c
2026-10-20 15:10:26 +00:00
chess d34f104c22 Reject unpackaged Windows sandbox provisioning clients (#55593)
Remove the exception that allowed clients without a package identity to connect
when the provisioning service had one. Keep the debug foreground-mode exception.

GitOrigin-RevId: def2d22a91575477d73e3d8c6ac14808a2ff3b2b
2026-10-20 14:48:59 +00:00
ioanbudea-OAI 60d78332fc Measure Guardian approval blocking time per turn (#55591)
## What changed

Record `codex.guardian.turn.blocking_ms` when a turn completes or aborts, with an `outcome` label. Count overlapping approval waits once, exclude idle gaps, and split pending reviews across the active turns they span. Use each turn's telemetry so samples retain the servicing turn's model attribution.

## Testing

Add unit coverage for overlapping waits, idle gaps, late turn completion, and duplicate stops. Extend integration coverage to verify attribution across turns and model changes for yielded command reviews and MCP elicitation, including aborted turns.

GitOrigin-RevId: a3e6a0c32a06fe58ea93119ecd941076100fb82c
2026-10-20 14:43:08 +00:00
Rohan Mehta ab6095dde0 Allow callers to control prompt cache keys independently of session IDs (#55587)
## What changed

Expose `PromptCacheKey` through `StartThreadOptions` with three policies: retain the default session-derived key, send a custom key, or omit `prompt_cache_key` from model requests. Keep session identity headers independent of this policy.

Propagate the policy to child agents, delegated sessions, and guardian review sessions. Hosts must reapply the policy when resuming a thread from storage.

## Testing

Add coverage for all three policies across turns, including unchanged session and thread headers. Extend subagent coverage to verify inheritance of the default and omitted-key policies.

GitOrigin-RevId: f9e8ab31fcf568636f9712726760e4e9a4672428
2026-10-20 14:14:59 +00:00
jif e8aa7c1678 Avoid panics after background compaction fails before a checkpoint (#55581)
## Why

Polling a failed background compaction consumes the closed oneshot receiver.
Keeping that receiver in session state can cause a later await to panic instead
of falling back to foreground compaction.

## What changed

Remove the receiver from session state before polling it, restoring it only when
its result is still pending. Discard closed receivers so compaction can fall back
normally.

## Testing

Add a regression scenario where background compaction fails before the next
checkpoint and automatic compaction falls back successfully.

GitOrigin-RevId: 1461bb403f4b0b8b7e171d1b3cba41411f2014b4
2026-10-20 13:50:13 +00:00
jif e1b9c9457c Preserve parent history by default in full agent forks (#55548)
## What changed

Default `features.multi_agent_v2.preserve_fork_prefix` to `true`, so full-history forks retain the parent's model-visible history and append child instructions. Keep `preserve_fork_prefix = false` as an explicit opt-out for instruction filtering, and update the configuration schema documentation.

## Testing

Update coverage to verify inherited prefixes across child and grandchild forks, child instruction ordering after compaction, and explicit filtering opt-outs.

GitOrigin-RevId: f14eae5b924cdeac555d112d0aba3fbbb063b0ea
2026-10-20 11:56:17 +00:00
jif 4dbd9d30ea Ignore the basic-toml advisory in dependency audits (#55547)
`codex-secrets` pulls in unmaintained `basic-toml` 0.1.10 through the localization dependencies of `age` 0.12.1, and no patched release is available.

Add `RUSTSEC-2026-0374` to the `cargo audit` and `cargo deny` ignore lists. Document that the exception should be removed when the localization dependencies of `age` migrate off `basic-toml`.

GitOrigin-RevId: 92f31b687e91a73620e6f7f9a1b7c94790d9149d
2026-10-20 11:55:08 +00:00
jif b2aa07db8a Add scoped leases for persisted account OAuth grants (#55546)
## What changed

- Expose `AccountOAuthGrantLease` to prevent this auth manager's token refreshes from rotating account credentials during an identity-provider exchange. Releasing the lease returns an `AccountOAuthGrant` that callers can recheck before accepting asynchronous results.
- Validate grants against cached login ownership and persisted credentials, requiring OAuth provenance and complete account identity. Reject stale grants and propagate storage failures, including unavailable keyrings in `Auto` mode.
- Track `login_generation` separately from account ownership and use it to invalidate enterprise MCP authentication. Losing login metadata invalidates the login while preserving same-account network policy; a new login to the same account advances both generations.

## Testing

Extend auth refresh coverage to verify refresh blocking and wakeup on lease release, invalidation after token rotation or persisted login replacement, metadata loss and restoration, and logout while a lease is held.

GitOrigin-RevId: f51b3cd526d7ee94d5dffa16681f8ca332245ce3
2026-10-20 11:48:54 +00:00
jif 4be9cfdf30 Improve diagnostics for compressed rollout read failures (#55545)
## Why

Undecodable compressed rollouts need diagnostic details and their original bytes preserved for investigation.

## What changed

- Log compressed file size, first-frame content size, decoded byte count, and whether the open file changed when a compressed rollout read fails. Limit warnings to once per process per minute and exclude paths and contents.
- Allow diagnostic reports to attach the raw `.jsonl.zst` archive after a decoding failure when no preferred plain rollout exists. Retain attachment size limits and append `.zst` to filename overrides when needed.

## Testing

Add coverage for truncated streams, incomplete trailing frame headers, files truncated after opening, and diagnostic uploads that preserve undecodable archives with size limits and filename overrides.

GitOrigin-RevId: 76f7ee466f9bebdab5a91ce1894f4361749edc5b
2026-10-20 11:42:48 +00:00
swastik-oai 464add4958 Separate Guardian conversation preparation from execution (#55533)
## What changed

Split retained conversation scoring into `Reservation::prepare` and `PreparedConversation::run`, exposing the complete admitted input before model execution. Keep the history fork and capacity permit owned by the prepared conversation, and recheck authorization, score expiry, and backend generation before execution.

## Testing

Extend conversation tests to verify that preparation sends no model request, execution uses the prepared input, dropping a prepared conversation releases capacity, and stale prepared reviews cannot start model execution.

GitOrigin-RevId: c96cc6fac69179a78ecd7bcdb8e5a4b3087aa6e6
2026-10-20 10:52:46 +00:00
jif 46d252f8bf Make the startup migration contention test deterministic (#55524)
## Why

The maintenance-lock test relied on a 50 ms timeout to assume startup migration had encountered contention, and its completion timeout included the production retry delay.

## What changed

Add a per-store, test-only retry gate to observe lock contention and explicitly resume migration after releasing the maintenance lock. Verify that rollout metadata stays in `Legacy` mode while the lock is held and becomes `Paginated` after migration completes.

GitOrigin-RevId: 657fa6ec6f9494d9e66976560c8158fde8ffb495
2026-10-20 09:53:33 +00:00
virajrai-oai e18a20d6eb Add correlated diagnostics for Noise relay handshakes (#55498)
## What changed

- Record executor handshake rejections and pending-validation resets in promptly completed diagnostic spans, with classified reasons and registry HTTP status when available. Normalize stream IDs as UUIDs and cap diagnostics at 100 per minute per relay connection, followed by a suppression marker.
- Add elapsed time and connection identifiers to harness handshake diagnostics, including initialization timeouts, and classify WebSocket read failures from typed errors.
- Forward valid stream UUIDs to harness key validation requests through the `x-codex-noise-stream-id` header.

## Testing

Extend tests to cover diagnostic rate limits, timeout correlation, prompt span export, typed WebSocket error classification, and optional stream ID headers. Verify that diagnostic output excludes authorization secrets, registry response text, reset reasons, and invalid stream IDs.

GitOrigin-RevId: 2c224e2d2828b300164868b10806add410e148b2
2026-10-20 07:56:07 +00:00
liame-oai 014489466a Add optional MCP disablement for prediction forks and samples (#55463)
## What changed

Add `experimentalDisablePredictionMcp` to `thread/fork` and `disableMcp` to `thread/sample`. Disable MCP servers when requested and the inherited history contains incremental tools on Responses Lite. The fork option requires `experimentalPredictionMode: true`.

Apply disablement through a thread-local policy that excludes configured MCP servers and runtime contributions, including after MCP refresh. Preserve the inherited history prefix and append tool-removal instructions without changing the parent's tools.

## Testing

Add coverage for prediction forks with legacy and paginated history, flag validation, conditional disablement, MCP refresh, and sample/fork request parity. Add a request-history snapshot covering preserved history, tool removal across child turns, and unchanged parent tools.

GitOrigin-RevId: e31d602480e6550ed130d8152f538b8668280fa0
2026-10-20 05:25:43 +00:00
johnl-oai 18795fc125 Support Windows registry overrides for requirements.toml (#55456)
## What changed

Read `RequirementsPath` from the 64-bit registry view of `HKLM\SOFTWARE\Policies\OpenAI\Codex` to select the system requirements file on Windows. Require an absolute path and return an error for relative values. If the registry key or value cannot be read, retain the default `OpenAI\Codex\requirements.toml` location under ProgramData.

## Testing

Expand absolute-path validation tests to cover empty, drive-relative, and root-relative paths. Update the Windows default-directory test to remain independent of registry overrides.

GitOrigin-RevId: c31045d749e32cf266b389245ae4db2440156e8e
2026-10-20 04:49:25 +00:00
Eric Traut 8196bcdc18 Check daemon feature overrides and prompt for mismatch recovery (#55442)
## Why

A fixed feature allowlist excluded other boolean feature overrides from daemon use. Feature mismatches could also silently fall back to embedded mode, while automatic startup could persist enabled overrides without confirmation.

## What changed

- Allow boolean feature overrides without a fixed allowlist and compare explicit overrides with the daemon's reported settings. Ignore removed features, treat unreported features as disabled, and include only mismatches in restart settings.
- Preserve saved daemon settings during automatic startup. Prompt on feature mismatches even when embedded fallback is allowed, letting users run without the daemon, confirm a managed-daemon restart, or cancel.
- Detect managed daemons during recovery, mark available restarts as recommended, and limit the displayed feature list to three entries plus a remaining count.

## Testing

Update compatibility tests for mixed overrides, removed and unreported features, unreachable daemons, and required versus optional attachment. Update recovery snapshots and the TUI integration test to exercise explicit embedded-mode selection.

GitOrigin-RevId: 9204620f168ff80aaef312c88e681b754908a431
2026-10-20 03:11:07 +00:00
liame-oai a4c9194247 Add cancellation for experimental thread samples (#55441)
## What changed

Add the experimental `thread/sample/cancel` request with a `requestId` identifying a `thread/sample` request on the same connection. Cancellation returns an empty response, stops the matching sample with `sample canceled`, and cleans up its ephemeral fork. Repeated cancellation and unknown request IDs are harmless no-ops; other request types are unaffected.

## Testing

Add coverage for connection and request ID isolation, request type filtering, and repeated cancellation. Extend the sample integration test to verify cancellation keeps the parent responsive and reclaims the child thread.

GitOrigin-RevId: 92d12e5c0190e1d3b06cb482543615a3ec77bdc8
2026-10-20 03:09:44 +00:00
cooper-oai 091008729d Share runtime authentication across requests and credential refreshes (#55413)
## What changed

Add `RuntimeAuthManager` to share one registered runtime per credential source and return request-scoped `RuntimeAuth` values that pair the runtime with its credentials and HTTP client factory.

- Preserve registration keys and idempotency IDs across retryable failures and refreshes that retain the credential source.
- Replace the runtime when the credential source changes, preserve existing request snapshots, and reject late registration responses for a previous source.
- Use bounded credential recovery for registration `401` responses and cache `403` denials until the credential source changes.
- Expose authenticated actor and agent host information on `RuntimeAgentInstance`.

## Testing

Add tests for concurrent registration sharing, retry identity preservation, network policy recovery, credential refresh and replacement, bounded recovery, cached denials, and credential changes during registration.

GitOrigin-RevId: ea1e6e10a5939e8c3f7c0c317ccf8a83522c635f
2026-10-20 00:48:09 +00:00
Benjamin Carlsson 1a35bc4ccb Render async question prompts as Markdown in the TUI (#55411)
## What changed

Render async question titles with the Markdown renderer so emphasis, fenced code blocks, and labeled links display with their intended formatting. Remove blanket bold styling and wrap overwide tokens while preserving hyperlink destinations and accurate row counts.

## Testing

Update rendering snapshots and extend the question rendering test to cover Markdown formatting, link destinations, selective bold styling, and equivalent LF and CRLF rendering at narrow and wide widths.

GitOrigin-RevId: b3e8a94a04433c2d9e5d11e66f83cbd16959d8ed
2026-10-20 00:17:51 +00:00
cooper-oai 7827cd886d Track credential sources separately from auth owners (#55410)
## Why

A new OAuth login can belong to the same account as an earlier session, while token refreshes can change credentials within one session. Auth consumers need to distinguish these cases when deciding whether a runtime can be reused.

## What changed

- Add `source_generation` to `AuthChangeState` and expose `AuthManager::auth_change_state_for` to check whether selected credentials still match the manager's current source.
- Preserve source continuity across OAuth refreshes only when session, issuer, and identity claims match. Advance the source revision for new sessions, credential replacements, and logout.
- Keep agent identity persistence from replacing cached credentials with credentials read from disk; credential publication remains managed by `AuthManager`.

## Testing

Add tests for refresh continuity, new logins, identity and workspace changes, sessionless tokens, API key replacement, logout, and identity persistence followed by an explicit credential reload.

GitOrigin-RevId: 56eddb7edb9c5f8854b18fd50ce917c0b27e75d6
2026-10-20 00:13:01 +00:00
Felipe Coury a3c643bf8d Retry TUI startup after a server shutdown refusal (#55409)
## Why

A remote server can refuse the initial `thread/start` while shutting down. An explicit refusal establishes that no thread was created, allowing the TUI to retry without risking duplicate startup submissions.

## What changed

- Wait for the draining connection to close, reconnect within a shared two-minute deadline, and retry startup once.
- Preserve the initial prompt, confirmed draft, model, and reasoning effort across recovery. Keep drafts editable and allow cancellation of a pending submission.
- Restore input without submitting if recovery fails or startup is refused again. Continue treating a lost startup reply as uncertain and avoid automatic resubmission.

## Testing

Add regression coverage for successful reconnection with exactly one prompt submission, repeated refusal, disconnect event ordering, and draft cancellation, editing, and paste provenance during recovery.

GitOrigin-RevId: 85b756e14f29c239c4774af2b32215fe251530ac
2026-10-20 00:02:07 +00:00
Felipe Coury 1ccc0d64e8 Clarify API key login and status messages (#55407)
## Why

Saving an API key does not validate it. Login and status messages should make clear that authentication is checked when a request is sent.

## What changed

Report `API key saved` after API key login and `API key configured` in `login status`. Both messages now explain when authentication is checked.

## Testing

Update the API key login integration test with snapshots for login and status output, while retaining assertions that the key is saved to `auth.json`.

GitOrigin-RevId: 2f36ebb270a48771be25060a596cf9731e8d0325
2026-10-19 23:56:57 +00:00
alishobeiri-oai c937a6eb7e Trace harness-side Noise handshake failures (#55406)
## Why

The handshake readiness channel only signals success, so a dropped sender does not explain why the handshake failed.

## What changed

Emit structured `codex.exec_server.noise_handshake_failed` warnings before harness handshake failures drop the readiness sender, including a failure reason and environment, executor registration, and stream identifiers. Emit the same event on handshake timeout with `timeout_ms`.

Preserve the current tracing span when the `noise_relay.stream` debug span is disabled so the relay task retains its trace context.

GitOrigin-RevId: 0b1314d5237b7c77a854c2c0a966391bf856e75d
2026-10-19 23:56:17 +00:00
cooper-oai 79a19cbb30 Add ephemeral runtime registration and signed assertions (#55402)
## What changed

Extend `codex-runtime-agent-instance` with a registration client and an in-memory assertion signer. Pending registrations retain their signing key and idempotency key across caller-driven retries; registered runtimes generate fresh versioned assertions with a timestamp and unique ID.

Bound registration requests and responses, reject unsafe endpoints, disable redirects and request logging, and preserve network policy errors. Report server rejections using only the status and recognized error codes.

## Testing

Add HTTP-backed tests for retry stability, assertion signatures and freshness, policy revocation, endpoint and response validation, redirect refusal, and error redaction.

GitOrigin-RevId: a6dab0900459dfb75f72652a0a2ee1e4b65ca322
2026-10-19 23:01:54 +00:00
richardopenai 431185b78b Defer environment disconnect notifications until recovery fails (#55401)
## Why

A temporary exec-server transport loss could emit a thread environment disconnect notification while the session was still recovering.

## What changed

- Add `EnvironmentConnectionState::Recovering` for interrupted transports and pending session recovery.
- Suppress thread lifecycle notifications during recovery, emit a connected notification after successful recovery, and report disconnection when recovery fails.
- Ignore recovery callbacks from retired clients so they cannot overwrite the connection state during refresh.

## Testing

Add coverage for fast and near-deadline recovery, recovery timeout, rejected session resume, and retired-client callbacks. Extend app-server coverage to verify one lifecycle notification per selected thread and usable `environment/info` after recovery.

GitOrigin-RevId: d6dce5cc5264af29b6f993daa209b93102122e40
2026-10-19 22:55:42 +00:00
cooper-oai c3bb20602d Add wire types for runtime agent registration (#55398)
## What changed

Add `codex-runtime-agent-instance` with serializable registration requests and deserializable responses. Requests support OAuth, personal access tokens, and platform API keys, along with an installation ID, public key, harness metadata, and runtime role. Responses include runtime and host IDs plus ChatGPT or platform actor context.

Use `RedactedString` for credentials to keep secrets out of debug output.

## Testing

Add tests covering request serialization for all three credential types, debug redaction, response decoding for both actor types, and rejection of responses missing required fields.

GitOrigin-RevId: f33bae734fdd1402144dee407e5b868f5eef1d37
2026-10-19 22:21:46 +00:00
jif 896604a12d Record OAuth provenance and login identity for account tokens (#55397)
## Why

Token refresh needs the issuer and client ID used at login. Unverified token claims cannot establish that authority, and OAuth error bodies may echo credentials.

## What changed

- Save `oauth_provenance` and a new `login_owner_id` on browser and device-code login. Preserve the login identifier through token rotation.
- Refresh using the recorded issuer and client ID, retaining the existing endpoint override and fallback behavior for legacy records. Clear provenance when an override changes the endpoint or when a response without token rotation encounters a concurrently replaced refresh token.
- Keep both metadata fields optional for older records without inferring provenance from token claims.
- Remove backend token error details from structured logs and refresh error messages.
- Box large futures in token refresh, MCP initialization, and embedded app-server test startup to reduce surrounding async frame sizes.

## Testing

Add coverage for legacy record compatibility and metadata round trips, browser and device-code login persistence, refresh using recorded OAuth settings, metadata preservation through rotation, and provenance clearing for a superseded refresh token.

GitOrigin-RevId: b6b5d2fcbe2a284a171a242c1a17128af55f1024
2026-10-19 22:21:13 +00:00
ben zhang e05028e7b0 Prefetch sibling rollout paths when reading history pages (#55396)
## Why

Resolving a history page's rollout lineage performs a separate filesystem lookup for each ancestor. Ancestors stored alongside the current rollout can share a lookup traversal.

## What changed

- Prefetch paths for up to 64 sibling rollout IDs belonging to the same thread when listing history turns or items.
- Resolve candidates in the normal lookup order to preserve first-match selection for duplicate rollout IDs.
- Validate prefetched paths before use and fall back to normal lookup for missing or stale paths. Treat prefetch failures as optional and continue with normal resolution.

## Testing

Add a regression test verifying that sibling prefetch selects the same first match for a duplicate rollout ID as normal lookup.

GitOrigin-RevId: 5d86c9643562a82a53af78b20f70322c1506c6e1
2026-10-19 22:04:38 +00:00
jif affa861ddf Roll back interrupted Guardian reviews to preserve evidence (#55395)
## Why

Cancelled or timed-out Guardian reviews can admit transcript evidence without completing a review. Reusing that session can leave subsequent reviews without the evidence they need.

## What changed

Mark interrupted reviews for rollback to the last completed review instead of reusing their live context. Preserve committed review history and replay pending evidence on the next review.

## Testing

Add cancellation and timeout regression coverage that verifies encrypted evidence appears exactly once in the next review, the last completed review survives rollback, and interrupted or denied commands do not execute. Update session disposition assertions and make the program-change session reuse test wait for review completion before releasing the classifier result.

GitOrigin-RevId: f39552b24db5309cffddd9eda97280256be3e97b
2026-10-19 22:03:06 +00:00
jif 61fa059d49 Use thread connections for enterprise MCP status listings (#55394)
## Why

Enterprise-managed MCP authentication requires the thread's admitted connection. Bulk `mcpServerStatus/list` requests need to use that connection to report the enterprise server's catalog consistently with single-server requests.

## What changed

- Read enterprise server metadata from the thread runtime when listing all MCP servers, preserving ordinary server discovery.
- Check the expected server registration before discovery so edited or disabled registrations cannot reuse an old connection's catalog.

## Testing

Add coverage for bulk and single-server status consistency, catalog metadata, and registration changes. Extend enterprise authentication lifecycle tests to cover bearer renewal, grant replacement, and logout during a pending exchange. Add a scenario asserting that enterprise sign-in failure preserves ordinary MCP tool schemas, calls, and model history.

GitOrigin-RevId: 3bf3bd672511d0c753cd95ec777892f72bd6eb89
2026-10-19 22:02:44 +00:00
jif e645309723 Deduplicate native agent messages in Guardian review context (#55391)
## Why

Full-transcript fallback can select encrypted agent messages already present in the reviewer's history. These duplicates should not consume the input budget or displace new evidence.

## What changed

- Reconcile native agent messages with the effective reviewer history and earlier messages in the pending input before budgeting, including after compaction.
- Deduplicate messages with nonempty IDs while preserving messages without IDs. Allow delivery again when the prior copy is absent from the current history.
- Reject conflicting authors, recipients, or content under the same ID without modifying the pending context.

## Testing

Add coverage for duplicate admission, conflicting payloads, redelivery after history removal, and retained reviewer requests. Extend the history eviction regression to verify that full-transcript fallback reuses the reviewer and preserves a single encrypted agent message.

GitOrigin-RevId: 97e90f6359a7cf5a75d1c5967fc98cd885afb4e4
2026-10-19 22:01:41 +00:00
Eric Traut 36e5861fd9 Mark transcript_v2 as removed (#55388)
## What changed

Mark the no-op `transcript_v2` feature as removed and drop it from the daemon startup override allowlist. Use `tui.fullscreen_transcript` to control the transcript preference.

## Testing

Update local settings coverage to assert that `features.transcript_v2` does not override the fullscreen transcript preference. Use a generic deprecated option in the deprecation notification test and snapshot.

GitOrigin-RevId: 78f832b9603cedc2a6509404a45509e47e845752
2026-10-19 21:44:30 +00:00
Eric Traut fea1d7f7d1 Add support for Academic Researchers plans (#55387)
## What changed

- Recognize `sci` and `sci_plus` in authentication, account responses, rate limits, and generated client schemas.
- Treat both plans as workspace accounts eligible for cloud configuration, and use business analytics routes.
- Display “Academic Researchers” and “Academic Researchers Plus” in the TUI and direct users to their admin when usage limits are reached.

## Testing

Add coverage for plan parsing, workspace classification, account and rate-limit responses, cloud configuration eligibility, analytics routing, TUI labels, and usage-limit guidance. Exercise installed-app refresh and listing with `sci_plus` authentication.

GitOrigin-RevId: b51c5df03029b8bc249d44f11b353a7755e7dd04
2026-10-19 21:43:19 +00:00
keeley-openai b8f880bc38 Reject replaceable symlinks in pre-sandbox executable lookup (#55384)
## Why

A read-only executable target does not make its lookup path trustworthy: a symlink or ancestor directory may still be replaceable through writes allowed by the filesystem policy.

## What changed

Check the original lookup path, resolved parent aliases, and canonical target before selecting a pre-sandbox executable such as `bwrap`. Account for sticky directory ownership when deciding whether a child can be replaced, while preserving read-only mount carveouts.

Resolve `PATH` entries individually, including relative entries when the working directory contains a colon.

## Testing

Add regression tests for writable symlinks to read-only executables and symlinked search directories into writable roots. Extend search-path coverage to relative entries and a working directory containing a colon, and update the protected system installation test to use a direct executable path.

GitOrigin-RevId: 18d0cb6e809e5abd1313315670d4e2ff91dcfb30
2026-10-19 21:26:58 +00:00
Benjamin Carlsson 63ba55817a Manage TUI backend sessions independently (#55381)
## What changed

Add a `BackendSessions` collection to own app-server sessions and poll their events fairly with cancellation-safe receives. Track listening state per backend so pausing or closing one stream leaves the others available, and resume polling after reconnect. Shut down all registered sessions on exit.

Ignore background backend disconnect, lag, account, and rate-limit events that would otherwise update the displayed conversation's UI.

## Testing

Add coverage for polling three sessions, paused and closed stream isolation, cancellation, and session replacement after reconnect. Extend event ownership coverage to verify that background lifecycle and account events leave the displayed connection and rate-limit state untouched.

GitOrigin-RevId: 9ed82abc77aaf4bfeb86eb72161ad90fe20177ad
2026-10-19 21:03:57 +00:00
jif 1e4ba692b8 Preserve thread metadata before rollout files are materialized (#55380)
## Why

A live thread can have updated SQLite metadata before its rollout file exists.
Reading metadata from the missing file loses creation details such as fork and
parent relationships and triggers unnecessary filesystem discovery and retries.

## What changed

- Read deferred `SessionMeta` through the rollout writer, ordered with persistence.
  Return no in-memory metadata once the rollout is materialized or resumed.
- Combine that creation metadata with SQLite metadata for reads that exclude
  history, and use it to determine the canonical history mode during updates.
- Keep untouched threads without a stored record unavailable for fork and resume.

## Testing

Add coverage for metadata reads and updates before persistence in both legacy and
paginated history modes, including equality with metadata read after persistence.
Verify the recorder exposes creation metadata only while deferred, and expand
fork/resume rejection tests across history modes and resume turn inclusion.

GitOrigin-RevId: 8d293cc8f87156409f195130437d93858a4099b9
2026-10-19 21:02:19 +00:00
Konstantine Kahadze 37594ab7cc Handle response body failures in OpenAI docs downloads (#55379)
## Why

Response body reads could outlive the manual download timeout or fail outside the existing fallback and retry handlers.

## What changed

- Read successful manual response bodies within the fetch timeout and transport fallback so stalled or failed reads fall back to `curl`. Leave `HEAD` responses unconsumed.
- Await model metadata response bodies inside the retry handler so read failures use the existing three-attempt retry loop.

## Testing

Add regression tests for manual body timeouts and truncated bodies falling back to `curl` before caching, plus model metadata body failures succeeding on retry or stopping after three attempts. All four tests pass with `node --test codex-rs/skills/tests/openai_docs_downloads.test.mjs`.

GitOrigin-RevId: 528595307ef86ad2522dc8ae488baadc001ad961
2026-10-19 21:01:44 +00:00
johnl-oai c6e29b4fcb Migrate the Windows MXC sandbox to mxc-sdk (#55378)
## What changed

- Replace the separate MXC crates with `mxc-sdk` and adapt request construction to its policy and optional environment fields.
- Preserve the native availability probe by caching successful process security environment creation and startup attribute initialization without launching a process.
- Use the SDK's native denied-path support check and configure Bazel resource compilation for Windows GNU targets.

## Testing

Extend the request construction test to verify that nonempty environments use `Some` and empty environments use `None`.

GitOrigin-RevId: 2765c8fd19ee60661b0ce7cb3cba51acadda201a
2026-10-19 20:54:41 +00:00
jif e389b2444c Add configured thread environment inheritance for subagents (#55375)
## Why

Temporary environment attachments for a parent turn should not become a
subagent's persistent environments. Children also need to retain their
configured executor bindings when their runtime is evicted and reloaded.

## What changed

- Add the disabled-by-default `subagent_thread_environments` feature flag.
  When enabled, both subagent implementations inherit configured thread
  environments captured with the invoking step, excluding turn-only attachments.
- Track configured bindings separately from active turn attachments, preserving
  pending configuration ownership and sharing completed executor startup.
- Retain configured selections and bindings across idle eviction. Reload children
  using retained bindings when the parent changes workspace, while continuing to
  validate current parent roots and permissions for matching workspaces.

## Testing

Extend regression coverage for configured, empty, forked, pending, and legacy
inheritance; temporary attachment removal across eviction; and reload behavior
with changed workspaces, deferred startup, and restricted permissions.

GitOrigin-RevId: 15692ecd99deb38002014b44fd859d793bd54373
2026-10-19 20:30:44 +00:00
Joe Savona 0d337e5fe7 Fix recall of command-line initial prompts in the TUI (#55372)
## Why

Command-line initial prompts bypass the composer and were missing from local recall history, so pressing Up could skip them and retrieve cross-session history instead.

## What changed

Record accepted initial prompts in local recall history with their draft metadata. Add image placeholders where needed so recalled local attachments survive resubmission. Leave synchronously rejected prompts out of recall history.

## Testing

Add regression tests for recall order before cross-session history, ordering after transcript replay, queued prompts appearing once, rejected submissions, and image attachment recall and resubmission. Add a snapshot of the recalled initial prompt.

GitOrigin-RevId: 0a12221ae285f01bff4b5860e546c8f7ee3c71e3
2026-10-19 20:21:30 +00:00
Alex Kira c953dacb42 Enable incremental tools by default for Responses Lite (#55368)
## What changed

Mark `incremental_tools` as stable and enable it by default. Responses Lite sessions now append tool catalog updates to request history without requiring an explicit feature opt-in.

## Testing

Run the incremental catalog scenario with the default configuration. Update assertions and snapshots for empty Responses Lite prewarm input, tool declarations on the first turn, preserved compaction history, and tool changes across model switches and child agents.

GitOrigin-RevId: 27aa6b8499d76ab12167470748452f47e14dd900
2026-10-19 20:01:37 +00:00
Dylan Hurd d9a36f6ec7 Support catalog templates for approved command prefixes (#55366)
## What changed

Add `approved_prefixes` to catalog permission messages, with `{{ approved_prefixes }}` substitution for the approved command list. An empty template suppresses the section; missing or null values retain the bundled template.

For `on-request` approvals, append an explicitly supplied prefix template even when the catalog also supplies approval instructions. Use the template for bundled `on-request` and granular approval instructions as well.

## Testing

Extend the remote model catalog integration test to cover custom prefix rendering alongside catalog approval instructions and suppression with an empty template.

GitOrigin-RevId: 82dd6f83caa56cab0a2f6343bf912efe2cb97d64
2026-10-19 19:55:39 +00:00
jgrodman-arch ee8b4ea181 Import only the continuation of backgrounded Claude sessions (#55365)
## Why

Backgrounding a Claude session creates a continuation that includes its history. Offering both sessions for import duplicates that history.

## What changed

Skip sessions containing a `continued-in` record with a nonblank `continuedInSessionId` during import detection, leaving the continuation available for import.

## Testing

Add detection and app-server regression tests covering continuation-only detection, importing the full history into one thread, and no remaining import candidates afterward.

GitOrigin-RevId: bf8383faadce984ae3c41a0b8e8b3072680fd4b2
2026-10-19 19:53:58 +00:00
Dmitriy Kovalenko 18d09e1eda Add a shared cleanup lock guard for local log directories (#55358)
## What changed

Export `LocalLogsDir` from `codex-file-system` to create a caller-selected diagnostic directory and retain a shared directory lock on Unix. Clones share the lock so callers can keep it held until all log connections close.

New directories use mode `0700` on Unix; existing permissions are preserved. Initialization checks that the locked directory still matches the selected path and returns an error if it changed.

GitOrigin-RevId: fc870d7ee0997d67ba1a23f72ba4ac3cf89fd31a
2026-10-19 19:33:42 +00:00