Commit Graph
14196 Commits
Author SHA1 Message Date
Joe Savona 15843299be Support inline code in custom status lines (#63755)
## Why

Ordinary status line text collapses spaces and tabs, so it cannot
preserve the spacing of commands and other literals.

## What changed

Add a `code` element to the terminal UI tree and expose it as
`CodeElement` in the status line TypeScript contract. Code spans
preserve literal spacing, expand tabs to terminal tab stops, and use
theme-aware foreground and background colors. They prefer word breaks
and can wrap long tokens at grapheme boundaries in narrow layouts.

## Testing

Add renderer coverage for whitespace, wrapping across styled children,
clipping, and theme contrast. Extend the TypeScript contract fixture to
check that `CodeElement` requires a child list.

GitOrigin-RevId: 626d7624829a25e342fc052ab5194ff53b2a7673
2026-11-24 22:26:31 +00:00
Joe Savona 38e42cdb21 Add vertical layouts to custom status lines (#63752)
## What changed

Add a `col` element that stacks children vertically with a required `gap` measured in blank terminal rows. Rows and columns can nest, and a column inside styled text starts a new block while inheriting the surrounding style.

In both `row` and `col`, adjacent strings form one layout item. Null children and standalone whitespace are skipped, while explicit empty elements still count when spacing items.

## Testing

Add renderer tests for nested layouts, wrapping, viewport clipping, and spacing around empty elements. Extend the TypeScript contract checks to cover `ColElement` and its required `gap`.

GitOrigin-RevId: cca7d0057582de001bd8f5008fe949a05d7ebe22
2026-11-24 21:58:29 +00:00
Joe Savona d18dddd984 Fix blank lines and backgrounds in nested TUI rows (#63748)
## Why

Blank nested rows can consume a column and crowd out a wide glyph in
an aligned row. A gap before trailing blank content can also trigger
horizontal truncation when the glyph fits at the viewport edge.

## What changed

Keep blank lines in the layout height and let zero-width flex items
occupy zero columns. Clip gaps before empty fragments to the visible
width. Fill explicitly colored nested rows across their visible flex
allocation, including blank lines, without painting into sibling cells.

## Testing

Add regression tests for wide glyphs beside blank nested rows, wrapping
at the viewport edge, and background coverage with both blank and
nonblank sibling lines.

GitOrigin-RevId: 1acb06e0bb900a7f99bc06e542518708b89b7728
2026-11-24 21:42:02 +00:00
viyatb-oai f22cc03b04 Review saved exec escalations when read denials apply (#63743)
## Why

A saved command allow rule can skip review, but it cannot authorize
broader filesystem access when the sandbox enforces read denials. This
left explicit escalation requests running with baseline permissions even
when Guardian could review the request and the executor could preserve
the denials.

## What changed

Route those explicit `exec_command` escalation requests through Guardian
when auto-review is configured and the executor supports widening access
while preserving read denials. Tell Guardian that approval can broaden
filesystem access outside the denied paths and globs.

Evaluate read denials and sandbox selection using the target executor's
path conventions. A `:slash_tmp` denial applies on Linux and has no
effect on Windows.

## Testing

Cover Guardian approval and rejection for commands with saved allow
rules, plus `:slash_tmp` handling on current and legacy Linux and Windows
executors.

GitOrigin-RevId: abfe9888a1e168cfebb64e3faf12546e1f626aa2
2026-11-24 21:27:17 +00:00
rhan-oai 20c7f26cd2 Use root evidence in Guardian reviews for hosted agents (#63742)
## Why

Guardian could resolve root instructions for locally managed agents through the
agent tree. Detached workers need their host to supply that evidence so Guardian
can evaluate their actions against the root user's instructions.

## What changed

- Let trusted hosts capture reusable root evidence, watch for committed changes,
  and select handoff context for each worker. Supply that evidence to Guardian
  while keeping it out of the worker's conversation.
- Bound hosted evidence reads by the review deadline and cancellation. Recheck
  root evidence before approving, and invalidate cached authorization when the
  root runtime is replaced.
- Let a cached score end a pending review only when it covers the action under
  review and its worker and root evidence revisions still match.

## Testing

Add coverage for hosted reviews that receive root instructions, unavailable and
stalled evidence reads, root replacement, and delayed scores for an earlier tool
call.

GitOrigin-RevId: 52553041ef449a2e180f9f1b7fc261dcbcb76f01
2026-11-24 21:10:00 +00:00
Eric Traut c6b00eacb9 Add composer borders when the terminal background is unknown (#63741)
## Why

When Codex cannot detect the terminal background, the composer loses the
fill that sets it apart from the surrounding UI. Guessing a fill color
could hide the terminal cursor.

## What changed

Use gray top and bottom borders to mark the composer when it has no
background fill, leaving the terminal background visible. Draw the
borders only when there is room for the text area and the terminal can
render a color.

## Testing

Add a snapshot for a missing terminal palette that shows the borders
around a draft with a file mention and an image attachment.

GitOrigin-RevId: da74996fcde8f669c7b1577fa93a7744ad65e4f6
2026-11-24 21:08:47 +00:00
Eric Traut 39f38dcfab Prefer terminal clipboard writes in VS Code dev containers (#63740)
## Why

A native clipboard write inside a dev container can succeed on the
container's desktop while leaving the host clipboard unchanged.

## What changed

Detect VS Code dev containers with `REMOTE_CONTAINERS=true` and route
clipboard copies through tmux or OSC 52. On Linux with a nonempty
`WAYLAND_DISPLAY`, use the native clipboard for copies over the
100,000-byte terminal limit and retain clipboard ownership.

Host delivery remains unconfirmed on both paths. The copy status asks
users to try pasting and points them to `/export` if the text is missing.
Keep that status out of exported transcripts.

## Testing

Add coverage for dev container detection, terminal send success and
failure, and clipboard ownership at the terminal size limit and one
byte over it.

GitOrigin-RevId: 057f7956fce8a16c8a3022b697e443b524740376
2026-11-24 20:50:04 +00:00
Eric Traut 32f77f824d Restore the TUI Working indicator when a Stop hook continues a turn (#63736)
## Why

A final answer hides the Working indicator. If a Stop hook then asks
Codex to continue, the TUI can look idle while the turn is still running.

## What changed

Restore the indicator when a completed `HookPrompt` belongs to the
current running turn, both during live updates and when replaying a
thread snapshot.

## Testing

Add a regression test that snapshots the restored Working row during a
live retry, checks that snapshot replay also restores it, and verifies
that replaying the prompt after turn completion leaves it hidden.

GitOrigin-RevId: 67909c92b628ff5389ea9b417e7e5133a9acdeec
2026-11-24 20:35:36 +00:00
Adam Perry @ OpenAI 9a3c131eb4 Deduplicate model catalog strings in memory (#63735)
## Why

Identical instructions and tool descriptions can appear in multiple
model catalog records. Each decode or clone previously allocated its own
copy of that text.

## What changed

Use `CodexCachedStr` for catalog instructions, messages, and tool
overrides. It stores short strings inline and interns longer strings so
independent decodes and clones can share storage. Resolved incremental
tool messages also reuse cached text from overrides and bundled defaults.
JSON and generated TypeScript still represent these values as strings.

## Testing

Add tests for shared storage across catalog fields, independent decodes,
clones, and incremental tool defaults. Cover plain JSON string round
trips and borrowed access to short inline UTF-8 strings.

GitOrigin-RevId: 6f53b4e19f01f6ed52a8fd364279b924cf794be2
2026-11-24 20:21:47 +00:00
surajs-oai 7a24022794 Allow async user messages through code mode (#63730)
## Why

Agents could send async user messages only through a top-level tool call, even in code mode.

## What changed

Set `features.send_message_to_user_async.direct_only` to `false` to make the tool follow the session's tool mode. Direct mode exposes it as a top-level tool, code mode allows both top-level and nested calls, and code-mode-only sessions require nested calls and reject direct calls. The default keeps the tool top-level only. Existing agent opt-ins still apply.

## Testing

Add integration coverage for tool visibility, call results, and message delivery across all three tool modes with both values of `direct_only`. Improve failure diagnostics in the multiline shell snapshot test and paste `/status` as a single input event in the daemon compatibility test.

GitOrigin-RevId: c69bb2fba8bf776eff01382d8869fc869fc9d479
2026-11-24 19:56:22 +00:00
Eric Traut 7015377ecd Keep terminal pet animations in step with task status (#63729)
## Why

The terminal pet could settle into its idle animation while a task was
still running or waiting for approval. Its running notification also
expired after three minutes, even if the task was still active.

## What changed

Use the terminal program status to select the pet's reaction on redraw.
Loop the running, waiting, and failed animations while their notifications
are active. Play the review reaction three times before returning to idle
animation, and clear the reaction when the program status returns to idle.
Apply the same playback rules to custom task animations.

Schedule animation redraws only when the pet can be drawn and the sprite
can change. A pet that cannot fit or is covered by the shortcut HUD
requests no animation frames.

## Testing

Extend tests to check sprite selection through approval, completion,
failure, and acknowledgment, along with custom animation playback and
redraw scheduling when the pet is hidden.

GitOrigin-RevId: 09ef2a8558190eb2f63f5c286b4271838f228f67
2026-11-24 19:55:43 +00:00
jif 35ca204afa Remove the image generation extension's dependency on codex-core (#63727)
## Why

The extension depended on the full core configuration to resolve a small
set of per-thread settings. Accepting those settings from the host lets
the extension work with other host configuration types.

## What changed

Make the extension generic over any host configuration that can provide
`ImageGenerationSettings`. Resolve the settings and artifact save root
at thread startup and refresh them when the thread configuration changes.

Share the `image_gen` namespace through `codex-config` and the
`x-codex-turn-metadata` header through `codex-api`.

GitOrigin-RevId: 3f10fd0a45c910e87bb6beea7f7c2e6c3f7eb707
2026-11-24 19:54:23 +00:00
Ben Romano ae21235afb Trace fork history preparation and spawn-edge persistence (#63719)
## Why

Agent spawn traces need separate timings for preparing forked history and
persisting the parent-child relationship. The persistence write runs in
a separate Tokio task, so it needs the caller's tracing context.

## What changed

Add spans for fork history preparation and the spawn-edge upsert. Carry
the caller's span and subscriber into the persistence task, and enter
the upsert span both when calling the graph store and when polling its
future.

## Testing

Extend the failed-publication test to verify cleanup after a lost commit
acknowledgement and check the exported trace. It asserts that fork
preparation finishes before the upsert starts, that both spans belong
to the spawn caller, and that the graph store span is nested under the
upsert.

GitOrigin-RevId: 28bf2d69ce494ab146aa124f045e28d6a0f5dab9
2026-11-24 19:26:52 +00:00
viyatb-oai 1263a383a5 Bind sandbox CA access to the prepared managed proxy route (#63711)
## Why

A sandboxed command needs read access to the generated CA bundle for its
managed proxy route. Choosing the bundle from the command environment or
from live proxy settings can give the sandbox a different bundle from
the one captured when the route was prepared.

## What changed

Capture the generated CA bundle alongside the proxy environment and
sandbox network policy. Validate the captured bundle when granting read
access. A locally prepared route with no generated CA grants no CA
access. Controller-supplied portable routes still look up and validate
the generated bundle in the command environment.

## Testing

Cover restricted reads for remote processes using both portable routes
and executor-local proxies. Verify that a borrowed proxy's prepared
route preserves its listener and CA grant across a proxy configuration
change.

GitOrigin-RevId: 1a4024b5b84c14febda7cdd6b6f4f950a7741054
2026-11-24 18:51:41 +00:00
Eric Traut 7f8dcb3e64 Detect Ghostty truecolor when SSH omits COLORTERM (#63710)
## Why

SSH can forward Ghostty's `TERM=xterm-ghostty` without `COLORTERM`,
leaving Codex to use an ANSI-16 palette for a truecolor terminal.

## What changed

Centralize stdout color detection in `codex-terminal-detection`. Upgrade
an ANSI-16 result to truecolor when `TERM` is `xterm-ghostty` and neither
`FORCE_COLOR` nor an active `CLICOLOR_FORCE` override is present.

Use the shared detection for TUI colors, including shimmer and activity
indicators. Share the existing Windows Terminal palette rules between
diff rendering and theme colors.

## Testing

Cover Ghostty's `TERM` fallback, explicit color overrides, and Windows
Terminal palette detection in unit tests. Exercise theme preview,
selection, and restoration with Ghostty's `TERM` and no `COLORTERM`.

GitOrigin-RevId: e7b6832fc7e721d5e2c23ef19df5fe55fbfeb21a
2026-11-24 18:50:19 +00:00
Eric Traut c4345a0079 Refresh the Codex CLI screenshot in the README (#63708)
Show a prefix-search optimization with an inline code diff and a
side-by-side Markdown preview of the benchmark results.

GitOrigin-RevId: 3ca40e4e29b8ec5745f49fde5e7da592db0d9217
2026-11-24 18:36:52 +00:00
Eric Traut 2ee23c7f8f Show URL elicitation instructions in the TUI confirmation (#63701)
## Why

A URL elicitation request can include instructions users need to complete
the browser action, such as a code to enter. The TUI's “Finish in Browser”
screen previously showed only generic guidance for that step.

## What changed

Render the request message above the generic browser instructions when
confirming an external action.

## Testing

Update the URL elicitation confirmation snapshot to verify that a payment
confirmation code appears on the “Finish in Browser” screen.

GitOrigin-RevId: 85566e783341fc46d8e21ef4710b7c30687316f8
2026-11-24 18:19:40 +00:00
jif 44308610ef Measure initial output collection time for exec_command (#63695)
## Why

End-to-end tool duration does not show how much time `exec_command`
spends collecting its initial output. Tracking the duration and call
count separately lets readers of the metrics compute the mean
collection time for each configured shell snapshot mode.

## What changed

Record the initial output collection time in whole milliseconds and
count each successful process manager response, including collections
shorter than a millisecond. The timing starts after the early-exit wait
and can include draining output after the process exits.

Tag both counters with the configured `shell_snapshot_mode` (`disabled`,
`v1`, or `v2`), including when execution falls back. Intercepted patches,
process manager errors, and `write_stdin` calls are excluded.

## Testing

Extend a unified exec integration test to check that the recorded time
matches the initial response within one millisecond, both counters carry
the `v2` tag, and a subsequent `write_stdin` leaves the count at one.

GitOrigin-RevId: 289336cf2544a78abb3417484b48d2d22109a56c
2026-11-24 17:34:10 +00:00
felixxia-oai 4ec69d3c5f Preserve Guardian review evidence when callers are cancelled (#63693)
## Why

Cancelling a turn or tool call could drop a pending history write or
lose an answer the session had already accepted. A missing write leaves
Guardian unable to confirm that its review history is complete.

## What changed

Let the session finish tracked evidence writes in queue order after the
caller is cancelled, and drain those writes on shutdown. Record verified
`request_user_input` answers at acceptance before waking the tool.
Continue persisting evidence after an earlier write goes unconfirmed,
while still reporting the history gap to Guardian.

## Testing

Regression tests cover initial and retried reviews waiting for a
revocation after caller cancellation, and an accepted answer reaching
history before the turn interruption even with an earlier unconfirmed
write.

GitOrigin-RevId: b8e212d34686bbc793002a34f5a97834a900a342
2026-11-24 17:33:28 +00:00
jif 9a3303253b Remove unused standalone connector listing helpers (#63692)
## Why

The app server already passes its environment and MCP managers to
connector discovery, leaving the standalone listing helpers unused.

## What changed

Remove the unused listing wrappers and re-exports from `codex-core`
and `codex-chatgpt`, including the setup that created temporary managers.
Move `tokio` to the dev dependencies of `codex-chatgpt` and enable only
the features its tests use.

GitOrigin-RevId: 757b32afeb6e46dddb46d507c5af07bf8ff7a2a3
2026-11-24 17:32:08 +00:00
jif f67868d050 Align sandbox retries with the permissions reviewed for them (#63683)
## What changed

Build the retry from the initial sandbox attempt. When policy permits an
unsandboxed retry, clear the sandbox settings and mark the command as
`RequireEscalated` for approval. When policy requires the sandbox to stay
in place, reuse the initial attempt so a network retry preserves file read
restrictions.

## Testing

Cover both Guardian verdicts after a sandboxed attempt. An approved retry
reaches the exec server without a sandbox, and a denied retry is blocked
before it reaches the executor.

GitOrigin-RevId: 5bf36dd4f43b7c0379457b88b8ddbf3dbd482b87
2026-11-24 17:19:40 +00:00
jif a009fc6a4e Remove unused core config loading wrappers (#63682)
Drop the deprecated `load_config_as_toml_with_cli_*` helpers and
`Config::load_with_cli_overrides_and_harness_overrides`. Existing callers
can use `ConfigBuilder` to apply harness overrides and
`load_config_toml_with_layer_stack` to inspect raw config during startup.

GitOrigin-RevId: 4901d876cf4d87094055f9907bd761525057fa99
2026-11-24 17:18:29 +00:00
jif 5e857c65a5 Remove unused spawned-thread lookups by agent path (#63678)
GitOrigin-RevId: 2bb6d0d64df0cfeed79a08e55ed437db864dd1d6
2026-11-24 17:03:35 +00:00
Felipe Coury 39c6485cb7 Fix Home and End navigation in the agent center (#63677)
## Why

The agent center's `Home` and `End` shortcuts skipped the **Show more**
row, so pressing `End` could stop before the last selectable row.

## What changed

Jump to the first or last selectable row and preserve whether **Show
more** is selected across view refreshes. Reconcile selection when
toggling search on and let the cancel shortcut dismiss search even when
the view cannot return to chat.

## Testing

Add a regression test that presses `End`, `Home`, and `End` across
view refreshes and verifies that `Enter` on **Show more** requests
another page.

GitOrigin-RevId: e508c7926ce83b68c229d638364e6e41f671490e
2026-11-24 17:02:17 +00:00
felixxia-oai 9863043881 Wait for pending history writes before Guardian v3 reviews (#63675)
## Why

A root-thread instruction can be visible in memory while its history append is still pending. Guardian v3 reads persisted history, so a review can miss a newer instruction that revokes permission for an action.

## What changed

Track pending appends for review-relevant root history and wait for confirmation before capturing the evidence cutoff for an initial review or retry. Confirm the append when the thread store accepts the history batch, before updating thread metadata.

If an append goes unconfirmed, fail review preparation and prompt the user to reload the root thread and resend any missing instructions.

## Testing

Add regression coverage for initial and retry cutoffs waiting on a pending revocation, failed appends of forwarded instructions, and history remaining readable after an acknowledged append followed by a metadata failure.

GitOrigin-RevId: b83ca178ca7b58dbc23b1f064b402df30f9689e1
2026-11-24 16:46:52 +00:00
felixxia-oai e713c4c302 Batch Guardian review history cutoffs by root thread (#63673)
## Why

Concurrent Guardian reviews of the same root thread can repeat history
flushes and reads to establish how far to route evidence.

## What changed

Share one flush and durable history position across binding and catch-up
requests queued before capture begins. Requests arriving during capture get
a fresh position so they can account for newer records. A lone catch-up reads
unread records and their end position together, skipping the separate tail
read. Catch-up still waits for evidence to be routed through its cutoff.

## Testing

Cover shared cutoffs and read failures, separate capture for late arrivals,
and a lone retry that picks up a newer revocation without a separate tail
read when another queued request is canceled.

GitOrigin-RevId: ef07231d66bc38d8b244b6ee37ec3d483b54bc0f
2026-11-24 16:45:39 +00:00
jif 6b7a16fe76 Remove unused HTTP client APIs (#63669)
## What changed

- Remove the deprecated `build_with_transport_default_proxy` method and
  inline its shared helper into the remaining caller, `build_direct`.
- Remove the unused `has_chatgpt_cookies` accessor, `with_raw_body`
  setter, and `with_chatgpt_cloudflare_cookies_without_redirects` pool
  constructor.

GitOrigin-RevId: 9dd19b7a28b1aac6f196968b53160ffbc7443b8a
2026-11-24 16:15:13 +00:00
jif 1a6c8514cc Make the remote MCP timeout test expire during discovery (#63668)
## Why

The discovery test used a 15-second deadline, which let RMCP fall back to
`initialize` after 10 seconds. The test needs to cancel a stalled
`server/discover` request to verify that discovery cancellation releases
the remote executor.

## What changed

Warm up the executor's HTTP connection with a successful `GET /ready`
before starting a 5-second discovery deadline. Keep the 15-second
deadline for the legacy handshake test.

GitOrigin-RevId: cbf299fc264c2635e0ea471545010bccbdcee94d
2026-11-24 16:14:36 +00:00
ioanbudea-OAI 77acaa207f Keep rejected audio file IDs out of protocol events (#63667)
## Why

Codex needs rejected audio file IDs when reconstructing a session so
later model requests can omit those attachments. Clients only need the
turn error.

## What changed

Store rejected audio file IDs as rollout metadata and restore them from
that metadata when replaying history. Keep the existing JSONL layout
under `error.rejected_audio_file_ids` so older versions can still read
newly written rollouts.

## Testing

Add a regression test that round-trips a legacy rollout entry and
verifies that serializing the protocol event omits the rejected IDs.

GitOrigin-RevId: 982dd85d0037cebee056caf61d70988762e42767
2026-11-24 16:14:00 +00:00
jif cba3c40cf7 Defer parsing response items until completion when streaming is suppressed (#63666)
## Why

Mailbox preemption can discard partial response items, and turn item
contributors can rewrite completed items. Parsing those items as soon as they
arrive does extra work before their final contents are known.

## What changed

During mailbox draining or when turn item contributors are registered, track
new response items as deferred, suppress their text and reasoning deltas, and
wait for `OutputItemDone` before parsing them. Rely on the response client to
carry the added item's ID forward when the completion omits it.

## Testing

The mailbox preemption tests check that a buffered reasoning item completes
exactly once under its original ID when the completion omits it, and that raw
reasoning deltas for a discarded item stay hidden.

GitOrigin-RevId: 940e062c8c44faa6670945262ee8c8f16abf4e20
2026-11-24 16:12:32 +00:00
jif ebd5c2fddc Make unified exec output closure race-safe (#63664)
## Why

The output collector could miss a closure notification while starting its
post-exit wait. It could also see an empty buffer just before the producer
appended its final chunk and closed the stream.

## What changed

Use a dedicated `CancellationToken` to signal when the output producer is
done. The collector samples closure before draining the buffer so that
closure during the drain wakes it for another pass. The streaming watcher
flushes queued chunks when it observes closure, and sandbox denial checks
can proceed immediately when output is already closed.

## Testing

Update the bounded collection test to verify that closure alone wakes
the post-exit collector and that the final bytes survive repeated drains.

GitOrigin-RevId: 4b94a018d784664031f326ec360d27fcf166bbda
2026-11-24 15:53:55 +00:00
jif 3781b6c627 Remove no-op rate limit polling hooks from the TUI (#63661)
## What changed

Remove `ChatWidget`'s prefetch and poller shutdown hooks from widget
creation, teardown, and the transition to background voice mode.
Prefetch only called the empty shutdown hook.

GitOrigin-RevId: c25c33a53d63be982d8cfebf405401a4c4f0e0c4
2026-11-24 15:35:38 +00:00
jif 5a2cb73580 Remove the unused codex-utils-readiness crate (#63660)
GitOrigin-RevId: 68ea46742c3c08a2dda097bb385f91e388b8bba4
2026-11-24 15:17:36 +00:00
Charlie Marsh 3e6daebb48 Avoid model lookups for thread metadata and goal updates (#63655)
## Why

A slow model lookup can delay thread metadata reads and goal updates even
though both operations have the settings and data they need locally.

## What changed

Use locally configured settings for app-server thread reads, enrichment,
and direct-input checks. The effective configuration snapshot still
validates the service tier against the selected model.

Record goal updates and emit their raw response events using an internal
submission ID without constructing a turn context.

## Testing

Add a regression test that gates model lookup and checks that the local
snapshot and goal recording complete without requesting model info. It
also checks that the goal event matches the history item and that the
effective snapshot filters out an unsupported service tier.

GitOrigin-RevId: 7d008edd775ae459a1fd1e3db79f38f2d9b5ca30
2026-11-24 14:52:00 +00:00
swastik-oai 53fe98bdc2 Accept an explicit tool call in Guardian review requests (#63654)
## Why

Selecting the final item in an idle thread's history ties Guardian review
to what was recorded. For example, a client may record an `exec` script
and need an assessment of an individual `exec_command` from that script.

## What changed

Require `toolCall` in the experimental `thread/guardianReview` request.
Guardian assesses the supplied `function_call` or `custom_tool_call`
against the idle thread's full history without appending or executing it.

## Testing

Cover rejection of requests missing `toolCall` and verify that Guardian
sees the recorded script alongside each command submitted for review.
Check that only the original script call is persisted in the thread.

GitOrigin-RevId: a1ce61e10e98107b38db60071dd63f189ef33ad1
2026-11-24 14:35:46 +00:00
jif 5f2bd3342f Remove unused SQLite thread-listing helpers from rollout (#63652)
Delete `list_archived_threads_from_state_db` and the `list_thread_ids_db`
helper for parity checks.

GitOrigin-RevId: cfcd7b24dd0dfbc97c7b245ef00390c0aded872b
2026-11-24 14:34:38 +00:00
jif a2c17b833c Frame pending native agent calls as Guardian approval requests (#63649)
## Why

A pending native agent call can appear alongside historical tool calls in
Guardian's review context. Explicit request boundaries identify the exact call
Guardian should judge.

## What changed

Add the off-by-default `guardian_native_action_framing` feature for Multi-Agent
V2 reviews with native multi-agent history enabled. Wrap the pending call and
its evidence-only output in approval request markers, and point the transcript
entry to the current request.

Keep the call-ID reference when reviewer history already contains the call.
Reserve room for the approval markers when budgeting screenshots so a retry
can replay the framed call if reviewer history changes.

## Testing

Cover call deduplication, replay after compaction, and screenshot admission at
the token limit. Update the incremental review scenario to show the framed
`send_message` call alongside encrypted parent reply history.

GitOrigin-RevId: dd99cd4ad4cf3451afe30d2e93aa3e47b493a4c4
2026-11-24 14:20:14 +00:00
jif 9acdf80aaf Remove the unused agent extension crate (#63648)
## What changed

Delete `codex-agent-extension`, whose `AgentRunner` submitted resolved
agent prompts in forked legacy threads and was used only by the crate's
integration test. Remove the test, the Bazel target, and the crate's
Cargo workspace and lockfile entries.

GitOrigin-RevId: 1e966ccb7b7f37f6cdd68882975bb1e940ae85db
2026-11-24 14:19:35 +00:00
jif 264f7d60f5 Return startup timing with MCP connection attempts (#63647)
## What changed

Have the MCP connection pool return an optional startup measurement
alongside the connection result. For a new connection, measure through
lease registration when required, including when registration fails.
If a chat falls back to opening its own connection, start the timer at
the fallback. Joining an existing connection produces no startup
measurement.

## Testing

Pool tests cover timing a lease-open timeout on a new connection,
omitting timing for the same timeout on a reused connection, and
recording timing when a chat falls back to its own connection.

GitOrigin-RevId: 364963ca2f4e7bd8338c8acc9a7869e3a7a6e9c4
2026-11-24 14:18:12 +00:00
jif 75df5098a6 Route in-memory message board notifications through app-server (#63641)
## Why

The SQLite message board can queue native agent mail through app-server.
In-memory boards previously relied on the host's notification callback
for delivery.

## What changed

Add `launch_in_memory_with_app_server` so runners can opt into the same
bounded, queue-only delivery as SQLite via `thread/inject_items`. The
host still resolves agent membership, and the shared notification client
queues post previews without starting a turn.

## Testing

Extend the app-server integration test to check that, after an
app-server restart, a post from each backend reaches an idle worker
exactly once on its next turn. The test also checks that app-server
delivery bypasses the in-memory host's notification callback.

GitOrigin-RevId: fc01b5e3f43dcfca5f43366f0b184c41dc07f9eb
2026-11-24 13:50:12 +00:00
jif e351ffa4b6 Remove the legacy test-only /mcp renderer (#63639)
## Why

The TUI renders `/mcp` from app-server `McpServerStatus` responses.
The legacy renderer's snapshot still exercises grouping by qualified tool
name, a path the command no longer uses.

## What changed

Delete the legacy renderer, its hyphenated-server-name snapshot test and
fixtures, and the TUI's `codex-mcp` dev-dependency.

GitOrigin-RevId: 69f1601f19b34576ea2d9dcebdd2bfb30f414d99
2026-11-24 13:29:54 +00:00
jif 50aeac27d8 Test plugin MCP tool approval overrides in the plugin cache (#63635)
## What changed

Extend the plugin manager's cache test to verify that a per-tool
`approval_mode = "approve"` takes effect after the cache is warmed with
other configurations and is still returned after `.mcp.json` is removed.
Remove the core test for this scenario and its test-only approval lookup.

GitOrigin-RevId: f99d18b435f2c1f3e0574ec2ffedbe24249e6346
2026-11-24 13:01:14 +00:00
jif a0d5b0a661 Let idle child threads unload while the message board is connected (#63621)
## Why

The message board connects to the app server to inject messages. Automatically subscribing it to new threads keeps idle child threads loaded after their last other subscriber leaves.

## What changed

Skip automatic subscriptions to newly created threads for clients that initialize with the shared `codex_message_board` client name.

## Testing

Add a WebSocket regression test that unsubscribes the parent thread's client from a completed child thread, checks for `thread/closed`, and confirms through the original message board connection that only the parent remains loaded.

GitOrigin-RevId: 73af9e370b90c59f984c4bc804140febb0308d9b
2026-11-24 11:57:55 +00:00
jif 8b096dce07 Remove the TUI snapshot test for /mcp secret masking (#63619)
## What changed

Remove the snapshot test for masking environment variable and HTTP header
values in `/mcp` output, its saved snapshot, and the HTTP server fixture
helper used by the test.

GitOrigin-RevId: d42092505760639776a779e93837a675ac14dece
2026-11-24 11:36:36 +00:00
jif cd97e717de Bump etherparse to 0.21.1 in the Linux sandbox (#63618)
GitOrigin-RevId: cceacdb2dc203de1edd6dbabf4db985d3e002b3e
2026-11-24 11:35:24 +00:00
jif 1f43c02f3f Simplify plugin MCP approval policy tests (#63614)
## What changed

Use a manifest default of `writes` and a user override of `prompt`
in the plugin manager test to verify that the user setting takes
precedence. Remove the standalone tool-call approval test and keep
the regression test that checks a per-tool override after the plugin
cache has been warmed.

GitOrigin-RevId: 667e613729e47507030308646d5adc5b5794e2c2
2026-11-24 11:19:24 +00:00
JonLuca De Caro abc92e6bd4 Report per-server MCP startup durations (#63613)
## Why

Required MCP servers can finish at different times even when their startup
notifications arrive together. Notification arrival times cannot show how long
each server took to start.

## What changed

Measure each startup attempt and expose its elapsed milliseconds as
`durationMs` on `ready` and `failed` updates from
`mcpServer/startupStatus/updated`. Successful Codex Apps reconnects report
their own duration. Reused connections, `starting`, and `cancelled` updates
carry `null`. The protocol accepts notifications from older servers that omit
the field.

## Testing

Cover distinct durations for fast and slow required servers, timing through
lease registration for newly opened shared connections, and a fresh duration
after Codex Apps recovery.

GitOrigin-RevId: 39c0c418149dd2b220828be04d998085f57acf2d
2026-11-24 11:05:19 +00:00
jif 32119bac26 Remove the test-only plugin guidance renderer (#63605)
The turn context renders generic plugin guidance through
`AvailablePluginsInstructions`. Remove `render_plugins_section` and its sole
caller, a test that checks the bundled guidance through that helper.

GitOrigin-RevId: 30e2b7aaab9432b7a29b8124676907b8dc1228e9
2026-11-24 10:47:15 +00:00
jif 92a34573a0 Remove the custom MCP tool approval precedence test (#63604)
## What changed

Remove the test that checked whether a tool-level approval setting
overrides the MCP server default, an unconfigured tool uses the server
default, and an unknown server falls back to `Auto`.

GitOrigin-RevId: 68df73cbefe79772d75cdc35abe42d4de3cf991d
2026-11-24 10:46:06 +00:00
jif c3186b5d95 Test thread previews through the app-server rollout path (#63603)
## Why

The existing preview test exercised a summary extractor used only in
tests, leaving the app-server rollout preview path without that check.

## What changed

Remove the test-only summary extractor and test
`preview_from_rollout_items` directly. Verify that the preview skips
`AGENTS.md` instructions and strips the preceding context to return
`Count to 5`.

GitOrigin-RevId: 123f0db2807cd2d95d85b3f99da9152f24cd50ff
2026-11-24 10:33:10 +00:00