Commit Graph
14433 Commits
Author SHA1 Message Date
Dylan Hurd 187affbce3 Wait for the Command Center grouping header in the startup test (#65004)
## Why

Startup can send a `thread/list` request while the loading screen is still
visible. Reading the terminal buffer at that point can make the saved
grouping test fail before the Command Center header has rendered.

## What changed

Capture completed terminal frames through a test-only channel. Have
`agents_overview_startup_restores_saved_grouping` wait for the grouping
header and verify that it shows `Group: Status`, the saved preference.

GitOrigin-RevId: e4479039e0663483016637be0fe5bfff62f27044
2026-12-01 14:58:43 +00:00
jif 33aab1f2c6 Always track retained command sessions in world state (#64993)
## What changed

Track retained command sessions on every turn and mark
`command_sessions_world_state` as a removed compatibility flag. When
`write_stdin` is unavailable, keep reporting retained sessions and indicate
that they cannot be polled.

Omit the command session section when there are no sessions and no prior
section. Still emit an empty update when needed to clear stale handles.

## Testing

Update the Code Mode scenario to exercise retained command session tracking
without enabling the flag. Its snapshot omits the empty section before any
commands are retained.

GitOrigin-RevId: fd953750b06f0098ae6382ce3d3115a1263fd305
2026-12-01 13:42:02 +00:00
jif 9a8b299471 Fix relative TMPDIR resolution in the Linux filesystem sandbox (#64976)
## Why

When `TMPDIR` is relative, `environment/info` resolves it against the
executor's working directory. The filesystem helper starts at the
filesystem root, so its `:tmpdir` rules could apply to a different directory.

## What changed

Use the executor's resolved temporary directory when binding `:tmpdir`
rules. Reject requests whose supplied temporary directories no longer
match the executor, and preserve the helper's original `TMPDIR` for
scratch files.

## Testing

Add a Linux integration test covering `:tmpdir` read grants and denials,
rejection of stale temporary directory information after the executor's
working directory moves, and a write without a `:tmpdir` rule.

GitOrigin-RevId: 6772c17251500dae3f6b0a2b17ee95955289e89b
2026-12-01 11:34:33 +00:00
jif 51957a2da5 Handle Stop after multiple command approval declines (#64960)
## Why

The desktop client declines all open command approval prompts before
sending Stop. If the first decline is still being recorded in history,
a second queued decline can keep Stop from reaching the active turn.

## What changed

Queue consecutive declines for the same active turn and record them in
submission order. If Stop follows, interrupt the turn while the declines
are still being recorded, then finish recording them before publishing
the turn-aborted event.

## Testing

Extend the interruption regression test to cover two declined prompts
followed by Stop. It checks that the running sibling command stops while
history is blocked, both commands are recorded as declined before the
turn-aborted event, and completed sibling output is preserved.

GitOrigin-RevId: 00ac946378cc5fcf6c77e4a657aaa64508d60421
2026-12-01 09:44:12 +00:00
viyatb-oai 494c43b0c5 Bind JWT bearer grants to HTTPS proxy hooks (#64942)
## Why

A sandboxed client needs to authenticate to an allowed HTTPS endpoint
without receiving the upstream JWT.

## What changed

Let an HTTPS proxy hook exchange a guest bearer alias for a JWT scoped to
the requesting environment and exact resource path. Recheck the hook
policy and grant after establishing upstream TLS, then attach the JWT to
the outgoing request.

## Testing

Add tests for rejecting ambiguous rules and unsafe paths, preserving
ordinary header stripping outside the bound path, and rejecting an alias
after its grant is dropped.

GitOrigin-RevId: 41837b45abcbe97b4dd73c65964d59c661879b46
2026-12-01 07:07:36 +00:00
Alex Daley a54018ff36 Expose TypeScript signatures in Code Mode's ALL_TOOLS (#64939)
## Why

Code Mode embeds TypeScript declarations in tool descriptions, so scripts
that want to inspect a tool's argument and return types have to extract
the declaration from the description.

## What changed

Enable `features.code_mode_all_tools_schema` to expose callable names,
descriptions, and TypeScript signatures as separate fields in `ALL_TOOLS`.
Update the `exec` guidance to match the selected format, including when
resuming a session. The flag is off by default.

Carry signatures over gRPC and stdio. Reject execution requests with
signatures when the host does not advertise support for them.

## Testing

Add coverage for both catalog formats, `exec` guidance on resume, and
signature preservation over gRPC and stdio.

GitOrigin-RevId: dedaeec4a2563c23d432c324187ef20f6a0e5ea3
2026-12-01 06:54:13 +00:00
akak-oai 936ac6dbe6 Add critical-path snapshots for turn milestones (#64935)
## Why

The completed turn profile describes the whole turn. A host measuring latency
to an intermediate event needs the elapsed time and critical path at that event.

## What changed

Expose `turn_milestones` through `codex-core-api` and bind host-provided watches
when a regular turn starts. Add helpers to match published assistant text to
the sampled response and capture a one-shot observation with its source,
elapsed time, and critical path at the cutoff.

## Testing

Add tests that verify a cutoff during a second sampling round includes earlier
sampling and joined tool work, stale or cancelled candidates leave the watch
available, and elapsed time is recorded even when critical-path capture is
disabled.

GitOrigin-RevId: 507b7aaf8819b5cedf608ea66807c632bcb59c82
2026-12-01 06:25:16 +00:00
Benjamin Carlsson 1ba4c7b4fb Recover Cloud sessions with paginated TUI history (#64932)
## Why

A Cloud session can have more history than the TUI scans on reconnect.
Requiring the full transcript prevents recovery even when the recent
history is enough to verify where the session left off.

## What changed

Allow recovery from a bounded history window in owned transcript mode
when it confirms the required turns and updates. Preserve completed
local history outside that window and keep older history pageable
without rendering prompts or replies twice.

Bound turn metadata lookups, including across turns without items.
Sample partial history again before restoring queued question answers
so a response from another client has another chance to appear.

## Testing

Extend reconnect tests to cover partial and overlapping history,
missing live updates, duplicate-free pagination, bounded metadata
lookups, and queued question answers.

GitOrigin-RevId: 2f12d64dc83a6e7e42ee3923baaea40ca7f663ab
2026-12-01 05:32:15 +00:00
Benjamin Carlsson 0ee8daa550 Discover local and cloud tasks together in the agents overview (#64930)
## Why

The agents overview could miss cloud tasks when opened from a local
session, even when the cloud backend was already connected.

## What changed

- Refresh tasks from connected backends when opening the overview, and
  have **Show more** fetch additional pages from each backend that has
  more results.
- Preserve pagination progress across refreshes when it still applies,
  and keep refresh errors visible until the affected backend recovers.

## Testing

Add coverage for discovering and paging through cloud tasks from a local
session, reopening the overview with pagination progress intact, and
refreshing after lifecycle events from a background backend. Add a
snapshot of the mixed local and cloud overview.

GitOrigin-RevId: 11d3108dbbd8c7033cd8fe43cfd045fb3eacccd4
2026-12-01 05:20:42 +00:00
pakrym-oai 2c2a945de2 Record why Responses WebSockets fall back to HTTP (#64923)
## Why

The fallback counter identifies the original transport but gives no indication
of what triggered the switch to HTTP.

## What changed

Include the triggering Codex error kind and HTTP status, when available, in
the fallback warning and the `codex.transport.fallback_to_http` counter.
The counter uses `none` when the error has no HTTP status.

## Testing

Integration tests assert a single counter increment with the expected tags for
HTTP 426 during connection setup, HTTP 403 after retries, server overload, and
oversized WebSocket messages.

GitOrigin-RevId: 6f8b9d5049da1563e035fff62473c85693f0ad1b
2026-12-01 04:47:08 +00:00
akak-oai 410b21c003 Add a crate for one-shot turn milestone watches (#64920)
## What changed

Add `codex-turn-milestones` to the Cargo and Bazel builds. A single turn
can take each registration, which can watch published assistant text
and direct Apps tool starts independently. Callers match text candidates
or resolved resource URIs and can claim each watch once.

The API lets callers match outside the timing lock, claim the watch while
capturing the timing snapshot, and deliver the owned observation after
releasing the lock. Observations include the thread, turn, and source
identities, elapsed time, and a caller-supplied critical-path snapshot.

## Testing

Unit tests cover single-turn ownership and verify that two concurrent
matching tool starts yield one successful claim while leaving the
assistant-text watch available.

GitOrigin-RevId: c42c032f320752a5963eb6b0ea2aa4a2c85a2342
2026-12-01 04:20:28 +00:00
Tom c1eee51321 Trace capability discovery and cloud catalog refresh (#64917)
## What changed

Add tracing spans for per-step plugin selection, host skill discovery,
and V2 capability-root snapshots. The snapshot span records whether
skill discovery was requested.

Trace cloud catalog refresh and discovery, and time the step's wait
for the catalog lock separately from preparation under the lock.

GitOrigin-RevId: 12eeb6333a8d2b335e92112dc7dccae6e7ed266d
2026-12-01 04:09:45 +00:00
Anthony Tafoya 976c0fbbfc Stabilize span assertions in spawn publication tests (#64915)
## Why

SQLite workers can retain spans after acknowledging a write, so reading
the exporter immediately can miss spans. A paginated history reader can
also keep the fork span open after history preparation returns.

## What changed

Collect exported spans until the tracer is released, with a bounded
timeout. Cover failed spawn publication cleanup with both paginated and
in-memory history against the SQLite graph store. Check that fork
preparation starts before or at the graph upsert in the paginated case,
and that its span ends before or at the upsert's start in the in-memory
case.

GitOrigin-RevId: 2438ed49bc6c6d6c74c2695c9397a39dacc1dee2
2026-12-01 04:08:34 +00:00
Won Park 092fc09d9a Use the current MCP runtime context for skill dependency OAuth (#64899)
## Why

OAuth discovery for newly installed skill dependencies needs an HTTP
client for each added server. Building the full runtime MCP configuration
does extra work because the installer already has those server configs.

## What changed

Use `current_mcp_runtime_context` to resolve the HTTP clients for the
added servers.

GitOrigin-RevId: 4970954dd5f1ed21a02dfe7f6c3a9f1df4fe7026
2026-12-01 03:06:11 +00:00
Won Park bbfa676153 Enable unified exec process tests on non-Unix platforms (#64894)
GitOrigin-RevId: 86243d7100f9bf269924c81cdaf9593db03166dc
2026-12-01 02:57:20 +00:00
caseysilver-oai 3fe546357c Reject colon-containing plugin archive paths on Windows (#64893)
## Why

A nested drive prefix in a tar entry can redirect extraction outside
the plugin bundle staging directory on Windows.

## What changed

Reject tar entries with a colon in any path component on Windows.

## Testing

Add a Windows-only regression test for nested drive prefixes with
both forward slashes and backslashes.

GitOrigin-RevId: b19b3d0de16ffe73726981f823a8f4db6629ad22
2026-12-01 02:56:43 +00:00
Joe Savona 333bcaa7ff Preserve line breaks in plugin detail descriptions (#64891)
## Why

The plugin detail popup passes the entire description as a single line,
so it loses the author's line breaks.

## What changed

Render each nonblank description line separately and keep dim styling and
terminal-width wrapping. Skip blank and whitespace-only lines so extra
spacing in the description cannot inflate the popup header.

## Testing

Add snapshots at 40 and 100 columns and regression tests for LF and CRLF
line endings, whitespace-only lines, literal Markdown, Unicode, and
description fallbacks. Cover navigation to the install action with a long
description in a short viewport and verify that the plugin picker stays
closed when plugins are disabled.

GitOrigin-RevId: e2f988d6e9b743a4fe318bed8e56563f495da605
2026-12-01 02:54:25 +00:00
Felipe Coury 01cb497492 Size the transcript layout cache to the viewport (#64882)
## Why

On tall terminals, painting the transcript and measuring the preceding
screenful for pagination can exceed the fixed 64-entry cache. Hidden
reasoning entries in compact mode also take up cache slots, which can
force visible text to be laid out again on the next frame.

## What changed

Set the entry limit to twice the viewport height plus two, clamped to
64–512 entries, and trim the cache when the viewport shrinks. Keep the
existing byte budget and skip caching hidden reasoning in compact mode.

## Testing

Cover eviction after shrinking the viewport and verify that repeated
frames reuse visible layouts in an 88-row viewport with partial history
and 100 hidden reasoning entries.

GitOrigin-RevId: 194f39e3ad1eb72a223481c600e95463a5674fc4
2026-12-01 02:41:35 +00:00
Owen Lin 8c04e2529c Support prepared creation of persisted threads (#64839)
## Why

Thread stores can do work before Core starts, but the ordinary creation
API has no way to pass that state back to the store when it creates the
thread.

## What changed

Pass optional, single-use `ThreadStoreCreatePreparation` from
`StartThreadOptions` to `ThreadStore::create_thread_with_preparation`
when creating a persisted thread, including a fork. Reject creation
preparation for ephemeral or resumed threads. Stores that do not implement
the prepared creation method return an unsupported-operation error.

## Testing

Add a regression test that supplies creation preparation to a prepared
fork and checks that it reaches the prepared creation method by asserting
the default unsupported-operation error.

GitOrigin-RevId: bc4d3e9e5d89dd7503aed75423bc9c9d42c7f7fc
2026-12-01 00:40:48 +00:00
goodman-oai 83545f3514 Allow model catalogs to omit writable-root sentences (#64837)
## Why

The environment context already lists writable paths. An empty catalog
template previously fell back to the bundled writable-root sentence,
so a model catalog had no way to omit that repeated list.

## What changed

Treat an empty `writable_root` or `writable_roots` template as a request
to omit the corresponding sentence. Missing, null, invalid nonempty,
and oversized templates still use the bundled wording.

Suppressed roots leave the full path budget available for denied-read
paths and globs and never trigger an omitted-path warning on their own.

## Testing

Cover empty singular and plural templates and verify that suppressed
roots leave room for denied-read entries. A model-switch scenario checks
that Codex appends the updated permissions message once and preserves
the earlier conversation, filesystem permissions, and approval settings.

GitOrigin-RevId: 105819fb07ff829be8f111b3676656373aeb7892
2026-12-01 00:29:20 +00:00
felixxia-oai 404eb8b39a Track whether Guardian v3 shadow verdicts are ready by v2 (#64836)
## What changed

Add the `v3_ready` tag to the `codex.guardian_v3.shadow.pair` counter so
paired verdicts can be grouped by whether the v3 shadow verdict was
validated at or before the live v2 verdict.

## Testing

Extend the shadow comparison test to check the tag when v3 validates
before, at the same time as, and after v2.

GitOrigin-RevId: dffc58458d8eb6e7f6062ebc5eb8ccea36edb9f7
2026-12-01 00:28:39 +00:00
viyatb-oai 6aa4504d66 Add refreshable JWT bearer grants for network proxy tests (#64834)
## Why

A guest needs a stable JWT alias even when the upstream bearer expires
or is invalidated. A disconnect during refresh can leave a rotating
credential already spent, so concurrent and subsequent requests need
to share the in-flight exchange.

## What changed

Add `JwtBearerGrant` behind `#[cfg(test)]`. It exposes a decodable alias
with explicitly selected scalar claims, reuses current bearers, and
refreshes on demand. A refreshed token must preserve the grant's
identity and disclosed claims.

Invalidation makes previously resolved bearers unusable. Revocation
also blocks future refreshes, and a failed or ambiguous refresh
permanently revokes the grant.

## Testing

Cover shared refreshes, request cancellation, invalidation and
revocation during refresh, timeouts, and claim consistency across
token rotation.

GitOrigin-RevId: 67cdf18e5aafa9dbc7290a2ef8ba62da84f826c5
2026-12-01 00:28:01 +00:00
jif 51bcfc3768 Fix cleanup when unified exec startup is canceled (#64833)
## Why

Canceling a remote command during the early-exit grace period could
drop the process before handoff and run ordinary termination. That
bypasses the exec server's startup cleanup, which also disables
recovery for the abandoned session.

## What changed

Track whether each process has been handed off or abandoned. Dropping
a live process before handoff abandons startup once. Processes handed
off to the process store or to a one-shot caller retain normal
termination on drop.

## Testing

Add regression tests for cancellation during the early-exit grace
period, dropping an explicitly abandoned process, and normal cleanup
after registration or one-shot handoff.

GitOrigin-RevId: 2276ba15e50a2345da21e7841ab9015b572786ac
2026-12-01 00:26:27 +00:00
jif 6dab58d9f7 Preserve read-only permissions across repeated thread resumes (#64829)
## Why

A cold resume can save a read-only profile with concrete read paths
derived from the current configuration. On the next cold resume, those
paths make the saved profile ineligible for direct reuse, so the thread
can fall back to a writable default.

## What changed

When restoring a saved read-only profile with restricted network access
that cannot be reused directly, rebuild its read grants from the current
configuration while keeping writes disabled and network access
restricted. Preserve read denials from both the saved profile and the
current configuration. For deny globs, use the larger scan depth when
both contributing policies are bounded and keep the scan unbounded if
either contributing policy is unbounded.

## Testing

Cover two consecutive cold resumes under a scoped writable default, and
test that restoration respects the current read allowlist, preserves
saved path and glob denials, merges glob scan depths, and drops the
configured network proxy.

GitOrigin-RevId: 04c91804e83d396402e1c8a985e4c3ff006f7e91
2026-11-30 23:48:15 +00:00
Charlie Marsh b0b5cfcab8 Connect plugin MCP servers over launcher-provided Unix sockets (#64828)
## Why

A launcher that already hosts an MCP server needs a way for Codex to
use it without starting a separate subprocess for the plugin.

## What changed

The stdio app server accepts socket bindings from its immediate parent
on Unix. A binding applies to a local plugin's stdio MCP server only
when the plugin ID, server name, and binding ID match a single entry.
Codex uses the stdio wire protocol over the socket and retains the
original declaration for policy checks.

Before sending MCP traffic, Codex requires a user-owned socket
directory with mode `0700` and verifies the listener's PID and UID.

## Testing

Add tests for binding scope and ambiguous matches, and for rejecting
unexpected listener PIDs, insecure directory permissions, symlinked
socket directories, and relative socket paths.

GitOrigin-RevId: 3d669dd59a0812b04727e4a1e458774007f054ba
2026-11-30 23:34:32 +00:00
Brent Traut 515cfeceba Skip host skill discovery in the remote command approval test (#64827)
## Why

An empty extension registry falls back to legacy host skill discovery
even when `SkipHostSkillDiscovery` is enabled. The remote command
approval test only needs to check plugin attribution when script reads
are denied.

## What changed

Enable `SkipHostSkillDiscovery` and register the skills extension with
no providers in both variants of
`remote_command_approval_skips_attribution_for_a_read_denied_script`.

GitOrigin-RevId: 1abcf6a762ac359825fe1c4db97160b9bfde0f87
2026-11-30 23:33:54 +00:00
viyatb-oai 2c13cb27f5 Add test-only JWT claim disclosure for network proxy aliases (#64826)
## Why

A guest alias needs to expose only the claims selected by policy. Refresh
also needs a way to detect changes to claims the guest never sees.

## What changed

Add a test-only helper that reads expiry from a trusted source JWT and
builds fresh JWT-shaped aliases containing only selected scalar claims.
Each alias uses a random placeholder in the signature segment.

Hash all stable claims, including undisclosed ones, in deterministic JSON
order. Exclude `exp`, `nbf`, `iat`, and `jti` so changes to those fields
during refresh preserve the digest.

## Testing

Cover selective disclosure, alias freshness, and refresh comparisons.
Exercise rejection of malformed tokens, duplicate keys, invalid validity
fields, ambiguous numbers, and disallowed disclosures.

GitOrigin-RevId: 48bc19ac57601e28d5c2cb8881f0ac0f5563aca9
2026-11-30 23:21:06 +00:00
ioanbudea-OAI 6b599f7a8e Use then_some for Notes metadata in the multi-environment MCP test (#64823)
GitOrigin-RevId: 8fab548c5c06ec5b0f005872f0b98d6c2d93fcbd
2026-11-30 22:53:09 +00:00
Eric Traut 3496c2f99c Prompt before replacing an existing transcript export (#64822)
## Why

When a filename is already taken, saving a conversation with `/export` ends
with an error. Users have to restart the export to choose a different name.

## What changed

Show a conflict picker with options to choose another name, replace the
existing file, or cancel. Choosing another name pre-fills an editable
numbered filename, such as `notes-3.md` when `notes.md` and `notes-2.md`
already exist.

Offer replacement only for regular files. After confirmation, check the
directory and file identities and use an atomic rename to install the new
transcript.

## Testing

Cover the picker actions and numbered filename suggestion, verify that
replacement requires confirmation, and check that replacement rejects a
changed file or redirected directory.

GitOrigin-RevId: edcb2fad858bab15a7228c69bd27a8ffd18e8d05
2026-11-30 22:40:58 +00:00
Eric Traut debcc79621 Use destination app-server defaults for new TUI sessions (#64821)
## Why

A fresh session could send client-side execution settings as thread
overrides, even when the destination app server had its own defaults.
The TUI also needs the destination settings when preparing the first turn.

## What changed

Use the destination defaults to prepare the first turn for session
replacement, starts from the agents overview, and backend switches.
Keep explicit launch choices and managed new-thread defaults in the
start request, and let the server resolve its own model and reasoning
effort. When `config/read` is unavailable, omit implicit execution
overrides and avoid replacing server instructions with terminal
visualization text alone.

## Testing

Extend session replacement tests to check the start request and first
turn, including shadowed launch settings, server instructions with
terminal visualization enabled, and compatibility with older servers.

GitOrigin-RevId: d66d6d51495ee067282514a138f7e39abfd91f2f
2026-11-30 22:39:43 +00:00
Eric Traut 5eb0253e6f Preserve service tier intent when starting, resuming, and forking (#64820)
## Why

A TUI resume request could override a thread's saved service tier with a
configured tier, a model default, or the local Fast default opt-out.
CLI forks could also send a tier before the destination's settings were
resolved.

## What changed

- Send a tier on resume or CLI fork only when the invocation supplies a
  tier override. In-app forks carry the current session's tier.
- On fresh startup, use the invocation's tier choice first, then the
  managed default, then the startup configuration. Keep an explicit
  reset (`serviceTier: null`) distinct from omitting the field.
- Use the current local Fast default opt-out when resolving tiers for
  new sessions and honor feature gating for launch overrides.

## Testing

Extend request assertions to cover tier omission on resume and CLI fork,
`flex` on in-app fork, and both explicit reset and disabled Fast mode on
fresh startup.

GitOrigin-RevId: d74f0f5e98506a0d5a6ead7106e1042691d41d41
2026-11-30 22:25:03 +00:00
Eric Traut 4e6aae20fa Keep TUI launch model overrides independent (#64819)
## Why

Resuming with only a model or reasoning-effort override could also
send the other value from the TUI's resolved config, overriding saved
thread settings. Startup forks could similarly carry an unrelated
default into the destination.

## What changed

Build thread requests from explicit launch overrides. Resolve model
and reasoning effort independently from invocation options and the
selected profile, honoring config precedence. On resume, omit unset
fields so the app server can restore saved values. On startup fork,
let the destination config supply unset fields.

Carry accepted model migrations into resume requests and apply managed
new-thread model defaults on fresh starts without a launch model or
effort choice.

## Testing

Extend resume coverage for model-only and effort-only requests and for
a launch effort shadowed by higher-priority managed config.

GitOrigin-RevId: 5190d9b820a36c4da6a179fbdbca27591b1e8541
2026-11-30 22:08:33 +00:00
Joe Savona 1843a4df93 Expand the bundled MCP statusline authoring guide (#64814)
## Why

An unsupported UI tag or property invalidates the entire statusline
response, so providers need a fallback for clients whose rendering
capabilities are unknown.

## What changed

- Document the available UI elements with examples for wrapping rows,
  spacing fields, preserving whitespace, and displaying status badges.
- Explain how to use `app.cli_version` to check support for features such
  as `spacer` and `maxLines`, and return a plain string for the entire
  footer when support is unknown or absent. Carry the `spacer` guidance
  into the generated TypeScript reference.
- Clarify how to diagnose provider discovery failures with F2 and check
  `tools/list` metadata when a provider is missing from the picker.

## Testing

Update the scenario snapshot that verifies an explicit statusline skill
mention loads the bundled guide.

GitOrigin-RevId: 9c6ea1d356146c2d666359732d6a065ed41d9fee
2026-11-30 21:44:01 +00:00
felixxia-oai 02a15f1244 Cancel Guardian V3 shadow reviews on interruption (#64813)
## Why

A Guardian V3 shadow review could keep running after its live review or
owning turn was interrupted, leaving the reviewer slot occupied.

## What changed

- Cancel the shadow when a pending live review is cancelled or dropped,
  and let the live review finish its cleanup on cancellation.
- Cancel in-flight shadows when their owning turn is aborted, even if
  the live verdict is already available, and prevent new shadows for
  that turn. On normal turn completion, shadows can finish independently.

## Testing

Cover tool cancellation during live-review cleanup and turn interruption
both during review and after approval. The app-server test also checks
that a later turn can start a shadow and complete while it is still
running.

GitOrigin-RevId: 45df0575853d5f8ca7ef7282fcd0fa1f22fed6c5
2026-11-30 21:35:13 +00:00
felixxia-oai fd36cdebbe Extract Guardian review evaluation from approval handling (#64812)
## What changed

Move review preparation, retries, and cached approval handling into
`ReviewRequest::evaluate`. Return the outcome, report, analytics, and
evidence to the synchronous reviewer so it can finish reporting and
produce the approval decision.

GitOrigin-RevId: 3db2b9dadd6c6f15f0e66995f26705ca5c29e6a3
2026-11-30 21:34:37 +00:00
ioanbudea-OAI 7d60863a4a Include direct MCP screenshots in synchronous Guardian reviews (#64811)
## Why

Synchronous Guardian reviews could receive screenshots from Code Mode calls,
but missed screenshots returned by direct calls to the same REPL connectors.

## What changed

Capture screenshots from accepted direct `node_repl` and `cua_repl` MCP
results when multimodal review evidence is enabled. Include them alongside
Code Mode evidence in call order, with separate retention budgets.

When the synchronous review prompt exceeds its fixed image budget, retry with
only the last image in prompt order and keep it if the prompt fits.

## Testing

Add coverage for screenshot delivery to synchronous permission reviews,
including text-only mode and image budget overflow. Verify that direct
screenshots preserve call order and do not consume the Code Mode retention
budget.

GitOrigin-RevId: e74ee6c5578225efb284c1ca38494377a1d0762e
2026-11-30 21:34:02 +00:00
Aismit 1108cbcbef Require fresh Guardian review after tool input rewrites (#64810)
## Why

A `PreToolUse` hook can change a tool's arguments while keeping its call
ID. An asynchronous risk score for that ID still describes the original
action, even if the score arrives after the rewrite.

## What changed

Require synchronous Guardian review when a hook changes the tool payload
and discard the original assessment. Preserve normal review behavior
when the hook returns an identical payload. Also require synchronous
review for MCP elicitations without an associated tool approval context.

## Testing

Add regression coverage for unchanged hook output, rewritten patches
whose original scores arrive before the rewrite or during review, and
MCP elicitations with missing approval context or rewritten inputs.

GitOrigin-RevId: 994519d61d52c69edcdec9517766a8e3051587d5
2026-11-30 21:32:28 +00:00
Felipe Coury 8fe2646705 Enable mouse-wheel scrolling in the Agent command center (#64808)
## Why

The mouse wheel scrolls the help view, but browsing a long task list
requires keyboard navigation. Once the list can scroll independently of
the selection, task shortcuts need to account for an offscreen target.

## What changed

Scroll the task list without moving the selection, and keep task titles
reachable in short viewports. When the selection is offscreen, show a
reveal hint and make the first task shortcut bring the selection back
into view. Keyboard navigation resumes following the selection.

Suppress repeats from the key that revealed the task so holding a
shortcut such as Stop cannot immediately act on it. On Windows, peek at
queued console input to account for press/release pairs emitted by
legacy ConPTY input.

## Testing

Cover wheel paging and short viewports with a rendering snapshot, test
that Stop requires a fresh press after revealing a hidden selection,
and verify that the Windows release probe leaves queued input intact.

GitOrigin-RevId: ebd7c0993978de3fc07245adf930f9fc63b306c1
2026-11-30 21:19:57 +00:00
Felipe Coury 8860825f86 Make agent center help scrollable and status tabs clickable (#64807)
## Why

Short terminals can cut off agent center shortcuts and require a resize to
read them. Status filter tabs and their overflow arrows are visible but
require keyboard navigation.

## What changed

- Scroll help with the configured list navigation keys or mouse wheel.
  Show a scroll hint when help extends beyond the viewport.
- Click a status tab to filter tasks, or click an overflow arrow to
  select the adjacent hidden tab. Overflow arrows also work in Analytics.
- Display `/` as the primary search shortcut and retain `F3` as a binding.

## Testing

Extend regression tests for help scrolling, task paging after resizing
in help, and mouse clicks on filter tabs and overflow arrows.

GitOrigin-RevId: b01b465626a681ca48a6e20547a24cf715a9a406
2026-11-30 21:02:08 +00:00
sayan-oai 829ddd4442 Honor the skill installation named in an explicit mention (#64805)
## Why

When a catalog entry groups multiple installations of a skill, a link to
a specific installation can load instructions from the primary
installation, such as the Cloud copy.

## What changed

Carry the matched installation through to the instruction read and
resource metadata. A path that uniquely identifies an enabled
installation takes precedence over name-only and ambiguous mentions of
the same skill, regardless of mention order. Default mentions still
use the primary installation, and distinct executor environments can
each be selected in the same turn.

## Testing

Extend the merged catalog test to cover a path shared by Cloud and
executor copies and a package link that selects the executor copy.
Update the installation recovery scenario to show that an explicit link
loads the selected environment's instructions into the initial request.

GitOrigin-RevId: f4495c5442b9f4c14d5cdcc4c717717e2119b088
2026-11-30 20:49:39 +00:00
Steve Coffey b26c32c843 Record model attribution in persisted token usage (#64804)
## Why

A model can change between steps of the same turn. Persisted token usage
records need the model for each response to distinguish usage before and
after the switch.

## What changed

Add an optional `model` field to `TokenUsageRecord`. Record the model
selected for the sampling step on both completed and incomplete responses.
Attribute compaction usage to the model selected at the start of the turn.
Existing records without the field still deserialize.

## Testing

Extend coverage to check persisted model attribution and cumulative token
totals after a mid-turn switch, including when the response hits the output
token limit. Verify that compaction keeps the turn-start model attribution
and continues restored usage totals.

GitOrigin-RevId: 3615724c1cbe6ed46c9367d6c3c1a29ebaba73d8
2026-11-30 20:29:59 +00:00
bkotsopoulos 89bc4351be Trace MCP runtime refresh contention (#64800)
## Why

MCP refresh traces show how long an operation waits for the refresh gate, but they lack the timing and operation labels needed to identify which refresh held it.

## What changed

- Tag refresh wait and hold spans with a shared gate ID and the operation name so overlapping spans show which operation held the gate while another waited.
- Carry the scheduling trace context into background MCP prewarm and add a span for the Apps catalog refresh.

## Testing

- Add a test that checks the exported wait and hold spans share a gate ID and overlap while a second operation waits for the permit.
- Make the worktree TUI test wait for the `Ready` run state before submitting input, since a directory change can appear while the composer is still busy.

GitOrigin-RevId: be2b6d2a82e4a5b553fb3f335850865f04a181ee
2026-11-30 20:09:18 +00:00
bkotsopoulos 9b64b43207 Record pre-sampling overhead in turn telemetry (#64799)
## What changed

Record `codex.turn.pre_sampling.duration_ms` when a sampling phase starts. Use the `is_first_sampling_request` label to distinguish overhead before the first request from overhead accumulated since the preceding request. The timing excludes tool blocking and compaction.

## Testing

Extend turn timing tests to verify the first-request duration, per-request overhead across subsequent requests, and the exclusion of tool blocking and compaction.

GitOrigin-RevId: 068be5cb4d1345dc064fa8f1df2469dfa0f3071f
2026-11-30 19:56:54 +00:00
Joe Savona e251a64500 Reject positional arrays for TUI tree elements and props (#64798)
## Why

Serde's derived decoders could accept positional arrays for values the UI
tree schema defines as objects. For example, row props could be written
as `[1, "red"]`, tying their meaning to the order of Rust fields.

## What changed

Require JSON objects for typed elements and their props while retaining
literal string nodes and child arrays. Pass object fields directly to
the derived decoders so duplicate and unknown fields are still rejected.

## Testing

Add regression cases for positional props, positional elements at the
root and inside children, and duplicate keys. Verify that named row
layout props round-trip through JSON.

GitOrigin-RevId: 81fbd048e8b7b1df6b453d97c9e16e8194a451a6
2026-11-30 19:39:47 +00:00
Felipe Coury da92371925 Use an in-memory clipboard in TUI tests (#64797)
## Why

TUI copy tests can verify the text sent to the clipboard and `PRIMARY`
without depending on the host clipboard or waiting for a background worker.

## What changed

Give each test TUI its own in-memory clipboard and `PRIMARY` selection.
Handle requests inline and expose completions through the normal worker
polling path.

## Testing

Assert copied text in transcript, sidebar preview, and turn tip tests.
Verify that a second TUI's copy leaves the first TUI's Markdown clipboard
text and plain-text `PRIMARY` selection available for paste.

GitOrigin-RevId: 159845b17f0dac26b4b12c3851c101afe8d21d2d
2026-11-30 19:37:56 +00:00
jif 069804e021 Reject mid-turn service tier overrides for hosted children (#64796)
## Why

Hosted children using a shared service tier already reject overrides
when a turn starts, but turn settings updates could still request a
different tier during an active turn.

## What changed

Apply the same rejection and error message to turn starts and active
turn settings updates for hosted children using a shared service tier.

## Testing

Extend the WebSocket regression test to verify that a mid-turn tier
override is rejected and the child still uses the root's updated tier
on its next step.

GitOrigin-RevId: 4fad6d02b56d81aba162f3e87b6dcaae2386d171
2026-11-30 19:23:46 +00:00
alexsong-oai 6324dcf85d Enable the Google Cloud Vertex AI setup wizard by default (#64795)
## What changed

Offer “Use Google Cloud Vertex AI” during eligible terminal onboarding
without requiring users to set `gcp_setup_wizard = true`.

## Testing

Use the feature default in the Google Cloud setup flow test and explicitly
disable the Google Cloud wizard in the gateway-only onboarding case.

GitOrigin-RevId: 098c3842623de13aa9c4852e188f225923c5c5d9
2026-11-30 19:22:33 +00:00
alexsong-oai 945cf1400b Enable the gateway setup wizard by default (#64791)
## What changed

Offer “Use a custom provider or gateway” in eligible terminal sign-in flows
without requiring users to set `features.gateway_setup_wizard = true`.

## Testing

Exercise the default in the gateway onboarding test, which verifies that the
selected gateway authenticates before receiving the first chat request.

GitOrigin-RevId: e140b13dc12ebe9b35f37711d5b088fd02a0707c
2026-11-30 19:07:18 +00:00
alexsong-oai 4c82954eb0 Select the Amazon Bedrock Runtime provider during TUI onboarding (#64790)
## Why

When the TUI omitted the provider ID, the app server defaulted to
`amazon-bedrock`. Bedrock onboarding needs to select `amazon-bedrock-runtime`
for the first thread.

## What changed

Pass `AmazonBedrockRuntime` explicitly when onboarding with an API key, an
AWS profile, environment credentials, or manually entered AWS credentials.

## Testing

Extend the daemon startup integration test to accept credentials detected in
the running daemon and verify that the first thread shows
`amazon-bedrock-runtime` in the status line. The test leaves the model unset
so the thread uses the selected provider's catalog.

GitOrigin-RevId: 57753a29c77b0bd1bcbb0494057770329cd0b67d
2026-11-30 19:06:01 +00:00
fahad-OAI dac56a1ca2 Remove special-case instructions from the web search tool (#64788)
## What changed

Remove the `web.run` instructions to check local code first and limit
browsing to official OpenAI sites for OpenAI product questions, to rely
only on primary sources for technical questions, and to explicitly flag
inferences from sources.

Update the thread sampling and web search scenario snapshots to reflect
the revised tool description.

GitOrigin-RevId: d35dcaaeb69940af5d7f9df19aba337fd0ab6426
2026-11-30 18:51:22 +00:00