Commit Graph
14372 Commits
Author SHA1 Message Date
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
alishobeiri-oai 8b2a4a40a9 Limit per-stream buffering in the Noise relay (#64540)
## Why

When the shared WebSocket writer stalls, a burst from one stream can fill
the outgoing queue. If a handshake reply arrives while the queue is full,
the relay can disconnect and interrupt existing streams.

## What changed

Allow each stream to queue one data record while the writer flushes the
current frame. Keep data and control frames in the same FIFO to preserve
their order. If the queue is full when a handshake reply is ready, decline
the new stream and keep the connection open so existing streams can drain.

## Testing

Add a regression test that stalls the writer during a burst and verifies
that a second stream's handshake reply arrives after at most two data
records and that the burst drains in order.

GitOrigin-RevId: f0e4225bccb63d021c09718e5c43df3f4c4a6745
2026-11-29 03:42:13 +00:00
Charlie Marsh dfd76bb740 Filter MCP server status tools by connector ID (#64527)
## Why

A single MCP server such as `codex_apps` can expose tools from multiple
connectors. Clients that need one connector's tools currently have to
filter the server's tool inventory themselves.

## What changed

Add an optional `connectorId` parameter to `mcpServerStatus/list`. It
keeps only tools whose `_meta.connector_id` or `_meta.connectorId`
exactly matches the requested string. Servers with no matching tools
still appear with an empty `tools` map and their status. Omit the
filter or pass `null` to return all tools, and repeat the filter on
each page when paginating.

## Testing

Add integration coverage for standalone and thread-scoped requests,
including both metadata spellings, an unknown connector ID, and an
omitted filter.

GitOrigin-RevId: d6ad367dff72002b239db7b5012145ba1811ccac
2026-11-29 01:29:23 +00:00
Dylan Hurd 065e18b040 Keep MCP guardian elicitation fixtures local in remote tests (#64425)
## Why

The automatic test builder registers only the selected execution
environment. When that environment is remote, the Python MCP fixtures
need access to the local environment.

## What changed

Use `build_with_remote_and_local_env` for the guardian elicitation tests
and set each Python MCP fixture's `cwd` to the test process's current
directory.

Attach the in-memory metrics client through `with_thread_extension` so
the yielded Code Mode elicitation test can use the thread created by
the builder.

GitOrigin-RevId: edc65db60665970e1c98686ab01e0012b47f5c79
2026-11-28 06:13:28 +00:00
viyatb-oai 965ee845b1 Require a resolved filesystem policy before probing Bubblewrap (#64422)
## Why

Codex checks candidate Bubblewrap executables before sandbox confinement.
At that point, the metadata protections applied by the sandbox are not
yet in effect.

## What changed

Evaluate candidate paths against configured filesystem restrictions
without counting sandbox-applied metadata protections or discovered Git
metadata carveouts. Skip executable lookup when permission resolution
fails.

## Testing

Extend the managed-network regression test to verify that writable
Bubblewrap candidates are skipped with a legacy Git metadata carveout
or a metadata resolution error.

GitOrigin-RevId: 17045604caadfb41cac78a252cf3a519b7149aed
2026-11-28 05:03:13 +00:00
viyatb-oai 8cae463a69 Honor declared filesystem permissions in Windows sandboxes (#64416)
## Why

MXC volume expansion can generate child grants that override restrictions on
directory aliases. The restricted-token backend can also reject valid workspace
policies because its compatibility check assumes the working directory is
writable.

## What changed

- Check directory identity before MXC expands writable volume roots. Suppress
  generated write grants that conflict with read-only aliases, including through
  junctions on other volumes, while preserving narrower explicit grants.
  Reject launch if a writable volume is also denied or its relationship to a
  restricted directory cannot be determined.
- Let the restricted-token backend accept the supplied workspace roots when
  the working directory has no explicit write grant, while retaining exact
  root matching for filesystem-root write grants.

## Testing

Add regression coverage for restricted volume aliases, junctions across
writable roots, explicit drive-root denials, and restricted-token workspace
roots with nested or read-only working directories or an empty root list.

GitOrigin-RevId: 0cd880b52185d0a38c479df17ae48aa68d45eeb1
2026-11-28 03:18:17 +00:00
viyatb-oai df8dd9a56b Preserve Linux sandbox restrictions across writable symlink aliases (#64415)
## Why

Ordering writable binds by the spelled paths can put a parent mount
after a child mount when symlinks are involved. The later bind can cover
deny masks and read-only mounts that the sandbox already applied.

## What changed

Group writable roots by their resolved mount destinations and bind each
destination once, with parents before descendants. Map deny rules under
writable aliases to their physical paths and apply them after read-only
mounts. Reapply read-only mounts below each writable bind while
preserving explicit write grants for narrower paths.

## Testing

Add `bwrap` regression cases for a symlink to `/` paired with a project
alias and for aliases to nested project directories. The cases check
that denied files stay unreadable, read-only files resist writes, and
explicitly writable children remain usable under restricted parents.

GitOrigin-RevId: e8c677cbccae1d7b62cb566609074f8c8c14ddeb
2026-11-28 03:17:03 +00:00
Felipe Coury 717dbefdb9 Fit the Agent Command Center grouping header to the panel (#64411)
## Why

The full header can clip the current grouping and its shortcut in
narrow panels.

## What changed

Use shorter header labels as space runs out and show just the grouping
in the narrowest layout. Account for the longest grouping name and the
configured shortcut when choosing a layout so the title stays stable
as users cycle groupings or move focus. Show the shortcut when it is
available and fits.

## Testing

Add snapshot coverage for Directory grouping with a custom `f11 g`
shortcut at 24, 36, and 60 columns.

GitOrigin-RevId: 9d4efe8d483d9431ff75c163a1a0ce96b7886894
2026-11-28 02:07:41 +00:00
Felipe Coury 246e5bae5a Fix TUI Markdown line breaks before inline code (#64400)
## Why

When a paragraph starts with inline code after a heading in a list
item, the renderer can append the code to the heading's line.

## What changed

Honor pending line breaks before rendering inline code using the same
line-start logic as links. Table cells keep their inline layout.

## Testing

Extend the rendering and transcript copy snapshots to cover a list
item with a heading followed by inline code. The copy cases cover
both the full item and a selection within the code span.

GitOrigin-RevId: bcc480cb9aa2cbf7ab0738f1ec3667677445987a
2026-11-28 00:05:22 +00:00
viyatb-oai d96685f508 Seal synthetic mounts in read-restricted Linux sandboxes (#64398)
## Why

Read-restricted sandboxes build a synthetic filesystem around paths
granted by policy. Leaving the backing mounts writable lets commands
modify synthetic directories outside explicitly writable paths.

## What changed

Remount the synthetic root, minimal `/dev`, and applicable WSL masks
read-only after bubblewrap finishes setting up mounts. The remounts
are nonrecursive, so explicitly writable child mounts stay writable.

## Testing

Extend the sandbox regression test to check that commands can read an
approved file through a symlink, write to `/dev/null`, and write to an
allowed subdirectory under a denied parent. The test also checks that
commands cannot rename the synthetic directory containing the approved
file or create an ungranted directory under `/dev`.

GitOrigin-RevId: e2ddc6c4a215d052adf12e2644480a2eb9c72640
2026-11-27 23:53:27 +00:00
Eric Traut d2be907d4d Show confirmed thread permissions in TUI status (#64396)
## Why

The TUI used its local configuration to report permissions and approvals.
Pending profile selections could make those values differ from the
settings confirmed for the displayed thread. Legacy sandbox policies
can also hide restrictions of named profiles.

## What changed

- Use the displayed thread's confirmed permissions and approval settings
  in `/status`, the built-in status line, and status line provider data.
  Show unknown values in the UI when the thread has no confirmed settings.
- For named custom profiles, show the profile name and approval mode in
  `/status`, including workspace roots where applicable.
- Omit ambiguous enforcement from provider data unless the embedded app
  server can resolve it. Report confirmed approval settings independently.

## Testing

Add regression coverage for switching threads, retaining confirmed
settings after a rejected profile selection, and resolving enforcement
for a full-disk profile with networking disabled.

GitOrigin-RevId: f7b6c005d640ae9ede4bd132090b835ca6b7ea1f
2026-11-27 23:37:54 +00:00
Eric Traut 8cd512c85f Track server-confirmed thread permissions in the TUI (#64393)
## Why

Embedded sessions can use a local execution profile that differs from
the sandbox policy reported by the app server. The TUI needs a
server-confirmed snapshot for permission displays.

## What changed

Capture the server-reported sandbox profile, active profile, approval
settings, working directory, and workspace roots when a thread starts,
resumes, forks, or receives a live settings update. Restore the snapshot
from cached sessions and preserve it during transcript replay. Leave the
snapshot unset when session settings are inferred.

## Testing

Extend tests to cover differing server and local profiles, workspace
roots from live settings updates, and snapshot preservation during
transcript replay.

GitOrigin-RevId: 525fdfa1b526f5d799bca01c955ac7cfc3e60774
2026-11-27 22:52:25 +00:00
Eric Traut 7d8506410c Remove dim styling from hook details in the TUI (#64391)
Use the default text style for single-line and wrapped values in the
hooks browser detail pane.

## Testing

Extend the wrapped hook command test to check that every detail span
uses the default style while still checking the full hyperlink destination.

GitOrigin-RevId: 77041a3bd95ad1f9fa71aa38857208c59ba44f9b
2026-11-27 22:43:21 +00:00
viyatb-oai 5729aca45d Bind Linux sandbox paths before shell snapshot replay (#64388)
## Why

Linux filesystem rules that depend on `TMPDIR` or `HOME` need to keep
the same meaning when shell snapshot replay changes the command environment.

## What changed

Resolve `:tmpdir` entries and home-relative read-deny globs against the
prepared launch environment. Omit `:tmpdir` entries when `TMPDIR` is
unset or empty. Resolve relative temporary directories from the physical
command working directory and verify that directory before and after
bubblewrap sets up its mounts.

Preserve process confinement when resolving paths makes the filesystem
rules appear to grant full-disk access. Reject bindings that would change
the grants enforced by legacy Landlock.

## Testing

Add regression coverage for shell snapshot replay, working-directory
changes, and preservation of Linux process confinement.

GitOrigin-RevId: 07d4698ca7b30b0259193513145233ae1bdc7f19
2026-11-27 22:29:24 +00:00
Eric Traut 372947d936 Report pending startup dialogs through terminal program status (#64384)
## Why

Terminal hosts need to know when Codex is waiting for a startup decision, including while a chat status record is active.

## What changed

Emit a separate `OSC 7501` blocked record while waiting for directory trust, startup hook review, or an update decision. Report trust and hook review as permission prompts and the update prompt as a question.

Clear the dialog record when the prompt closes or Codex suspends. Report it again if Codex resumes waiting for input. Dialog records can coexist with the chat status record.

## Testing

Extend the connected directory trust PTY test to check blocked and clear records for consent and hook review. Exercise Ctrl-Z in a PTY without a controlling terminal and verify that the pending trust record stays active until the prompt is answered.

GitOrigin-RevId: 9801e03b28a19b75f62a09e3e927de0dd59c5448
2026-11-27 20:48:50 +00:00
Eric Traut e2e7dabd45 Clean up unused TUI image paste files on exit (#64382)
## Why

Pasting an image or an image file path could leave a temporary copy on disk
even if the image never reached the app server. Drafts still need those
copies during the session, and saved turns can reference them after exit.

## What changed

Track pasted-image copies for the lifetime of the TUI session, including
across backend switches and reconnects. Delete the remaining tracked copies
on exit. Preserve copies when a turn is admitted or when a lost response
leaves admission uncertain.

Check model support before writing a clipboard image for an ordinary
composer paste. In WSL, read PNG bytes from PowerShell's standard output
so the fallback uses the same cleanup path.

## Testing

Extend paste tests to verify that a copied image survives changes to the
source file and a change of event sender, and that cleanup removes the
copy while preserving the source. Verify that queueing a submission still
leaves the copy eligible for cleanup.

GitOrigin-RevId: 36d51af242901306be0ff319949d26a01ca71200
2026-11-27 20:36:59 +00:00
jif 045a11fe2c Respect sandbox read restrictions in remote plugin approvals (#64369)
## Why

Remote command approvals could attribute a command to a plugin by reading
a script that the turn's filesystem permissions denied access to.

## What changed

Use the remote environment's sandbox policy and stored permission grants
when resolving script paths, checking file metadata, and reading scripts
for approval attribution. If the lookup is denied, the approval prompt
still appears without plugin attribution.

## Testing

Add a regression test that checks for an approval prompt without a plugin
ID or script path when either the environment policy or a stored turn
grant denies reads of an otherwise matching plugin script.

GitOrigin-RevId: 123fd72c14cd31121d271fa800f005d3fc41a366
2026-11-27 19:09:58 +00:00
jif 005a57e890 Interrupt running commands promptly when approval is canceled (#64368)
## Why

Recording a declined command can block on history writes. If turn
cancellation waits for that write, sibling commands can keep running.
The same write can also delay recording results from commands that
already finished.

## What changed

Signal cancellation before recording the declined command and publish
the decline before `TurnAborted`. Start the task's shutdown grace period
after publication so it has time to record completed tool results.

## Testing

Add a regression test that blocks publication of the decline, verifies
that a running sibling stops while publication is blocked, and checks
that another sibling's completed output reaches the next model request.

GitOrigin-RevId: c0b2e40e711ffe5ee46b76b110410518d2191041
2026-11-27 19:08:45 +00:00
jif 187f00e805 Finish approved remote one-shot commands after startup interruption (#64367)
## Why

Interrupting an approved one-shot command while remote plugin attribution
is pending can stall session shutdown and leave the command without a
terminal record. An open elicitation can also delay output collection.

## What changed

On interruption, skip the pending remote attribution lookup and optional
plugin metrics read, and bypass the elicitation pause during output
collection. Keep session history open until the command's terminal event
is published, including when the exit watcher publishes it.

## Testing

Extend the remote startup interruption test to cover resumable commands
and approved one-shots. Verify process termination and session shutdown
with the attribution request still pending, and check that the approved
one-shot records exactly one failed completion with an unrelated
elicitation still open.

GitOrigin-RevId: e9b78290544d634797876119006540150a7672b1
2026-11-27 18:55:47 +00:00
jif 18c09f20ce Share tool approval logic across initial attempts and retries (#64355)
## What changed

Build `ApprovalContext` and submit approval requests through shared
code. Retry requests add the retry reason and any network approval
context, while the initial request retains its approval source for
later execution decisions.

GitOrigin-RevId: a8210c7b32fcc1414141198bdacfe55fff39b9b6
2026-11-27 17:04:35 +00:00
jif 30ffdd0619 Preserve command approval items through turn interruption (#64349)
## Why

The app server could show a command awaiting approval before core had
recorded its start. Interrupting the turn or abandoning launch after
approval could leave the live command item and saved history out of sync.

## What changed

Have core publish the command item before prompting for approval and
retain it across approval and sandbox retries until execution takes over.
Complete abandoned items as declined when interrupted while awaiting
approval, or as failed when interrupted after approval but before launch.
Wait for pending approval item writes during shutdown.

## Testing

Extend the app-server interrupt test to restart the server and verify
that the interrupted turn contains exactly one declined command item with
the original approval item ID.

GitOrigin-RevId: c9f027fc7096d091dc8cf1936c88aa69d3eed8c1
2026-11-27 16:25:10 +00:00
jif c8cb4e36ed Drain unified exec launch failure events before session shutdown (#64346)
## Why

A launch failure can still be publishing its command events after the turn
is interrupted. If the session shuts down during publication, the failed
command can be lost from persisted thread history.

## What changed

Track in-flight launch failure publications and wait for them to finish
before running session-end hooks and emitting the thread-stop event.
Once shutdown closes the tracker, skip new launch failure publications.

## Testing

Add a regression test that pauses publication for a command with a missing
working directory, interrupts the turn, and requests shutdown. It checks
that shutdown waits and that persisted history records the command as failed
in the interrupted turn.

GitOrigin-RevId: 1fb33d1fd3c11939c0013f5feb4edb737702b0ad
2026-11-27 15:57:38 +00:00
Felipe Coury 1a1f005766 Gate hosted Guardian test helpers to non-Windows builds (#64345)
The hosted Guardian scenarios are already excluded on Windows, leaving
their reload and stall helpers unused in Windows test builds.

Apply the same platform gate to the `Reloaded` and `Stalled` read modes
and the stall notification. Make the root snapshot mutable only in
the reload branch.

GitOrigin-RevId: 1f517e56ba6ce436b96c6e44c4dc4731b94e1e97
2026-11-27 15:45:48 +00:00
jif 6bf1e3e687 Persist command completions when approval is declined or fails (#64341)
## Why

The app server completed command items for rejected approval responses
directly in the live stream. That bypassed core's history recording, so
clients could see a completed command live and lose it when reloading
the turn.

## What changed

Keep top-level command items with their pending approvals in core.
Record and emit the command completion before unblocking the turn.
Declines and cancellations produce a `declined` item, while invalid
responses and approval request failures produce a `failed` item.

## Testing

App-server integration tests cover cancellation, decline, and malformed
responses. They check that `item/completed` precedes `turn/completed`
and that paginated history returns the same command item after restart.

GitOrigin-RevId: d3d95272c8a6af2fa65fa980f312260313cc5e32
2026-11-27 15:31:18 +00:00
jif 57b493a648 Compute the Responses WebSocket privacy flag before building the request (#64324)
GitOrigin-RevId: bced2fd4db353e13da74ae50707d4d8e3e640259
2026-11-27 12:43:46 +00:00
jif 181d051417 Fix lifecycle hook dispatch for hosted subagents (#64310)
## Why

Hosted workers keep the host's session source, so hook dispatch
can mistake them for root sessions and run `SessionStart` and
`Stop` on worker turns.

## What changed

Recognize host-managed workers by their inherited session ID and
dispatch `SubagentStart` and `SubagentStop` for them. Resolve the
parent transcript for `SubagentStop` using the immediate parent
thread ID when available.

## Testing

Add a regression test that verifies a hosted worker runs only the
subagent lifecycle hooks, receives start-hook context, and reports
its own transcript and final message in the stop hook.

GitOrigin-RevId: 272d29d275120a1b020b1a00a0db2e00402ebe06
2026-11-27 11:13:25 +00:00
Eric Traut afe555b9d3 Resolve Command Center worktree groups in the background (#64259)
## Why

Git lookups for saved session directories can stall the Command Center
when a filesystem mount is slow or unresponsive.

## What changed

Group sessions by their saved working directories immediately. When
worktree support is enabled, resolve local paths with up to four
background workers and refresh the view as grouping changes arrive.
Reopening the Command Center retries completed lookups without
duplicating pending work.

## Testing

Extend the worktree grouping test to check that the initial view shows
directory groups, related worktrees regroup under their project, and
the selected session stays selected.

GitOrigin-RevId: c1411749c9db31dec5827c78cb89fe94255f0c7e
2026-11-27 05:03:45 +00:00
Felipe Coury cd30214700 Open /diff in a TUI sidebar tab (#64258)
## Why

The full-screen diff pager takes the conversation off screen. A sidebar tab lets users review working-tree changes alongside the conversation.

## What changed

- Open a read-only `Diff` tab when the sidebar is available, and fall back to the full-screen pager otherwise.
- Reuse the tab on repeated runs. Keep the previous patch visible while Git runs, preserve the reading position on refresh, and apply only the latest result without stealing focus.
- Render large patches in chunks and derive scroll indicators from visible rows so redraws can skip layout of the off-screen tail.

## Testing

Cover tab reuse, stale result handling, and the visibility of the last hunk across resize and refresh. Verify that scroll indicators render without laying out the off-screen tail.

GitOrigin-RevId: 812ea99896dfd3131af9cf356cb844f4f0f7c267
2026-11-27 04:54:59 +00:00