Commit Graph
13139 Commits
Author SHA1 Message Date
Dylan Hurd de6e72addd Add opt-in Unicode canonical matching to exec policy rules (#59535)
## What changed

- Support `canonical_matching=True` in `prefix_rule` and `canonical_matching = true` in managed TOML prefix rules. Apply Unicode canonical caseless matching to every prefix token, including alternatives, while keeping exact matching as the default.
- Match case and canonically equivalent Unicode spellings, such as `bash` and `bAſh`, without resolving executables on the filesystem.
- Preserve managed restrictions when checking absolute-path rule amendments, and enforce applicable `host_executable` path allowlists during basename fallback.

## Testing

Add coverage for case folding, Unicode normalization, token alternatives, exact-match defaults, and host executable allowlists. Extend managed-policy and shell-execution tests to cover canonical matching.

GitOrigin-RevId: c2f79069dc38d55c77028c457b22beb468d5c571
2026-11-05 00:55:46 +00:00
rhan-oai f3074e35c0 Render host-owned V2 subagent rosters in environment context (#59531)
## What changed

- Expose `AgentSessionReader` and `AgentRef` for read-only access to host-owned agent session membership.
- Read direct children when rendering V2 environment context, using the existing roster size limits. Refresh membership when rebuilding context after compaction, and omit the roster if the provider is absent or the read fails.
- Preserve unrecorded initial input across suspension or interruption while waiting for a roster read. Resolve the roster before advancing the compaction window.

## Testing

Add coverage for roster refreshes after compaction, unchanged environments avoiding extra reads, unavailable rosters, recoverable input during blocked reads, and stale compaction results rejected after a concurrent history replacement.

GitOrigin-RevId: 3c7e3822af09e9295d405e53dabb87b020c8f00c
2026-11-05 00:39:39 +00:00
viyatb-oai 9a7213ca37 Resolve workspace permissions at the sandbox launch boundary (#59530)
## What changed

Add optional executor workspace roots to `SandboxTransformRequest` and resolve symbolic workspace rules after merging additional permissions. Preserve explicit deny rules and treat an empty root list as granting no workspace access.

Route Windows restricted-token preparation through the shared transform path and use explicit roots when building its direct-spawn wrapper. Update Windows MXC debug launches to bind configured roots before adding the managed CA read grant.

## Testing

Extend sandbox manager tests to cover workspace and subpath expansion, empty root lists, deny preservation, and the roots and write permissions serialized into the Windows wrapper.

GitOrigin-RevId: 0bebdb08b67cbbc182c18b031b9d13a21a799682
2026-11-05 00:30:20 +00:00
Felipe Coury e8e3197e84 Make side conversation panes resizable and interactive (#59527)
## What changed

- Allow dragging the pane divider and save the preferred width in `tui.sidebar_width_percent`, defaulting to one third of the terminal. Defer reflow until release when retained images are present.
- Support scrolling and loading older history in the unfocused pane, opening links, copying selections, and clicking its composer to switch focus while preserving the clicked text position.
- Keep assistant replies, running command completion, and turn status current in the unfocused pane without duplicating answers or completion metadata when focus returns.

## Testing

Add regression coverage for divider previews and saved widths, image-aware resizing, composer clicks, unfocused history pagination and copying, and streaming replies and command completion across focus changes.

GitOrigin-RevId: a26accc0f8df3c17f53bc915db29a11c8de3c480
2026-11-05 00:19:26 +00:00
Benjamin Carlsson b2a47c5cdd Forward cloud message item lifecycle notifications (#59524)
## Why

The cloud backend discarded item start and completion events, preventing clients from receiving user message receipts and complete assistant messages through those notifications.

## What changed

Convert cloud user and agent message summaries into `ItemStarted` and `ItemCompleted` notifications. Preserve user submission IDs and text, assistant text and questions, and lifecycle timestamps. Continue ignoring unsupported item types.

## Testing

Add unit tests covering user receipt identity and text, plus completed assistant message text, questions, and timestamp.

GitOrigin-RevId: 3e88129553844a90eea2a006d35f32a0b7d9e53a
2026-11-05 00:05:34 +00:00
Celia Chen a5ed46ca37 Populate the local secrets cache after successful saves (#59520)
## Why

Saving local secrets invalidated the decrypted cache, forcing the next read to decrypt contents already available in memory.

## What changed

Populate the cache with the saved snapshot after the atomic write succeeds. Only cache the current schema version, leaving normalization and rejection of other versions to the read path. Reads continue to verify the ciphertext and keyring before reusing cached contents.

## Testing

Add coverage across all four local secrets namespaces for cache reuse after saving, including through backend clones, and preservation of the committed snapshot after a failed write. Update existing tests to verify cache reuse after setting and deleting secrets while retaining concurrent cold-read coverage.

GitOrigin-RevId: 61519aadc16bbe8db8c5055b126885500716418a
2026-11-04 23:46:52 +00:00
Joe Savona 47172f064f Validate UI trees at decode time and simplify display elements (#59518)
## Why

UI tree limits previously applied during rendering, silently dropping content
beyond the budgets. Validate the whole JSON tree before rendering so oversized
inputs are rejected, including content outside the visible line.

## What changed

- Add a `UiTree` string parser that limits JSON to 64 KiB, nesting depth to 16,
  non-null nodes to 256, and total string content to 16 KiB of UTF-8.
- Represent text as string leaves or `text` elements with children. Remove node
  keys, `spacer`, and `divider` elements.
- Require an explicit `row` gap as a non-negative JavaScript-safe integer measured
  in terminal columns. Bound rendered spacing by the viewport and skip empty
  children when inserting gaps.
- Update footer content and built-in status lines to use the revised tree format.

## Testing

Add coverage for malformed elements and gaps, whole-tree size boundaries, URL
length limits, large-gap rendering, and bounded UTF-8 prefixes for directly
constructed text. Update hyperlink and footer clipping tests for the new format.

GitOrigin-RevId: 3c00881d3e7f2d79d11aa188f64f0725cd47ee68
2026-11-04 23:31:55 +00:00
Dmitriy Kovalenko 08511817f3 Simplify pending interactive request tracking in the TUI (#59517)
## What changed

Replace parallel lookup sets and per-turn maps with a single arrival-ordered list of pending interactive requests. Centralize request matching for replay filtering and cleanup, deduplicate repeated requests, and resolve user input answers against the oldest pending question for the turn.

GitOrigin-RevId: c02115c289718a39359a6e6653d1dc7d588d2f90
2026-11-04 23:31:31 +00:00
Benjamin Carlsson 763faa6ee4 Add paginated cloud thread discovery to the cloud client (#59514)
## What changed

Add `Client::list_threads` with cursor pagination, page limits, sorting, and originator filtering for unarchived threads. Return thread snapshots, optional read states, and forward and backward cursors while preserving server order and duplicate entries.

Allow stored thread snapshots to contain empty session IDs and model providers while retaining nonempty requirements for activation. Preserve the original snapshot protobuf bytes.

## Testing

Add fixture tests for pagination requests, default query encoding, snapshot and read-state preservation, legacy empty metadata, invalid responses, and activation validation.

GitOrigin-RevId: 6492cb60573d13cc7b7d0aa583d1dab6bccafc4d
2026-11-04 23:18:18 +00:00
William Woodruff f8c4060b68 Bump the Python SDK build backend to uv_build 0.13 (#59512)
## What changed

Update the Python SDK build requirement and release tooling to use `uv_build>=0.13.0,<0.14`. Refresh the release tooling lockfile from version `0.11.33` to `0.13.6`.

GitOrigin-RevId: 9c9a8ef8c24f133144ec141c6611ba4c7b1863b1
2026-11-04 23:05:12 +00:00
Eric Traut 4b94e6cf26 Use server model defaults for fresh TUI sessions on every connection (#59510)
## What changed

- Extend server-owned fresh-start bootstrap to embedded connections, preserving explicit profile and launch overrides.
- Require `config/read` to succeed before starting a fresh thread, including on servers that do not support the method.
- Prefetch `model/list` alongside `hooks/list` and reuse the result during bootstrap.

## Testing

Extend startup coverage for managed model and reasoning-effort defaults across embedded, daemon, and remote connections. Verify startup failure shuts down all initial backends, and directory-trust startup requests the model catalog exactly once while `hooks/list` is outstanding.

GitOrigin-RevId: c96edfbc13c98203b7c2a809a87d225e05cf5f1b
2026-11-04 22:58:01 +00:00
Joe Savona aa1399cbcd Forward caller metadata on MCP resource reads (#59509)
## What changed

Accept an optional `_meta` object on `mcpServer/resource/read` and forward it to MCP `resources/read`, including reads bound to an originating tool call. Update the protocol schemas and generated TypeScript and Python types.

Reject caller metadata containing host-owned `threadId`, `x-codex-turn-metadata`, or `codex/connectionLease` keys. For `codex_apps`, also reserve `connector_id`, `link_id`, and `_codex_apps.resource_uri` to preserve app and account routing.

## Testing

Add integration coverage for metadata forwarding through stdio, hosted app reads with and without a thread, and origin-bound widget reads. Cover rejection of reserved keys and non-object metadata.

GitOrigin-RevId: 227ee0fb5fe15fa2ff2ec66d4d5ae16de8935a8c
2026-11-04 22:55:22 +00:00
ioanbudea-OAI ad5e6e57a1 Bind memory consolidation permissions to the memory root (#59507)
## What changed

Configure managed memory consolidation agents with a `PermissionProfile` directly and explicitly bind both configuration and permission workspace roots to the memory directory. Keep network access disabled and exclude temporary directories from writable roots. Preserve disabled and externally managed parent permission profiles.

## Testing

Extend regression coverage to check that inherited workspace roots remain readable but are not writable, protected metadata stays read-only whether or not it exists, and incompatible permission constraints prevent agent configuration. Verify effective filesystem enforcement, network policy, and disabled approvals across parent permission profiles.

GitOrigin-RevId: b1ae115cade059da9e5fb83c218a1d89185b4a70
2026-11-04 22:43:34 +00:00
Sean Huang e15c5fc2b9 Upgrade argument comment lint to Dylint 6.3.0 (#59505)
## Why

Dylint 6.1.0 required a Git branch alias to accommodate rust-clippy's removed `master` branch.

## What changed

- Upgrade the lint dependencies and CI/release tooling to Dylint 6.3.0, updating the Cargo and Bazel lockfiles.
- Remove the Clippy compatibility script and run `cargo test --locked` directly in CI.
- Update installation instructions and wrapper diagnostics to recommend the matching tool versions.

GitOrigin-RevId: 18ac1489cd3faa7a80abf26b092e5478881f142d
2026-11-04 22:34:04 +00:00
Abhinav e115d5f90d Keep threads on their saved model provider when defaults change (#59503)
## Why

Changing the default model provider should not prevent users from resuming or continuing a thread that uses another configured provider.

## What changed

- Resolve cold resumes using the thread's saved provider and reject explicit attempts to switch it on resume.
- Use retained provider configuration for loaded threads without reloading the current default selection, while continuing to enforce managed provider policy.
- Preserve errors for missing provider definitions and policy conflicts.

## Testing

Update app-server and TUI coverage for resuming with a different default, recovering after restoring a missing provider definition, preserving drafts across resume retries, and continuing loaded threads with malformed system defaults.

GitOrigin-RevId: c5bf3b03cacde7349480c94c2f10bac827a0eb1f
2026-11-04 22:20:18 +00:00
Benjamin Carlsson 6744e5eb79 Fix the workspace policy test's auth loading call (#59501)
Update `workspace_policy_change_rejects_pending_transient_auth_fallback` to
pass `None` for `cached_auth` and unwrap the `load_auth` result before
checking the fallback credentials.

GitOrigin-RevId: 09b7812f2f072389f9633de977e63edfa45186ed
2026-11-04 22:03:18 +00:00
yiqian-oai dc1cc0a0e8 Add debug timing for thread item pagination (#59497)
## What changed

- Log `thread/items/list` request IDs, cursor kinds, page sizes, next-page availability, elapsed time, and success status.
- Log remote-control item-page response preparation and WebSocket write times, along with request and stream IDs, sequence IDs, frame counts, wire bytes, and success, interruption, or write-error outcomes. Collect these transport metrics only when debug logging is enabled.

GitOrigin-RevId: 0f26bef6d6b8cacbd5a5c76c49a5f882669f6598
2026-11-04 21:33:28 +00:00
jif b260ee5e83 Preserve project agent opt-ins across enabled legacy feature flags (#59496)
## Why

An enabled legacy feature flag could prevent a project's `agents.enabled = true` from overriding a lower-priority legacy opt-out, leaving V1 agent tools unavailable.

## What changed

Only stop scanning configuration layers at an explicit legacy feature opt-out. Enabled flags now allow the scan to continue, so project opt-ins can override lower-priority opt-outs while same-layer and higher-priority opt-outs remain effective.

## Testing

Extend the model runtime selector regression test to cover enabled `features.collab` flags in project configuration and CLI overrides, and verify that explicit `false` values still disable V1 agent tools.

GitOrigin-RevId: ca3dcf9dc6a642eb72e20929776fb74379715053
2026-11-04 21:23:11 +00:00
jif 464239de0a Honor the configured credential store in gateway test fixtures (#59495)
## What changed

Update `seed_gateway_auth` to seed either the keyring or file credential store according to the provider's configuration, using `GatewayAuthManager::credential_id()` to identify credentials.

Use file storage in the gateway model-cache reuse and login-required invalidation tests to keep keyring latency outside the behavior under test.

GitOrigin-RevId: 23b4f31b6d9f9561638267723582af73eabefcfc
2026-11-04 21:22:28 +00:00
Benjamin Carlsson 5112ce6ede Add a native cloud backend to the app-server client (#59493)
## What changed

Expose `cloud_backend::connect` to adapt an authenticated `codex-cloud-client` client to `AppServerClient`. Support account reads, resuming a conversation by ID with saved settings, reading its metadata, listing the loaded thread, and unsubscribing.

Forward turn lifecycle events and agent message deltas, and track thread status from attachment notifications. Keep the previous attachment when a replacement fails, report stream disconnections, and reject turns without an active attachment. Unsupported requests and approval replies return explicit errors.

## Testing

Add tests covering failed attachment replacement, turn admission after disconnect, and thread status tracking across notifications and reattachment.

GitOrigin-RevId: 5a131e814d588cadeb9fb94513b99e92b47e3da4
2026-11-04 20:51:55 +00:00
cooper-oai 08bbbbdff3 Preserve external auth through transient provider failures (#59491)
## Why

A temporary external credential provider failure should not clear cached authentication or appear as a logout.

## What changed

Retain cached credentials after transient external auth failures when they still satisfy the current login and workspace restrictions. Advance the auth generation when the forced workspace policy changes so pending reloads cannot publish credentials validated against an outdated policy.

## Testing

Add regression tests for retaining credentials without auth change notifications during a transient failure, notifying watchers after recovery, rejecting credentials disallowed by a workspace policy change, and discarding a pending fallback validated before that change.

GitOrigin-RevId: 304f091f3b59d4840a8be09bf38671370e86abd8
2026-11-04 20:50:58 +00:00
sayan-oai 9fcaeb7335 Use MCP owner permissions for Guardian reviews and score reuse (#59489)
## Why

An MCP server can belong to a different environment from the turn's primary environment. An early Guardian score based on the issuing context must not bypass review when the server owner's permissions differ.

## What changed

- Capture the owning environment's permissions when preparing an MCP call and retain them for server-initiated approvals tied to that still-running call.
- Use the captured permissions consistently in Guardian review prompts and permission context.
- Require a fresh synchronous review when the captured owner permissions do not match the early score's authorization.

## Testing

Extend regression coverage for MCP score reuse across environments and for follow-up approvals from a local MCP server during a remote-primary turn. Assert that reviews use the owner's denied paths and require a fresh review when permissions differ.

GitOrigin-RevId: eb5eeb1259732c57f39765c38e34148fa0787dae
2026-11-04 20:37:39 +00:00
Henry Levy d78f68f8d1 Allow per-turn overrides for direct-only tool namespaces (#59481)
## What changed

- Add `direct_only_tool_namespaces` to `TurnStartOptions`. Omission inherits the thread configuration; an empty list clears direct-only routing for that turn. Steering ignores the option.
- Persist explicit overrides in turn context and restore them when recovering an interrupted turn, including turns started by standalone tool output.
- Keep subsequent turns and spawned or resumed child agents on the thread's routing defaults.

## Testing

Add coverage for routing changes across turns in Responses and Responses Lite, recovery without carrying overrides into subsequent turns, and child-agent inheritance.

GitOrigin-RevId: cea1a997424572d4cd372cd15b098626904c6796
2026-11-04 19:58:49 +00:00
Rohan Mehta 41cbd5b9b2 Add per-turn prompt cache TTL options (#59480)
## What changed

- Expose `PromptCacheTtl` through `TurnStartOptions` and `RecoverTurnRequest`, supporting `30m` and `12h` minimum cache lifetimes.
- Carry the selected TTL through turn execution and compaction into `prompt_cache_options.ttl` on Responses HTTP and WebSocket requests. Omit the field when unset and keep the selection scoped to the turn.
- Include prompt cache options in WebSocket request reuse checks.

## Testing

Add coverage for both TTL values and omission on a subsequent turn without an override, and extend WebSocket serialization coverage to include prompt cache options.

GitOrigin-RevId: 8529306e6ad6030fe77c5e6bf19f3810717c0c5e
2026-11-04 19:58:24 +00:00
jif c9296fa1a9 Deprecate the multi_agent feature flag (#59479)
## What changed

Mark `[features].multi_agent` as deprecated while keeping it enabled by default and preserving its control of the V1 fallback.

Emit a startup warning when a user or project configuration explicitly sets the flag. The warning points to `[agents].enabled = false` for disabling subagent tools, with an exception when `[features].multi_agent_v2` is enabled. Session-only overrides do not trigger the warning.

## Testing

Add configuration-loader coverage for explicit user and project settings, including a project setting overridden by a session flag, and for session-only overrides. Update the default-enabled feature check to allow deprecated features.

GitOrigin-RevId: 8bcac6ce5eac27528a2b362755e25d6a6e811c59
2026-11-04 19:57:59 +00:00
jif bd7cfa3f69 Record saved multi-agent opt-outs in session telemetry (#59478)
## Why

Saved `features.multi_agent = false` settings can be overridden by a higher-precedence session setting. Session telemetry should retain visibility into those saved opt-outs.

## What changed

Add `config.legacy_multi_agent_disabled_sources` to `codex.conversation_starts`, reporting opt-outs from user configuration, project configuration, and managed requirements. Emit comma-separated source labels, or `none` when no opt-outs are found.

## Testing

Add a regression test confirming that a user opt-out is still reported when a CLI override enables multi-agent support for the session.

GitOrigin-RevId: 488bd317d67e9ee87c5903ae51f466e0a63c05eb
2026-11-04 19:57:30 +00:00
jif b9099a145b Honor project agent opt-ins over lower-priority legacy opt-outs (#59476)
## Why

Migrating a project's multi-agent setting to `[agents] enabled = true` should preserve access to agent tools when a lower-priority config still sets `features.multi_agent = false`.

## What changed

Allow an explicit project agent opt-in to override a strictly lower-priority legacy feature setting. Preserve legacy feature settings in the same or higher-priority layer, and continue enforcing managed feature requirements.

## Testing

Add regression coverage for project migration, V1 and model-selected V2 tools, same-layer and CLI opt-outs, and enterprise requirements that disable multi-agent tools.

GitOrigin-RevId: 5810a42d4b7e66cdcbef8dad5281dda4a66291b3
2026-11-04 19:43:00 +00:00
swastik-oai 75424f87ca Refactor MCP tool argument parsing and approval preparation (#59474)
## What changed

Extract argument parsing and approval policy selection into helpers. Separate
approval requirement evaluation and action construction from requesting approval,
with explicit states for approvals that are unnecessary, remembered, or required.

GitOrigin-RevId: 822cda972f9e0d12286ec833dfbe11b47b4c0ec8
2026-11-04 19:12:26 +00:00
Sean Huang 4437ff312b Extract agent message board hosting into a dedicated crate (#59473)
## Why

Core tests depend on `codex-app-server` to install and clean up agent message boards. A dedicated host crate lets them use this functionality without depending on the app server.

## What changed

Move the existing host implementation into `codex-agent-message-board-host` and update core test helpers and scenarios to use it directly. Keep the installation and deletion functions re-exported from `codex-app-server`.

GitOrigin-RevId: 9ed62d50a5f31c70550d70ba3c583399e869168a
2026-11-04 19:10:59 +00:00
Felipe Coury 4f6acbf02d Preserve transcript interaction when switching panes with arrow keys (#59472)
## Why

Directional pane switching cleared the parent conversation's transcript selection or Find state, so returning to it interrupted the interaction.

## What changed

Route left/right pane switches through the existing conversation toggle to park and restore each pane's transcript interaction. Explicitly focusing the main composer still clears transcript interaction.

## Testing

Extend the side-conversation test to cover restoring selections, Find text and caret position, and composer input after scrolling. Add a snapshot verifying that Find remains editable after switching away and back.

GitOrigin-RevId: 172f9be0df15517fbfe7f3773b63cbd1cef1cc77
2026-11-04 18:56:44 +00:00
Owen Lin 9ff072db8a Allow prepared forks to use source revalidation (#59468)
## What changed

Add `PreparedFork::with_source_revalidation` for backends that revalidate the source when making the child's history reference durable, allowing the source reservation to be omitted.

Rename the reservation-backed constructor to `with_source_reservation` and update the local thread store to use it, preserving its source deletion protection.

GitOrigin-RevId: 659c23aaf83a3856eb628ea37f1b0a153d376516
2026-11-04 17:56:42 +00:00
Eric Traut ba057e4375 Drain queued side-conversation events before switching focus (#59458)
## Why

Pressing `Ctrl-/` immediately after `/btw` must not switch focus before the queued side-conversation prompt is dispatched.

## What changed

Wait for queued app events to drain before reading terminal input when the displayed thread belongs to a parent/side conversation pair, even when side retention is disabled. This keeps queued prompts and transcript updates ahead of focus changes.

## Testing

Extend the side-conversation startup test to toggle focus at the earliest allowed opportunity and verify that the turn starts on the side thread. Also check that a queued request to reopen the side conversation blocks terminal input until handled.

GitOrigin-RevId: cb46636d35de97b02994ed68a32eb971cd7bf6db
2026-11-04 17:23:44 +00:00
Will Emmanuel 031829da6a Carry per-input extension data to user message completion callbacks (#59455)
## What changed

Add `user_input_extension_data` to `TurnInputRequest` and carry it with each queued user input through completion, including inputs that steer an active turn. Expose the data to lifecycle contributors through `on_item_completed_with_metadata`, whose default implementation forwards to `on_item_completed` for compatibility. Keep this data out of model input and preserve the existing serialized input shape when no extension data is present.

## Testing

Add serialization round-trip coverage and extend the concurrent submission test to verify that inputs sharing a client ID retain their own metadata, report completion in the accepting turn, and omit extension data from model requests.

GitOrigin-RevId: f880cf812994a030cb1be9418280ba69e2885808
2026-11-04 17:13:00 +00:00
jif ede589336e Prefer Launchpad for Linux zlib downloads in rules_rs (#59448)
## What changed

Update the `rules_rs` patch to try Launchpad first for the Linux `aarch64`
and `x86_64` zlib packages, retaining the dated Ubuntu snapshot URLs as
fallbacks. Keep the pinned package versions and SHA-256 hashes unchanged.

GitOrigin-RevId: 2582fb2db50eb8fd652ffd02b11e226d106561d4
2026-11-04 16:48:44 +00:00
Eric Traut 65c83ea5a2 Restore the daemon auto-start feature flag (#59447)
## What changed

Honor `features.daemon_auto_start` as a stable, default-enabled setting instead of ignoring it with a deprecation warning. Apply it to interactive daemon auto-start and remote-control daemon eligibility, and accept it in managed feature requirements.

Preserve explicit `false` values when saving the setting, even when the server reports a disabled default. Record the setting and disabled auto-start outcomes in launch telemetry.

## Testing

Update coverage for restarting a discovered daemon with auto-start disabled and for persisting an explicit opt-out when the server default is disabled. Adjust embedded-backend tests to disable auto-start through configuration.

GitOrigin-RevId: cbf079e3e27b4a7e6e802bf8f19dae653dd7472c
2026-11-04 16:46:21 +00:00
Eric Traut 49f2fc2c1e Warn when project instructions exceed the configured byte budget (#59445)
## Why

Project instructions could be truncated or skipped when the byte budget ran out without a user-facing warning.

## What changed

- Report truncated files and skipped files or environments, with guidance to trim instructions or increase `project_doc_max_bytes`.
- Warn when combined instructions exceed the configured budget, clarifying that global and thread instructions contribute to the total but the limit applies only to project files.
- Refresh cached project instructions when `project_doc_max_bytes` changes.

## Testing

Add warning snapshots for truncated files, skipped files and environments, and combined instructions exceeding the budget.

GitOrigin-RevId: 121eebb8ac8891decada2d028c194aa687815466
2026-11-04 16:34:49 +00:00
ioanbudea-OAI 4d62359072 Add opt-in elastic budgeting for synchronous Guardian reviews (#59444)
## What changed

- Add `features.guardianv2.sync_elastic_budgeting` and `sync_elastic_sections` to configure section minimums, per-entry token caps, and optional section maximums. Require and validate section limits when enabled.
- Use the selected budgeting policy consistently for history capture, resume, prompt preparation, and review input budgeting. Keep fixed budgeting as the default.

## Testing

Add configuration validation tests, capture-and-resume coverage for both budgeting modes, and a request-history snapshot verifying retained instructions and transcript section limits.

GitOrigin-RevId: c7b0bdfd3e0e008d75c4d8a204959bcc58eb1bf8
2026-11-04 16:33:22 +00:00
jif 48524f337a Preserve pending agent messages across compaction (#59404)
## Why

Agent messages that arrive after a model request starts must survive compaction until a normal inference request includes them. Compactor output alone does not establish that those messages were delivered.

## What changed

- Persist history sequences and sampling checkpoints in harness metadata, capturing the input prefix for each normal inference request.
- Retain pending agent messages within existing size budgets during local and remote compaction, placing the summary before pending messages and subsequent caller input.
- Preserve sampling progress across history replacement and resume, and drain queued mail after interrupted sampling even when compaction leaves context above the token limit.

## Testing

Add regression coverage for request-boundary sampling checkpoints, pending messages across local compaction and repeated remote compaction with resume, and injected messages that interrupt sampling before mid-turn compaction.

GitOrigin-RevId: 26c04ab96b5a1c3cc1d6625ccc74a0f00201d14c
2026-11-04 13:03:01 +00:00
jif 389d99fa4d Fix missing item ID generators in retained instruction tests (#59403)
Pass `uuid_v7_item_id_generator_for_test()` to the two remaining
`record_user_message` calls in the transcript source-proof and budgeting test
to match the required API signature.

GitOrigin-RevId: d9ea7da605de895e009a67a3ab378111599b5bbd
2026-11-04 13:02:36 +00:00
ioanbudea-OAI fc79b7f53a Honor section limits in elastic Guardian context budgeting (#59401)
## Why

Elastic allocation could shrink section minimums under budget pressure and bypass section maxima when the complete request fit. Instruction deduplication also needs to account for which transcript entries actually survive allocation.

## What changed

- Fund demand-capped section minimums before scaling headroom up to section maxima. Reject requests whose minimum reservations cannot fit after duplicate credit.
- Prioritize required records over optional records within each section, reconsider selections when redistributing packing gaps, and reserve global space for protected content and framing.
- Deduplicate retained instructions only against complete selected transcript sources, keep that proof selected during refills, and reuse the released budget.
- Retain elastic transcript history by byte limits instead of fixed item counts. On non-user byte overflow, evict whole older entries toward half the byte allowance.

## Testing

Add regression coverage for section minimums and maxima, priority selection, shared framing, duplicate-proof refills, and elastic history retention and replay.

GitOrigin-RevId: d73b40b88ba1bdab97a619014577f4a297171413
2026-11-04 13:00:58 +00:00
Dmitriy Kovalenko 021fccb046 Stabilize cross-platform tests and directory-change fork permissions (#59369)
## Why

Tests need to distinguish slow subprocess startup from operation timeouts and wait for asynchronous work before asserting results or cleaning up fixtures.

## What changed

- Synchronize subprocess readiness, queued-turn completion, and matching UI events; allow more time for cold startup and separate startup from shutdown deadlines.
- Adapt Windows fixtures and permission expectations, provide the voice-host test runtime DLL path, and normalize platform paths and animated status snapshots.
- Use current configuration permissions when changing directories in embedded TUI sessions, while retaining saved permissions for remote sessions.
- Allow the release prompt-prefix comparison to accept the exact image-tool description update that removes image detail options, and refresh the corresponding tool snapshot.

## Testing

Extend inherited-session metadata coverage to both legacy and paginated thread history, including persisted history mode and revision-aware resume.

GitOrigin-RevId: 0afb38403fc0adb0d83175344749584f0cdf9979
2026-11-04 09:51:28 +00:00
Ruslan Nigmatullin 71a4c07036 Share context window ID allocation through the agent runtime (#59354)
## What changed

Store a shared `ContextWindowIdGenerator` in `LocalAgentRuntime` and pass it into each session. Use it for both initial context window IDs and subsequent window advances, retaining UUID v7 allocation by default.

Make `AutoCompactWindow` accept caller-provided IDs instead of allocating them directly.

## Testing

Update the window boundary test to verify that advancing installs the supplied ID while preserving the first and previous window IDs.

GitOrigin-RevId: a9da4232fe6ab9a53b75e239cb412ceae0fe3216
2026-11-04 08:13:41 +00:00
Benjamin Carlsson 010520de76 Add managed thread prewarming to the cloud client (#59351)
## What changed

Add `Client::prewarm_default_thread` to prepare an ordinary coding thread in the default managed cloud environment, with optional model and provider selection. Return the thread identity and resolved settings as `ThreadActivation` without a separate activation RPC, preserving unknown thread protobuf fields.

Send prewarm requests once without automatic retries or cleanup, and document that a failed response can leave a prepared thread whose identity the caller did not receive.

## Testing

Add coverage for default and explicit model/provider requests, resolved settings and native thread metadata preservation, and rejection of responses missing sandbox policy.

GitOrigin-RevId: 425ee5ee6bb30ec77ebdd0079955701a7f9704e4
2026-11-04 08:01:23 +00:00
Benjamin Carlsson 3e743d1578 Add cloud thread activation with resolved settings (#59343)
## What changed

Add `Client::activate` to load a cloud thread through `UpdateConfig`, sending only the thread ID and `exclude_turns=true`. Return serializable resolved settings, thread metadata, and history cursors while leaving turns for separate pagination. Preserve the original thread protobuf, including unknown fields.

Validate required fields and thread identity, reject unsupported security policies, and redact sensitive activation data in debug output. Treat activation as a mutation that is never retried, with uncertain outcomes reported through `MutationError::OutcomeUnknown`.

## Testing

Add coverage for activation request encoding, settings and metadata preservation, serialization, compatibility defaults, unsupported policies, debug redaction, invalid input rejection, and explicit successful gRPC trailers.

GitOrigin-RevId: cd925b7a05f518d782e5b4cf188556567dad9e21
2026-11-04 07:26:51 +00:00
Benjamin Carlsson 93b4e5b4c6 Stop TUI voice calls when the OS session locks (#59330)
## What changed

- Monitor session lock state on Linux, macOS, and Windows, checking the initial state before starting audio.
- Abort local media on lock, including while connecting, retrying, or running a parked call, and display why voice stopped.
- Keep lock monitoring across startup retries and ignore stale lock notifications after a call restarts.
- Document lock behavior and platform limitations. After unlocking, users must run `/voice` to start a new call.

## Testing

Add lifecycle tests for already-locked startup, parked-call media shutdown, stale notifications, and locks during retry cleanup, plus a macOS test for password grace-period expiry.

GitOrigin-RevId: fea4b4a7903a48727c546ee3b7bd06e957a9b885
2026-11-04 06:15:53 +00:00
Ruslan Nigmatullin 19438adcb6 Introduce a dedicated context window ID type (#59328)
## What changed

Add `ContextWindowId` as a string-backed protocol type with UUIDv7 generation and parsing. Use it throughout compaction state, rollout reconstruction, token budget context, and request metadata in place of raw UUIDs, preserving the serialized string format and UUIDv7 validation.

GitOrigin-RevId: 786b74fcc331707ca5d6765f429b6e5e322d9328
2026-11-04 06:05:16 +00:00
Eric Traut 3a2788e6fc Restore background terminals from the displayed thread's live state (#59319)
## Why

Replaying a fork's inherited command history can make the TUI show background terminals belonging to its parent thread.

## What changed

Fetch the displayed thread's background terminals after history replay instead of treating replayed commands as live terminals. Read all pages, merge without duplicating tracked processes, and exclude terminals that exit while the request is pending. Clear terminal tracking and invalidate pending restoration when resetting thread state or stopping background terminals.

## Testing

Add a regression test verifying that `/ps` shows a resumed fork's own terminal, excludes inherited commands, and does not restore a terminal that exited during the list request.

GitOrigin-RevId: aca9ae9cde877f03143f8fbeea11affcc34dc372
2026-11-04 05:25:12 +00:00
Ruslan Nigmatullin d84c872464 Route response item IDs through a shared generator (#59312)
## What changed

Introduce `ItemIdGenerator` and pass the runtime-owned generator through sessions, model clients, history, hooks, tool outputs, and memory requests. Keep UUIDv7 generation as the default and replace direct calls to `ResponseItemId::new` with the shared callable.

Preserve existing item IDs and backfill missing or empty IDs through the same generator, including forked history before reconstruction and persistence.

## Testing

Extend coverage for UUIDv7 IDs on user messages, agent messages, and additional tools, and assert that forked model context matches the backfilled items persisted to history.

GitOrigin-RevId: 0dd9ccf0f46f0f1005a6acfc740133b03ce82259
2026-11-04 04:02:00 +00:00
Sean Huang f2b94ef8b5 Switch rusty_v8 to the openai-oss-forks repository (#59299)
## What changed

Update the `v8` Cargo patch and Bazel archive to use `openai-oss-forks/rusty_v8` with a new pinned revision. Refresh both lockfiles, the archive checksum, and the allowed Git source in `codex-rs/deny.toml`.

GitOrigin-RevId: 76cdc8583804e22169275422e2580baffaa1a948
2026-11-04 02:40:55 +00:00
Anthony Tafoya 75aba6768a Add outcome metrics for skill reads and installation listings (#59295)
## What changed

- Record `codex.skills.read.result` and `codex.skills.installations.result` counters with bounded outcome labels for successes and failures.
- Tag both counters with `discovery_version` and installation listings with `source_filter`.
- Make session telemetry available through the step store so skill tools emit metrics with the current step's model metadata.

## Testing

Add coverage for read metrics in both discovery versions, installation listing outcomes and source filters, and extension metrics retaining the current model metadata after a model switch.

GitOrigin-RevId: 0b5418e2b94a89149a20877f32ca2b2e196884e7
2026-11-04 02:29:41 +00:00