Commit Graph
13125 Commits
Author SHA1 Message Date
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
Dmitriy Kovalenko 007f668c34 Respect turn filesystem permissions during executor skill discovery (#59291)
## Why

Direct executor skill discovery used unrestricted filesystem access, bypassing the turn's permission context. Cached catalogs also needed to account for changes in filesystem access within a turn.

## What changed

- Bind selected capability roots to callback-scoped filesystem access through `AccessedSelectedCapabilityRoot`.
- Pass accessors built with the turn's granted permissions into skill preparation and discovery, removing the executor skill provider's environment lookup and unrestricted accessor.
- Include filesystem access keys in the direct discovery cache so permission changes trigger rediscovery.

## Testing

Extend tests to verify that restricted discovery returns no skills when sandbox access is unavailable, restoring access restores discovery, and changing or restoring access invalidates the catalog cache.

GitOrigin-RevId: 0f7aa7646f65923f65f0cfc0b387d94bd7f2db05
2026-11-04 02:00:01 +00:00
Felipe Coury db3c44414c Add directional conversation focus shortcuts in workspace mode (#59287)
## What changed

- Add configurable `focus_pane_left` and `focus_pane_right` actions, defaulting to `leader left` / `leader h` and `leader right` / `leader l`.
- Move focus to the parent or open side conversation without reopening a hidden pane. Preserve the current interaction when no neighbor is available, and accept fresh typing after a no-op shortcut while suppressing reported key repeats.
- Expose the actions in the keymap picker and configuration schema, and prevent workspace-only pane bindings from claiming keys in classic mode.

## Testing

Add regression coverage for pane navigation, preserved transcript selection and search, fresh typing after a no-op, key capture, and binding conflicts and limits.

GitOrigin-RevId: 7f7629d15cffcd35d1353b36c5c9208dbb1034e8
2026-11-04 01:40:12 +00:00
Dmitriy Kovalenko 0a944f8ce2 Enable unified image budgeting by default (#59282)
## What changed

Mark `unified_image_budget` stable and enable it by default. Supported models now use unified image preparation with `original` detail, and `view_image` omits the `detail` parameter from its advertised schema.

## Testing

Update image input, MCP output, history replay, and tool schema expectations for the new default. Keep explicit coverage of the disabled feature and models that do not support original image detail.

GitOrigin-RevId: 2d6fc8019149fcf18b5813db2d2082ba95de2241
2026-11-04 01:24:36 +00:00
Dmitriy Kovalenko 0b21a5b526 Respect filesystem permissions when discovering repository skills (#59280)
## Why

Repository skill discovery must reflect current filesystem access, including newly approved grants and narrower permissions. Previously listed skills can remain in conversation history after a turn-scoped grant expires, so catalog updates need to tell the model when availability changes.

## What changed

- Discover repository skills through the selected executor's permission-aware filesystem accessor and refresh snapshots when the working directory or access changes. Use the current step's snapshot for skill selection and invocation.
- Preserve repository boundaries even when project markers are hidden by read restrictions, and report unsupported sandbox backends as skill-loading errors.
- Track grant-dependent catalog entries and emit availability notices when skills disappear or return, even when the metadata budget is exhausted.
- Resolve implicit skill paths through their owning filesystem and exclude remote repository skills from local implicit command attribution.

## Testing

Add coverage for turn and session grants, grant expiry and restoration, hidden and newly created repository markers, cached read denials on Windows, unsupported remote sandboxes, and executor-backed implicit skill paths.

GitOrigin-RevId: ac1af483e73e3130524aeeabe218630435054028
2026-11-04 01:15:38 +00:00
Dmitriy Kovalenko 526f6099f6 Preserve filesystem authority when loading skills (#59279)
## Why

Skill discovery and metadata loading used raw filesystem handles with unrestricted reads, and cache keys distinguished filesystems without accounting for captured permissions.

## What changed

- Pass borrowed `EnvironmentAccess` accessors through skill root resolution, discovery, canonicalization, and metadata reads.
- Include captured permissions in skill snapshot and empty remote root cache keys.
- Add fixed-path watches to `EnvironmentAccess`, falling back to live discovery when read restrictions prevent using unsandboxed executor watches.
- Keep user and plugin roots under host filesystem authority independently of the selected repository executor.

## Testing

Extend remote root cache coverage to verify that changing captured permissions triggers a fresh scan and that restricted accessors decline unsandboxed watches.

GitOrigin-RevId: 97d4bfdfcba78a93fc8845773c6397d4364494e3
2026-11-04 01:13:54 +00:00
Dmitriy Kovalenko afefd0ba95 Enforce current filesystem permissions when reading repository skills (#59278)
## Why

Cached repository skill metadata must not authorize reads after access is revoked or a skill file or directory becomes a symlink to a denied location.

## What changed

Read repository skill instructions through a current environment accessor for the filesystem that discovered them. Reject reads when no matching accessor is available, and cache filesystem identity instead of retaining unrestricted read access.

## Testing

Add regression coverage for revoked permissions, file and directory symlink replacements, and missing or mismatched filesystem accessors.

GitOrigin-RevId: 8dad83b7c7893e0d66e2fe1c0c240715db582005
2026-11-04 01:12:49 +00:00
cooper-oai f39e45e4a6 Support API workload identity authentication (#59275)
## Why

Workload identity authentication assumed every token exchange resolved to ChatGPT, preventing API service accounts from using the same flow.

## What changed

- Accept `wif_product: "api"` responses with organization, project, and service account metadata. Preserve ChatGPT compatibility when `wif_product` is omitted.
- Resolve API workload identity tokens as API key authentication and apply login restrictions to the resolved product. Read the actual login status during TUI startup instead of assuming ChatGPT.
- Preserve auth ownership across token renewal for the same API identity, and reject product or identity changes during refresh.
- Redact API keys from debug output.

## Testing

Add coverage for both exchange products, malformed metadata, assertion rotation and unauthorized recovery, identity changes, login and workspace restrictions, and CLI login status under both forced login methods.

GitOrigin-RevId: f4fc4da74b86e4a9ae47b28221d3e065500f5b6e
2026-11-04 00:52:58 +00:00
ioanbudea-OAI c141c31323 Preserve requested approval reviewers across policy overrides (#59272)
## Why

A model requirement can force `auto_review` even when the requested reviewer is `user`. Persisting or sending that effective value back as an explicit choice loses the original selection, so removing the requirement cannot restore it on resume.

## What changed

- Retain `requested_approvals_reviewer` separately from the effective reviewer in configuration and thread settings, with a fallback for older histories.
- Restore the requested reviewer on resume while applying current model requirements and reviewer allowlists.
- Let ordinary TUI turns, continuations, retries, and forks inherit the server's reviewer instead of echoing its effective value as an explicit request.
- Preserve a worker's requested reviewer when reloading it rather than inheriting the sender's selection.

## Testing

Extend resume coverage for explicit `auto_review`, removal of a model requirement, and a tightened reviewer allowlist. Update TUI assertions for omitted reviewer overrides and verify worker reload preserves its reviewer.

GitOrigin-RevId: d8c9c3a7b89e55e63f0e8ae210d6a87cb5547933
2026-11-04 00:31:24 +00:00
Hung 1685f2d621 Use measured durations to budget uploaded audio (#59268)
## Why

Uploaded audio always reserved 12,000 tokens per file, even for short clips. This could discard recordings during compaction that would fit within the retained-message budget.

## What changed

- Add optional audio duration metadata to attachments and cache measured durations per session, resolving metadata for new input and replayed history.
- Use measured durations for history estimates and compaction budgets at 10 tokens per second, rounded up and capped at 12,000 tokens. Keep the full budget for missing or unusable metadata.
- Bound metadata lookups to 250 milliseconds per batch with up to eight concurrent requests, and record accepted input before lookup so interruption preserves the batch.

## Testing

Add coverage for duration rounding and fallback estimates, mixed measured and unknown audio, retention through compaction and cold resume, and interruption during metadata lookup.

GitOrigin-RevId: 26fe320c7024944d9d4c371d5fdcda84442b5cc5
2026-11-04 00:19:12 +00:00
Dmitriy Kovalenko b34808060a Normalize loading bullets in the safety recourse snapshot test (#59263)
GitOrigin-RevId: 8c900fede2eb7eba58404e78b2d736a358c82ec8
2026-11-03 23:58:08 +00:00
taohong-oai db14d7508d Report auto-review overhead in turn critical-path analytics (#59260)
## What changed

Track Guardian compaction and review turn execution within each tool's auto-review interval, and expose `critical_path_auto_review_overhead_ms` in turn analytics. This measures the portion of `auto_review_ms` outside observed Guardian turn execution; it is a subset, not an additional duration.

Freeze review observations when the review or tool invocation ends. Report unknown overhead as `null`, including when denial reconsideration runs an unobserved follow-up turn.

## Testing

Add coverage for shared compaction and review observations, cached reviews, unfinished reviews, reused tool call IDs, and execution timing with child critical-path capture enabled or disabled. Extend analytics and app-server tests to check the new field.

GitOrigin-RevId: a63dec2a75571a3167c8c3f0c1d21e11e4a8d050
2026-11-03 23:49:01 +00:00
viyatb-oai 444359fa2d Refactor sandbox request preparation by backend (#59258)
## What changed

Build a `SandboxExecRequest` before applying backend-specific command wrapping. Extract Linux wrapping into `wrap_linux` and route Windows restricted-token requests through `prepare_legacy_windows_request`. Return unsandboxed requests before preparing native sandbox paths.

GitOrigin-RevId: afe3bcb444c222e9e0af9a556fe580eee074e34c
2026-11-03 23:37:58 +00:00
Eric Traut b59f2e27a0 Preserve prompt contrast when terminal colors are unavailable (#59257)
## Why

Submitted prompts need readable foreground and background colors when the terminal does not report its default colors.

## What changed

- Use a contrasting gray pair for truecolor and 256-color terminals when default colors are unavailable. Keep terminal defaults for 16-color terminals and unknown color support.
- Preserve voice markers, inline element accents, and asynchronous reply code colors when applying prompt styles to native history.

## Testing

Add contrast coverage for each color level and terminal rendering regressions for inline elements and asynchronous reply code colors. Update prompt snapshots to cover the fallback colors.

GitOrigin-RevId: dcda0fc3e2b12a5dc9046322a4d82c61986e3ecd
2026-11-03 23:36:55 +00:00
Eric Traut d582332d03 Add OSC 777 notifications and improve approval notification text (#59256)
## What changed

- Support `tui.notification_method = "osc777"` with a `Codex` title and tmux passthrough.
- Replace control characters in OSC notification bodies and escape semicolon delimiters for OSC 777. Limit Ghostty bodies to 255 bytes, preserving UTF-8 boundaries and adding an ellipsis when truncated.
- Remove the 30-grapheme command limit from approval notifications, strip shell wrappers, and describe terminal input and network access requests explicitly.

## Testing

Add coverage for notification method selection, OSC 777 output with and without tmux, control character handling, Ghostty truncation, and approval notification text.

GitOrigin-RevId: e15fa7fdb007c38a148217f6aa0bbcc5e7371f9e
2026-11-03 23:36:34 +00:00