Commit Graph
13205 Commits
Author SHA1 Message Date
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
jif 89a5bb31f4 Keep hosted agent corrections behind pending follow-up tasks (#64785)
## Why

An injected `send_message` correction could reach a hosted worker before
the `followup_task` it refers to because turn-local input drains before
the mailbox. An interrupt during a history checkpoint could also drop
corrections from a batch that had already left the queue.

## What changed

Queue plain-text agent messages behind pending follow-up tasks and
deliver them in mailbox order, even across turn boundaries. Record
accepted follow-ups and corrections before waiting on their checkpoint,
and save deferred injections to session history on shutdown.

## Testing

Add regression coverage for native and hosted delivery order, hosted
corrections sent between turns, interruption during a checkpoint, and
correction persistence across shutdown and resume.

GitOrigin-RevId: 3acffd175d3bb2d7e1a9f704fe6c6d6ce38e798d
2026-11-30 18:37:59 +00:00
felixxia-oai 10a8d4ff15 Retire Guardian V3 shadow boards when intake stops (#64784)
## Why

An intake failure blocked new shadow reviews but let in-flight reviews
continue after the board stopped receiving thread history. Loaded child
threads could also retain references to the stopped board.

## What changed

Cancel in-flight shadow reviews and release board resources in the
background when intake stops. Keep completed verdicts in the comparison
with Guardian V2 and count eligible reviews skipped because intake
stopped across the root and its child threads. Allow a fresh board when
shadow enrollment is turned off and back on.

## Testing

Cover cancellation while a shadow response is still pending, board
cleanup while child threads remain loaded, and retirement waiting for
a finishing review to release its slot.

GitOrigin-RevId: a95bf5527ef3251d37207d07d76430f6557cd420
2026-11-30 18:29:43 +00:00
felixxia-oai 6984bcc0c2 Measure Guardian v3 shadow review outcomes and latency (#64783)
## Why

Comparing the live v2 reviewer with the v3 shadow reviewer requires
measuring both on the same action. A live retry can pick up new context,
which can affect how a verdict disagreement is interpreted.

## What changed

Record outcomes for each reviewer and emit paired outcomes and timings
when both return validated verdicts. Measure from a shared start to each
verdict's validation and tag the pair when the live review's context
changed.

Track shadow skips when the reviewer is busy or intake has stopped, and
exclude shadow denial retries from live reconsideration metrics.

## Testing

Add a metrics test that checks exactly-once reporting for completed,
failed, and cancelled samples and verifies pair emission for two
validated verdicts.

GitOrigin-RevId: 1a0f8e4e38099ea172e6511d4fa2fe8735b82ea4
2026-11-30 18:28:15 +00:00
felixxia-oai 457ea27b0b Shadow fresh Guardian V2 approvals with Guardian V3 (#64782)
## Why

Collect Guardian V3 verdicts for actions that require a fresh Guardian V2
review while keeping Guardian V2 in control of approval and tool execution.

## What changed

When Guardian V3 shadowing is enabled and an enrolled reviewer is available,
run a single background review for eligible fresh approvals and log the
outcome with the live review ID. Skip shadowing when the reviewer is busy,
shadow intake has stopped, or a rollout budget is configured.

## Testing

Add app-server coverage for immediate approvals, ordinary synchronous
reviews, and fresh reviews with and without a rollout budget. Hold a shadow
denial in flight to verify that the tool and turn can finish, a second
request skips the busy reviewer, and stopped intake prevents new shadow
reviews while the in-flight verdict can still finish.

GitOrigin-RevId: 5e31f3d7e3b0433455b8f2a5fb52e483588b1b29
2026-11-30 18:27:38 +00:00
jif e3694f5cba Keep one-shot command timeouts active after approval decisions (#64781)
## Why

Recording a declined command can delay tool-result delivery. When
one-shot commands shared that pause for runtime limits, a sibling
command could keep running past its configured `timeout_ms`.

## What changed

Track command timeouts separately from tool-result delivery. A proposed
command holds result delivery through setup and resolution, while its
approval prompt pauses command timeouts only while a decision is
pending. A running one-shot command can then time out while its result
is still held, with its terminal ID remaining addressable until result
collection finishes.

## Testing

Cover the pause states before, during, and after the approval prompt.
Exercise both a sibling command that times out and one that exits
normally while a decline is being recorded, checking terminal access
and the exit status in the eventual tool result.

GitOrigin-RevId: d359bfc99fb9c23e6c61e94d75040cd6c1b09c49
2026-11-30 18:16:01 +00:00
Eric Traut 1b06a7002e Preserve Git root casing in the folder trust prompt (#64777)
## Why

On Windows, a case-folded trust key can make a Git root appear as a
separate path in the folder trust prompt even when it is the current
directory.

## What changed

Display the Git root with its original casing when it matches the
current directory. Keep the selected trust key for saving the decision
and continue to show distinct trust targets.

## Testing

Cover mixed-case Git roots in trust resolution and verify that the
prompt displays a single path for a matching root while keeping
distinct targets visible.

GitOrigin-RevId: 95b459dbcb8acf0611da8b04a1a413e56663f1e4
2026-11-30 18:05:37 +00:00
Joe Savona 81425480f1 Fix blank gaps and backgrounds in TUI flex rows (#64775)
## Why

Blank gaps in nested rows can shift end-aligned text when a row is
clipped. Blank lines can also lose their inline code or flex background.

## What changed

Suppress unpainted gaps on blank lines in aligned rows while preserving
spacer padding that clipping can reclaim for the ellipsis. Paint inline
code gaps and fill explicit flex backgrounds through the visible height
of stretched bands.

## Testing

Add rendering regressions for clipped end alignment, ellipsis placement
next to a wide glyph, and background coverage on blank lines.

GitOrigin-RevId: 2fc9d4b651dbf8a3cd8f63867bc6730a3bebd3ac
2026-11-30 17:43:58 +00:00
Joe Savona e860a98090 Add named icons to custom statuslines (#64774)
## What changed

Render named `icon` elements inline with terminal text. Badges can
display an icon on its own or place it before or after a label. For
example, a success badge can show a `check` icon next to “passing”.

Keep icons intact when wrapping or truncating text, including icons
that span multiple cells such as `code` (`</>`). Expose the new
element and badge combinations in the bundled TypeScript contract.

## Testing

Add coverage for icon and badge rendering, whole-icon truncation,
invalid icon payloads, and badge children counting toward the UI tree
node limit. Update the TypeScript contract fixture to exercise a badge
with a leading icon.

GitOrigin-RevId: 8a5afb0662a71cf1b5d16400b9866cb414c11646
2026-11-30 17:43:15 +00:00
Joe Savona f57352c536 Add list elements to custom status lines (#64773)
## Why

Custom status lines need a way to display grouped entries with automatic
numbering and keep wrapped lines aligned with the item text.

## What changed

Add `list` and `list-item` to the UI tree and the bundled TypeScript
contract. Each direct child of a `list` is an item. Use `list-item` to
combine multiple elements under one marker.

Lists use bullets by default and accept `number` or `none` as alternatives.
Wrapped lines align with the item text, and nested numbered lists start
their own count.

## Testing

Add renderer tests for wrapping, nested numbering, marker placement in
rows, clipping, and background preservation. Extend the decoding and
TypeScript contract tests to cover invalid markers.

GitOrigin-RevId: 991d230357f035ccbe7e52956ef1cbfe5b1e2174
2026-11-30 17:42:37 +00:00
Felipe Coury f92681791d Open /status in an interactive TUI modal (#64772)
## Why

Rate limits and thread usage can arrive after `/status` is displayed.
Updating a status card already in terminal scrollback required rewriting
history and depended on where the card was rendered.

## What changed

- Show the report in a scrollable modal with Overview, Configuration, and
  Session tabs. Apply rate limit and thread usage results to the open report
  without writing status output to the transcript or terminal scrollback.
- Copy a selected field or the full report directly from the modal, and open
  usage settings from the same view. Remove status fields from the `/copy`
  picker.

## Testing

Add coverage for overlapping refreshes, dismissal during account or thread
changes, keyboard navigation and copying during an active turn, and scrolling
in a narrow terminal.

GitOrigin-RevId: 64961c4d013607e373d50a79182b74e3048c632f
2026-11-30 17:40:02 +00:00
Benjamin Carlsson f7184ab849 Recover cloud conversation history on idle TUI reconnect (#64770)
## Why

Reattaching a cloud reply stream after a disconnect can leave gaps in
the transcript. Queued follow-ups also need to wait until the TUI has
caught up and knows whether a turn is already running.

## What changed

- Automatically resume eligible idle cloud conversations with history
  recovery. Replay missed items and repair partial replies in place while
  preserving the draft and native terminal scrollback.
- Hold queued follow-ups until the reattached stream has delivered its
  pending events and any active turn has settled.
- Reconcile queued async question answers against recovered history.
  Drop answers already recorded and return unresolved unsent answers
  to the composer for review.

## Testing

Add regression coverage for transcript repair, scrollback preservation,
queued input during catch-up, and async question answer recovery.

GitOrigin-RevId: 3378479ff886204cdc473a701ef51b3fc8b6b5c0
2026-11-30 17:27:17 +00:00
Benjamin Carlsson ed33bb35af Enable /archive in TUI side chats (#64767)
## Why

Side chats disabled `/archive`, so users couldn't archive the current
side chat from the composer while the sidebar was hidden.

## What changed

Show a confirmation in the composer even when the sidebar is hidden.
Warn about stopping a running turn, discarding unsent input, or losing
temporary chat history when applicable.

On confirmation, return focus to the parent chat's composer. Archive
saved side chats and remove them from Side chats. Close temporary side
chats and discard their history after cleanup succeeds.

## Testing

Cover saved side-chat archiving, including retry after a failed archive,
and verify that a temporary side chat stays accessible with its queued
input when cleanup fails.

GitOrigin-RevId: 1bbe25a241719cdc2722bc8db915dea9111b6fc9
2026-11-30 17:14:19 +00:00
Felipe Coury 3506461cf4 Separate TUI transcript rendering from input handling (#64765)
## What changed

Let the transcript reader paint into a caller-provided frame and area,
returning the delay for the next search or history-loading frame. Split
event preparation, including clipboard completions and selection ticks,
from input dispatch so the app can refresh visible rows before handling
selection input.

Extract transcript reader construction and centralize the app's overlay
input checks. Route draft snapshot flushing through `ChatWidget`.

GitOrigin-RevId: c5e093f585e264c4ffea51ebfcff0b08a1c3ff93
2026-11-30 17:00:53 +00:00
jif 9baf9789e1 Honor interrupts during resumable exec_command startup (#64753)
## Why

A turn interrupt can arrive while a command is waiting for its executor
connection or while a newly launched shell is still being registered.
The command can then launch after the interrupt or keep running before
the caller has a session ID to interact with it.

## What changed

Check for cancellation before dispatching a resumable command, including
after remote connection recovery. If the shell has already started and
is still running, stop it when cancellation wins before registration and
return the usual `aborted by user` result. Preserve the result of commands
that already reported an exit.

Track any pending command begin and end events for interrupted startups
so session shutdown waits for them to be published.

## Testing

Add regression coverage for interrupts before dispatch and after launch
but before registration, including command history on shutdown. Cover
cancellation during remote executor recovery and cleanup of abandoned
remote starts.

GitOrigin-RevId: 624df736ca2cb077e879f52a194ee4d89afd225a
2026-11-30 16:29:58 +00:00
Eric Traut f62d4836b8 Avoid unnecessary TUI redraws on terminal focus changes (#64752)
## Why

Switching away from an idle composer can write to the terminal even when
there are no animations to clear. Regaining focus already triggers a draw.

## What changed

On focus loss, request a redraw when composer sparkles are visible or
when an active empty-state replay is canceled.

## Testing

Add a PTY regression test that checks for zero terminal output after idle
focus loss and verifies that input is accepted immediately after focus
returns, in both inline and fullscreen modes.

GitOrigin-RevId: c961a4274049b98fff7307092f6ac89d51cf8e95
2026-11-30 16:25:43 +00:00
jif 31d8ed6d0f Resume idle V3 workers with send_message (#64750)
## What changed

In multi-agent V3, `send_message` starts a new turn in an idle
worker's existing conversation, including after eviction. The worker
receives the input as a `MESSAGE`. Sends to `/root` still follow
its wake policy.

Remove `followup_task` from the V3 tool set and select role instructions
that match the agent tree's version.

## Testing

Cover delivery to active workers at the concurrency limit, retrying
an idle worker once a slot opens, and resuming workers after eviction
or session restore.

GitOrigin-RevId: 3b0e55f150784896aa6e0dfa926bc490bdd2627d
2026-11-30 16:12:41 +00:00
jif 6c7f53890f Assert the turn stays active after declining exec approval (#64744)
Check that the approval request's turn is still current before sending
`Op::Interrupt` while the decline is waiting to be recorded.

GitOrigin-RevId: c1e23a77efc0d5550e9ffa280d72bb66da711ed8
2026-11-30 15:22:51 +00:00
jif 7caec30d71 Honor Stop while recording a declined command approval (#64740)
## Why

Recording a declined command approval can delay a subsequent Stop request while other commands in the same turn are still running.

## What changed

If Stop is next in the submission queue, interrupt the active turn while the decline is still being recorded. Consume Stop only if it interrupts that turn, and leave other submissions in order.

## Testing

Extend the approval cancellation regression test to cover declining a command and then pressing Stop. The test checks that a running sibling command stops before the decline is recorded and that output from a completed sibling remains available in the next turn.

GitOrigin-RevId: 9f08cb35f96e497d95eaa0aefb039ca9729761e7
2026-11-30 14:40:49 +00:00
jif 808f3345e9 Support the V3 multi-agent selector on the V2 runtime (#64735)
## Why

Enabling `multi_agent_v2` forced the V2 tool version before a fresh
thread could use the model selected for its first turn. The shared
runtime needs to support both V2 and V3 selections.

## What changed

- Let the first turn select V2 or V3 from the active model, with V2 as
  the fallback when the shared runtime is enabled.
- Pass the selected version to fresh and forked subagents, including
  through host-prepared child creation.
- Report both selections as `v2` in app-server model metadata because
  they use the same runtime.

## Testing

Extend integration tests to cover model switches between V2 and V3
before the first turn and V3 inheritance in fresh, forked, and
host-prepared children.

GitOrigin-RevId: de1fd9836d8cb3c4dc19805507462f4f5cfe3959
2026-11-30 13:51:38 +00:00
jif bda8fc3c04 Centralize multi-agent V2 runtime checks (#64731)
Add `MultiAgentVersion::uses_v2_runtime` to identify versions that use
path-addressed workers and turn-scoped execution slots. Use it to gate
runtime behavior such as subagent spawning and resumption, forked
history handling, and message routing. The predicate matches only
`MultiAgentVersion::V2`, preserving existing behavior.

GitOrigin-RevId: 712243c5df310c0745bf69c4faff660a44f05be5
2026-11-30 13:09:06 +00:00
jif acd1a3794b Frame pending native multi-agent calls in Guardian reviews (#64729)
## What changed

When native multi-agent v2 history is enabled, Guardian automatically
frames the pending call and its paired output as a distinct approval
request. Mark the separate `guardian_native_action_framing` flag as removed.

## Testing

Update the incremental review snapshot to capture the framed
`send_message` and its paired output. Update the root handoff test to
match setup handoffs at the approval boundary so historical calls
cannot mask the final command's separate denial.

GitOrigin-RevId: 5194a8cdf21e5d71f3a7942c0ce637f115316476
2026-11-30 12:52:50 +00:00
jif ae78265f08 Streamline rollout history handling for thread forks (#64704)
## Why

Forking before a known user message only needs its rollout position. The
previous path replayed turn history even when that position was available.

## What changed

Compute the fork boundary on the borrowed rollout before taking ownership
of its records. Use rollback-aware user message positions for in-range
requests and inspect the unfinished turn only for out-of-range requests.

Share unfinished-turn detection and closure between interrupted thread
forks and subagent forks that preserve the parent prefix. Read turn
metadata without materializing the active turn's items.

## Testing

Cover empty fork histories and verify that an interrupted fork persists
the original turn ID, root turn ID, and start time in its abort event.

GitOrigin-RevId: 8d732f9f9c5fcc9aa4be27c3e48b68e43531e938
2026-11-30 09:40:54 +00:00
rhan-oai 39e7013b3f Wake sleeping hosted roots on injected agent mail (#64680)
## Why

With native tools disabled, injected agent mail could be persisted without
waking a hosted root in durable sleep.

## What changed

Schedule a mailbox wake for sleeping hosted roots after injected plaintext
mail is durably recorded. Keep the interrupted turn active through
`TurnAborted` so mail arriving during the interruption can start a turn
only after the abort event is published.

## Testing

Add regression coverage for queue-only mail waking a hosted root with its
previous turn context and for mail injected during the sleep interruption
starting a turn after `TurnAborted`.

GitOrigin-RevId: 939db5ffca9af1273e4fb4c8d0dfb6bb7a95ea09
2026-11-30 05:06:55 +00:00
Anthony Tafoya 0b255ab853 Clarify the Code Mode result default and scope the Bazel test helper (#64678)
## What changed

- Rename the zero-valued `ToolResultFormat` member to
  `TOOL_RESULT_FORMAT_JSON_OR_UNSPECIFIED` and update both Rust gRPC
  endpoints. The default still preserves the full JSON value when the
  format is omitted or unknown.
- Tag `exec-server-test-helper` as `manual` so Bazel wildcard builds skip
  the standalone target. Exec-server tests still pull it in on musl.

GitOrigin-RevId: 7fa5b7c8a7448883ddb5b968fefc085be1ebd931
2026-11-30 04:53:40 +00:00
smurching-oai f0f1040931 Allow local MCP HTTP header helpers to receive selected env vars (#64672)
## Why

Local MCP HTTP header helpers run with a restricted environment. A helper that needs a host setting such as `HTTPS_PROXY` needs a way to receive that variable while keeping the rest of the host environment restricted.

## What changed

- Add `http_headers_helper_env_vars` for local Streamable HTTP servers. A nonempty list requires the server URL and an absolute helper executable path in the same user or administrator configuration entry. Codex launches that executable directly, and Windows requires an `.exe` path. Helper entries without the list retain shell command syntax.
- Revoke inherited access when a higher-priority entry overrides the URL, helper, or variable list. An empty list explicitly clears an inherited grant.
- Show effective variable names in `codex mcp get` and the JSON output of `codex mcp list`, while keeping helper commands and variable values out of the output. Make `codex mcp add` and `codex mcp remove` edit only the named server so unrelated grants stay in their original configuration layer.

## Testing

Add coverage for grant validation and revocation, variable forwarding during OAuth startup and header refresh, CLI redaction, and preservation of administrator grants during unrelated CLI edits.

GitOrigin-RevId: d1ebdcf4dbd7946c0f3bfb982464a0024768d585
2026-11-30 04:08:38 +00:00
Eric Traut 86581fdabe Ignore RUSTSEC-2026-0620 in Cargo advisory checks (#64659)
## Why

The affected AVX-512 backend in `curve25519-dalek` 4.1.3 requires nightly
Rust. Codex release builds use stable Rust.

## What changed

Add the advisory to the `cargo audit` and `cargo deny` ignore lists.
Document when to reassess the exception and remove it once all dependency
paths drop affected versions or use 5.1.0 or later.

GitOrigin-RevId: 3d0e5de349e1f828b160ce404b210b638ff131ef
2026-11-30 02:31:43 +00:00
Dylan Hurd ab95e048b2 Verify Guardian network approvals against a mock origin (#64653)
## Why

The routing test needs to verify that Guardian's decision controls whether
a request reaches its destination. Loopback addresses are covered by
`NO_PROXY`, so the probe must explicitly use the managed proxy.

## What changed

Send both probes through `HTTP_PROXY` to a local mock origin. Assert that
the approved command exits successfully and receives the origin's response,
and that the denied command reports Guardian's denial without sending a
second request to the origin. Collect output across the initial
`exec_command` response and subsequent polls so the test can check stdout
even when it arrives before the process exits.

GitOrigin-RevId: aa32a588e9ad9a049621242d8b8a567462237cca
2026-11-30 01:26:59 +00:00
ioanbudea-OAI fd7f1f0346 Add metadata-only reads to the thread store (#64651)
## Why

Callers that only need canonical session metadata should be able to read it
without loading the full rollout history.

## What changed

Add `ThreadStore::read_session_meta`. The default implementation looks for
the session header in the latest model context and falls back to history if
the header is absent or model context reads are unsupported.

The local store reads only the selected rollout's header and skips SQLite
read repair, which can parse the full rollout. If archiving or unarchiving
moves the file before SQLite updates its path, the lookup can follow the
rollout to its new location while respecting `include_archived`.

## Testing

Cover paginated metadata reads, the history fallback for a saved child
thread, and metadata reads with missing or stale SQLite entries. Verify that
a valid header can still be read when the rest of the rollout contains invalid
bytes.

GitOrigin-RevId: 08790b2db80d35e67f5a101dc38d760987b2d710
2026-11-30 00:51:08 +00:00
Eric Traut ba431841b4 Load TUI client preferences from configuration layers (#64650)
## Why

TUI preferences belong to the client. Building test settings from resolved
session fields can mask which preferences startup and reloads actually read.

## What changed

Remove the conversion from core `Config` to `LocalSettings`. Have TUI test
fixtures read preferences from the configuration layers or reuse existing
`LocalSettings`, and set runtime overrides directly on those settings.

## Testing

Update the startup test to verify that the saved agents overview grouping wins
when the resolved core field specifies a different grouping.

GitOrigin-RevId: 99a4ef475d1679e8f9ef1a870635631cad76ae40
2026-11-30 00:39:15 +00:00
Eric Traut b2d7473520 Reload TUI preferences from configuration layers (#64645)
## What changed

Reload `LocalSettings` from the effective configuration layers while
preserving the active transcript and alternate-screen modes. Reuse the
prepared settings after folder trust changes and when starting a session
from the agents overview.

Pass `LocalSettings` directly to working-directory prompts, hook review,
and history loading. Initial history loading uses a bounded item budget
when local settings are unavailable.

## Testing

Update the reload test to verify that layered preferences are applied
while the active screen modes are preserved. Check the initial history
budget when local settings are absent.

GitOrigin-RevId: e02736b7bb29e00ddfd791afa778fc0d958d358a
2026-11-29 23:28:54 +00:00
Eric Traut 16022fda85 Carry local TUI settings through startup (#64643)
## What changed

Pass layer-derived `LocalSettings` through the startup draft, onboarding,
session pickers, and app launch. Refresh those settings when startup reloads
configuration, including after a resume or fork selection or picker
cancellation.

Use the local settings for rendering and screen selection, then update them
to reflect the terminal's actual alternate-screen and transcript modes.

GitOrigin-RevId: 89fcaa0c05c68e55d7de6e0052c38a48d6842d7b
2026-11-29 23:14:56 +00:00
Eric Traut 0435890df9 Build TUI startup preferences from the final config layers (#64641)
## What changed

Reuse the local settings bootstrap parser on the final in-memory config
layers before applying TUI startup preferences.

## Testing

Extend the local settings test to check parity with preferences derived
from the full config and verify that a managed layer seen only by the
final load overrides the startup values for paste burst handling and
alternate screen mode.

GitOrigin-RevId: a8cc2fd667ca10fb9765be429974bd04c634e9c0
2026-11-29 23:01:35 +00:00
Eric Traut 4999d8167b Make Ctrl+C quit the startup folder trust prompt (#64629)
## Why

The startup folder trust prompt needs separate controls for quitting Codex and returning to the Agent Command Center.

## What changed

Use `Esc` or **Back to Agent Command Center** to return to the overview. Press `Ctrl+C` to cancel startup and shut down the session. Show the quit shortcut when the footer has room for it.

## Testing

Add a PTY regression test that sends a single `Ctrl+C` and checks for a successful exit, a cleared prompt, no Agent Command Center, and an unchanged `config.toml`.

GitOrigin-RevId: 7e3110c72e5d6a08de7c5e804ad8e1a07c69c48f
2026-11-29 17:52:23 +00:00
Eric Traut 0c28cdec2b Fix untracked file handling in the TUI Git diff (#64616)
## Why

The TUI can silently omit untracked files when Git quotes their names,
when their names have leading or trailing whitespace, or when they
disappear between listing and comparison.

## What changed

Read NUL-delimited paths from `git ls-files` without trimming them,
skip directory entries for untracked nested repositories, and use Git's
`/dev/null` handling across local and remote workspaces. Warn when an
untracked file can't be compared while still showing the available patches.

## Testing

Exercise a clean repository and an untracked file named ` café.txt`
beside a nested repository. Verify that a missing file produces a warning
while tracked and other untracked patches remain visible, including a patch
that Git emits alongside a line-ending warning.

GitOrigin-RevId: b92922ea49928381504dc11b71d599c60dbb7068
2026-11-29 16:23:26 +00:00