Commit Graph
14340 Commits
Author SHA1 Message Date
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
Felipe Coury fe6dca3422 Keep the TUI status timer ticking with animations disabled (#64256)
## Why

With animations disabled, the status row did not request redraws for
the standard elapsed timer. The displayed time could stay stale until
another event triggered a redraw.

## What changed

Schedule redraws for a static status row at the next whole second of
its displayed elapsed time. Skip clock redraws while the timer is paused
unless a phase-specific display clock is still running. Active visual
effects continue to request frames every 32 ms.

## Testing

Cover redraw scheduling with animations disabled and with static or
animated headers. Check tick timing across pause, resume, and phase
overrides, and snapshot the paused elapsed display.

GitOrigin-RevId: f3ccb534316d72f49c0d28818931bf8fd2a85f9b
2026-11-27 04:22:28 +00:00
Felipe Coury c7005a3d84 Render local Markdown images inline in TUI replies (#64254)
## Why

Markdown image references in assistant replies showed only their alt text,
so users had to open the referenced file to see the image.

## What changed

- Show previews in place of alt text in rich transcript views on supported
  terminals, including in side conversations. For example,
  `![Build chart](./chart.png)` can display the chart directly in the reply.
- Confirm that the conversation uses a local workspace before loading
  visible images off the render thread. Keep alt text as the fallback
  when a preview is unavailable, and preserve it for copying and Find.

## Testing

Add a transcript snapshot covering inline placement and fallback text,
plus tests for selection across previews, text-only Find layout, and
terminal image sizing.

GitOrigin-RevId: 6a3473d340b8771066d1f249f3d3363e1ca9f3bd
2026-11-27 04:03:51 +00:00
Felipe Coury 0ea76be91e Restore hidden sidebars with the workspace shortcut (#64253)
## Why

The sidebar shortcut can hide an open sidebar, but pressing it again
can fail to bring back the content the user was viewing.

## What changed

Make the default `Ctrl+X`, `s` shortcut restore hidden sidebar content
and show “Restore sidebar” in the shortcut guide. Hide the previous and
next tab hints when there is no other tab to switch to, and show “Pane
right” when focus can move from the main pane to an open sidebar panel.

## Testing

Extend the sidebar tests to verify that the shortcut restores the same
document with its updated text. Snapshot the restore hint and the
directional hints shown when switching focus between panes.

GitOrigin-RevId: 1093039deb8390ca532ae00613c7c0e7ceb29b5c
2026-11-27 04:02:55 +00:00
Eric Traut bee5dc55ac Clear stale turn and review state when the TUI resumes (#64236)
## Why

Persisted history can still show a turn as in progress after its task
has stopped. A review interrupted by a crash can also lack an exit
event, leaving the resumed TUI in review mode.

## What changed

- Treat in-progress turns as interrupted when legacy or anchored resume
  history reports a non-active thread. Preserve in-progress turns on
  unanchored pages, which can include a turn started after the status
  was read.
- Reconcile buffered thread status updates during resume. An idle update
  clears activity restored from history while preserving newer live
  turns and retaining elapsed time for a later completion event.
- Reset review state when replay reaches an interrupted turn and end
  review mode at the same boundary when backtracking.

## Testing

Extend resume and replay coverage for stale and live turns, buffered
idle updates, and elapsed time when completion arrives after idle.

GitOrigin-RevId: ac46b271e86960e7e7b7e81d1c45f7ef655118fa
2026-11-27 01:14:33 +00:00
Eric Traut ad0ab3d832 Fix fd search summaries in the terminal UI (#64235)
## Why

Depth values in commands like `fd -Hd 1 . repro/scripts` can be
mistaken for search queries, obscuring the actual pattern and directory
in the exploration summary.

## What changed

Skip values for supported `fd` options, including depth options and
grouped short options that take a separate value. Preserve positional
arguments after `--` so patterns that start with a dash are recognized.

## Testing

Add parser cases for depth options, grouped flags, and dash-prefixed
patterns. Extend the exec history test to check that an `fd` command
with depth, type, and extension filters displays `Search . in scripts`.

GitOrigin-RevId: d6e2ab4f0cdb35b0715ef3484ff97856268c9437
2026-11-27 01:03:55 +00:00
Eric Traut b9e830fb98 Consolidate TUI tests and prune snapshots (#64232)
## What changed

- Use table-driven tests for Markdown file links, credit display, and text
  truncation so related cases share setup and assertions.
- Combine checks for history search deduplication and boundaries, Vim cursor
  movement with arrow keys and `hjkl`, and status-line previews that mix runtime
  values with placeholders.
- Remove standalone tests and snapshots, including the Windows paused-goal
  footer snapshot, while retaining the test that checks Esc pauses the goal.

GitOrigin-RevId: b508e7d46e81451186b04d4d9e9d3557596e04c3
2026-11-26 22:54:05 +00:00
Felipe Coury 588439645d Render matching file link labels once in the TUI (#64230)
## Why

Markdown file links can repeat the same path in the transcript. For
example, `[docs/guide.md](docs/guide.md)` renders as
`docs/guide.md (docs/guide.md)`.

## What changed

When a file link's visible label matches the displayed destination, use
the label as the clickable path and preserve its inline formatting. When
the label differs, keep the destination in parentheses so details such as
line anchors remain visible.

## Testing

Extend rendering snapshots for relative paths and line anchors, check
hyperlink ranges in narrow tables, and cover copying selections from
formatted file link labels.

GitOrigin-RevId: ade81a85e0dfe336d630388bd586634d0a80357f
2026-11-26 22:43:36 +00:00
Eric Traut c587ff1f0b Keep MCP startup from showing the TUI as working (#64221)
## Why

MCP startup could show `Working` before a user turn began, and
reloading MCP servers could temporarily hide an unread `Done` status.

## What changed

Derive the terminal program status from user turn activity, active
goals, blocked states, and the stored turn result.

## Testing

Extend the status regression test to check that the TUI stays idle
while MCP starts, reports `Working` when a turn begins before MCP is
ready, and keeps `Done` visible throughout an MCP reload until the
result is acknowledged.

GitOrigin-RevId: f05fab26e54e610743f0f799ef30306835d5cbdd
2026-11-26 21:46:36 +00:00
Felipe Coury 4e19f0f20b Focus the sidebar chooser when clicking empty space (#64219)
## Why

With the composer focused, clicking below the sidebar file list left
keyboard focus in the composer. This made it harder to resume keyboard
navigation from the current selection.

## What changed

An unmodified left-click on a non-interactive area of the chooser now
moves focus from the composer to the sidebar.

## Testing

Extend the sidebar file path test to click below the file list and verify
that the sidebar regains focus and the path shortcut still works for the
selected file.

GitOrigin-RevId: dbae18a87bc6516dcb8672c0c8c7bb4b9b9ea505
2026-11-26 21:08:29 +00:00
Eric Traut df06542138 Fix Unicode highlighting in fuzzy file search (#64214)
## Why

The fuzzy matcher reports grapheme positions, but the terminal file picker
uses Unicode scalar offsets. When a path contains a joined emoji or a
combining mark, the picker can highlight the wrong characters.

## What changed

Let callers choose the unit for match indices. The terminal and CLI use
scalar offsets that cover every scalar in each matched grapheme. The
terminal's file picker and mention renderer now consume the same offsets.
The app server returns grapheme offsets for both one-shot and streaming
searches.

## Testing

Add regression coverage for basename and full-path matches with joined
emoji and combining marks, grapheme offsets in both app-server search
modes, and terminal highlights in file and mention results.

GitOrigin-RevId: 2da357a404396550333c785640d2c4121cb2ed3f
2026-11-26 20:37:00 +00:00
Felipe Coury c13a107f0e Open and highlight file line ranges in the TUI (#64211)
## Why

A single-line jump doesn't show where a referenced block of code ends.

## What changed

Recognize file ranges such as `src/search.ts:42-44` and
`src/search.ts#L42-L44` in Markdown links and bare prose. Opening a range
in the sidebar jumps to its start and highlights every line through its
end, including wrapped rows and blank lines. If the link specifies a
starting column, mark it too. Pressing `Esc` can clear the highlight,
and it stays cleared across reloads.

Keep each wrapped link as one keyboard navigation stop, even when
fragments from different links share a table row. Preserve hidden range
destinations when copying Markdown.

## Testing

Add coverage for malformed and out-of-bounds ranges, mouse and keyboard
navigation across wrapped links, Markdown copying, and highlight rendering
across terminal palettes.

GitOrigin-RevId: 1171533053e92a61de01f90f248c58b059b3ae32
2026-11-26 20:24:42 +00:00
Felipe Coury 475e13ab1a Save and cycle through side chats in TUI scrollback mode (#64207)
## Why

Scrollback mode could switch between a parent conversation and a live side
chat, but it could neither save side chats nor reopen them after resuming
the parent.

## What changed

- With the TUI workspace feature enabled and a compatible local backend,
  save new scrollback side chats as attached threads. Use `Ctrl+/` to
  discover saved chats and cycle from the parent through them and back.
- Show the current side chat's position and loading status. Keep input in
  the source draft while a switch is pending, and let `Esc` cancel it.
- Delete the parent and its saved side chats in one `thread/delete`
  request. The experimental `savedSideChatIds` parameter lets the server
  verify that each requested chat belongs to the parent and check for
  blocking attachments before deleting anything.

## Testing

Add coverage for cycling after resume, preserving pasted drafts during a
pending switch, and limiting parent deletion to verified saved side chats.

GitOrigin-RevId: 7c797f1b69dff73ff0343eb73dd3c048e856b319
2026-11-26 19:54:18 +00:00
Eric Traut a9d7206f8f Batch terminal writes when inserting TUI history (#64204)
## Why

Line-buffered stdout can flush on every newline during a long history
replay, turning a batch of history rows into many small terminal writes.

## What changed

Use a bounded buffer to group history writes in both standard and
full-screen modes. Drain the buffer to the terminal backend without
explicitly flushing stdout.

## Testing

Add a regression test that inserts 500 rows in each mode and checks that
fewer than 50 backend writes contain newlines, the final row appears
directly above the viewport, and the cursor returns to its original position.

GitOrigin-RevId: c33a13fc71307a3f71be5e266e04c0160c34a8b3
2026-11-26 19:35:46 +00:00
Felipe Coury 58cb1ccf8d Smooth transitions between TUI reasoning headings (#64202)
## Why

Streaming reasoning summaries can replace the status heading before the
current line finishes, making fast updates hard to read.

## What changed

With shimmer active, sample the latest usable reasoning heading every
3.5 seconds while letting the visible line finish as its text arrives.
Fade out the previous heading and reveal the next one across the visible
terminal columns. Retry messages still appear immediately, and reduced
motion and unsupported terminals keep the static display.

Use the same prepared frame for layout and rendering so the status row
can reflow when the heading changes.

## Testing

Cover chunks that finish one heading and start another before a draw,
delayed frames, and split Markdown bold markers. Snapshot the transition
in light and dark themes and verify that hook status text reflows at the
fade boundary.

GitOrigin-RevId: 63c579602f030f461ac81c4841106b29755710b1
2026-11-26 19:16:52 +00:00
Eric Traut d7ebabf7b7 Fix TUI prompt editing with partially loaded history (#64199)
## Why

A late result from an earlier turn can appear on a loaded transcript
page even when that turn's prompt and prompts from intervening turns
are still unloaded. Counting prompts from a single history boundary can
then map a visible prompt to the wrong turn. Rewinding can also remove
that late result, leaving a stale boundary for the next edit.

## What changed

Resolve prompt selections against the loaded items in each turn,
including turns with no loaded items. After a rewind, refresh the
retained transcript items from app-server so the next edit uses
boundaries that still exist.

## Testing

Cover selection of a visible prompt whose text matches an unloaded
prompt, and extend the in-place editing scenario to exercise a second
rewind after the first removes a late item.

GitOrigin-RevId: 53ec2595a56b45c2fc1077a94338215b4b0b7382
2026-11-26 18:47:00 +00:00
Felipe Coury bdc0764660 Preserve TUI row shading across redraws in Apple Terminal (#64195)
## Why

Apple Terminal can lose the background color of spaces painted by an erase
sequence when a later redraw clears part of the same row.

## What changed

Print spaces with a non-default background as styled cells. Use
clear-to-end-of-line only for trailing blanks with the default background.

## Testing

Add a VT100 regression test that narrows a shaded row and checks that the
remaining shading includes the message's trailing spaces.

GitOrigin-RevId: 5c9ba7b7ad79f827d74cc4cc618142375cb6abb6
2026-11-26 18:19:55 +00:00
Felipe Coury f229915597 Keep TUI tool calls grouped across hidden reasoning (#64193)
## Why

A hidden reasoning summary between commands can split them into separate
tool groups even though the transcript shows nothing between them.

## What changed

Skip transcript-only reasoning summaries when grouping tool calls.

## Testing

Add a snapshot test that checks a completed `just lint` and a running
`just test` appear in one two-call group across a hidden reasoning summary.

GitOrigin-RevId: 3829394047981a66ad358ecc32addfc213e5f927
2026-11-26 18:05:21 +00:00
Eric Traut 1f9549e265 Support PRIMARY selection in Wayland sessions (#64192)
## Why

The TUI disabled PRIMARY whenever `WAYLAND_DISPLAY` was set, so it
couldn't publish selected text to PRIMARY or paste from it with a middle
click in Wayland sessions.

## What changed

Probe Wayland PRIMARY support in the background and use the result for
selection copying and middle-click paste. If the compositor lacks the
Wayland data-control protocol, allow XWayland fallback only when the
Wayland and X11 sockets have matching listener credentials.

## Testing

Add a unit test covering native Wayland support, the same-session
XWayland fallback, remote X11 displays, and unsuccessful probes.

GitOrigin-RevId: 9b5c1536762383c0fe770dd86d58a49a1f3633a8
2026-11-26 17:55:06 +00:00
felixxia-oai 58961aa3a2 Configure Guardian V3 shadow reviews from the root thread (#64187)
## Why

Shadow reviews used default routing and retrieval instructions even when
the root thread supplied Guardian V3 settings.

## What changed

- Replace `features.guardianv3_shadow` with
  `features.guardianv3.shadow_enabled` to opt into shadow reviews alongside
  Guardian V2. Project config cannot set the toggle, and feature
  requirements can override it.
- Use the root thread's routing instructions, retrieval instructions, and
  board size limit for its shadow board. Child reviewers share the root's
  board and retrieval instructions.
- Keep shadow boards in memory and skip shadow reviews when
  `features.guardianv3.message_board_in_memory` is explicitly false.

## Testing

Add coverage for shadow-only opt-in, config precedence, in-memory
enrollment, and root routing and retrieval instructions.

GitOrigin-RevId: 085089d70a66c535a86d31906ff59a449ffcb61f
2026-11-26 17:16:53 +00:00
iceweasel-oai a705e0bb69 Add metrics for Statsig updates and evaluations (#64184)
## Why

A Statsig gate can return `false` while bootstrap is in progress or
because the cached evaluation is disabled. Update failures also share
a generic debug message, which makes recurring failures hard to diagnose.

## What changed

Record OpenTelemetry counts and durations for bootstrap and refresh,
tagged by outcome and failure category. Record gate and dynamic config
counts after successful updates. Skip update metrics while waiting for
authentication.

Count gate and dynamic config reads by name, kind, and reason. Use fixed
reason labels to distinguish fallback reads from evaluated reads while
keeping targeting values out of the metrics.

## Testing

Check that a gate read during bootstrap and a read after bootstrap emit
distinct reasons, and that wrapped network policy denials retain the
`policy` category.

GitOrigin-RevId: ca4a248ee8ec7ed1318b2b2d320b9e9df08cbe5e
2026-11-26 16:57:11 +00:00
jif dd6d2c3d66 Test and document MCP message board notification delivery (#64179)
## Why

The app-server integration test covered delivery from detached boards.
The automatic in-memory board uses a separate delivery path through the
host's `notify` callback.

## What changed

Document callback delivery for the automatic launcher and explain how
runners with a separate app-server can use `AppServerNotifications` with
`launch_in_memory_with_app_server` to deliver notices through
`thread/inject_items`.

## Testing

Extend the integration test to post through the automatic in-memory
board alongside the detached SQLite and in-memory boards. Assert that
each notice appears exactly once in the intended worker's model requests
with the expected sender, recipient, and payload.

GitOrigin-RevId: e2f4beefb80702e6ad75e7999294a7705db2c856
2026-11-26 16:06:46 +00:00
felixxia-oai d0b140efb5 Cap evidence stored on Guardian v3 shadow boards (#64166)
## Why

Shadow routing can store the same evidence in multiple channels. A per-root
limit bounds how much evidence each shadow board accumulates.

## What changed

- Default to 32 MiB of serialized evidence per root shadow board and count
  each stored channel copy. Allow users to set
  `features.guardianv3.shadow_board_limit_mib` in user config. Ignore project
  overrides of the limit and discard positional Guardian v3 project settings
  that could bypass filtering for user-only fields.
- Reject batches that would exceed the limit before creating channels or
  appending posts. Skip the routing call when even one copy of the first
  source would exceed the remaining budget.
- Signal root and child shadow reviewers when intake stops, independently of
  reviewer cancellation. Record channel counts, post counts, and evidence
  bytes after successful batches, and tag worker failures by stage.

## Testing

Tests cover byte accounting across distinct destinations, overflow before and
after routing, an unchanged board after a rejected batch, intake stop signals
for root and child reviewers, and project config filtering.

GitOrigin-RevId: 9d908ceb6f33ba69eed2a07223b3f9177afbe11e
2026-11-26 15:22:56 +00:00
Charlie Marsh 42c320991e Add compact filesystem context for workspace-write profiles (#64164)
## Why

The filesystem context sent to the model repeats the same generated
read-only metadata entries under each writable path.

## What changed

Add the opt-in `features.compact_filesystem_context` flag. For matching
workspace-write profiles with multiple writable paths, list workspace
roots and other writable paths separately, then state the shared
read-only rule for `.git`, `.agents`, `.codex`, and `.aws` once.
Keep temporary-directory write grants explicit and use the full listing
for profiles with rules the summary cannot represent.

## Testing

Cover compact rendering and fallback for explicit metadata reads or
Windows paths with different casing. Snapshot shared and per-environment
context across two turns to verify that unchanged permissions carry
forward.

GitOrigin-RevId: 4e9f36a054a96f06c9e5d0b3882148b132233e4f
2026-11-26 15:09:58 +00:00
ioanbudea-OAI 61369c4e95 Verify manual approval provenance in Guardian transcripts (#64160)
## Why

Guardian identified manual approvals by the opening text of a developer
message. Hook output could use the same opening text, and unrelated
content in the same message could be included with an approval.

## What changed

Check each developer text part before joining it into the transcript.
Require the manual approval prefix, the `guardian.approved_action` content
kind, and provenance from the harness outside of hooks.

## Testing

Transcript tests cover missing provenance and same-prefix text with hook
provenance or a different content kind. The context budget test checks
that the full manual approval stays ahead of a later user restriction
and that adjacent hook text is excluded.

GitOrigin-RevId: 64fafc3a429ce1e21eb5233c8223228947d1c20b
2026-11-26 14:29:37 +00:00
jif 7ca4eada90 Simplify tool executor lifetimes (#64159)
## Why

Extension tools borrow host capabilities for each call. Expressing that
borrow in the executor's type argument requires higher-ranked lifetime
bounds wherever extension executors are stored or returned.

## What changed

Define the per-call input as `ToolInput::Call<'a>` so `ToolExecutor`
can use the same lifetime for the input, the executor borrow, and the
returned future while remaining usable as a trait object. Default to
borrowed `ToolCall<'a>` inputs so extension contributors can return
`Arc<dyn ToolExecutor>`. Core handlers continue to take owned
`ToolInvocation` inputs.

GitOrigin-RevId: efbf56c1e758c59a18b192d210c2ab1b368793e2
2026-11-26 14:27:37 +00:00
swastik-oai ad7176f787 Use Guardian V3 to assess recorded tool calls (#64157)
## Why

`thread/guardianReview` used the transcript reviewer even when the app
server was configured to use Guardian V3 for live approvals. Recorded
calls can now be assessed with the same reviewer as live calls.

## What changed

When Guardian V3 is enabled at app-server startup, `thread/guardianReview`
waits for pending injected history to reach the Guardian board, then
returns a fresh assessment without executing the tool call or caching an
approval. When V3 is disabled at startup, the endpoint uses the
transcript reviewer.

V3 requires a fresh, idle, non-ephemeral root thread with paginated
history and rejects `rootEvidence`. Recorded browser calls receive the
same browser policy as live calls.

## Testing

Add coverage for sequential history batches without tool execution,
unsupported thread types, routing failures and timeouts, and preservation
of the initial denial when reconsideration stalls.

GitOrigin-RevId: a8ad15cd2bb2d6d5d105c672f64c6cc71dfc6ff8
2026-11-26 14:14:59 +00:00
jif 923c098613 Drop the child session during Statsig startup test cleanup (#64152)
After observing the expected Statsig request, drop the child session
before awaiting its exit. This uses the process handle's existing
cleanup to terminate the child and stop its I/O tasks.

GitOrigin-RevId: 17be552b74f7539ab46bbb4cb9dfa3bf9697ee08
2026-11-26 13:53:26 +00:00
jif 8727186a0a Test hosted root turn suspension before roster preparation (#64128)
Extend the hosted turn admission test to suspend the root turn both
before roster preparation and during the roster read. In the new case,
hold turn startup until suspension detaches the active task so the test
exercises the initial input handoff.

Both cases assert that the admitted prompt appears exactly once in
recoverable thread history and that no model request is sent.

GitOrigin-RevId: 51a3ca65a55fb3db4547e770c3bf49a3eee59521
2026-11-26 10:57:00 +00:00
Eric Traut af71942309 Resolve TUI image attachments relative to the file search root (#64071)
## Why

Selecting an image through `@` completion could fail when the file
search root differed from the process working directory. The composer
used the relative completion path to open the image.

## What changed

Use the full path from the search result to read and attach images in
both mention pickers. Keep relative paths for text insertion and check
that an image candidate is a regular file before opening it, so a named
pipe such as `pipe.png` is inserted as text without blocking the composer.

## Testing

Regression tests cover submitting an image from the search root in both
pickers and inserting an image-named pipe as relative text on Unix.

GitOrigin-RevId: f1d38f58dd431c3fb12b11ed35838f0b7bfa5674
2026-11-26 04:00:27 +00:00
Eric Traut 9e51c745e2 Prevent Kitty pet animation flicker in tmux (#64069)
## Why

In tmux, Kitty passthrough deletes can reach the outer terminal before
the pane updates its image placeholders. The fullscreen text redraw
can also clear those placeholders between animation frames.

## What changed

Alternate between two Kitty image IDs for the ambient pet and keep
the displayed image alive while its replacement is drawn. Reserve
both IDs alongside the picker preview so transcript images cannot
reuse them.

Preserve the pet's placeholder cells during fullscreen text redraws
that have a pet image pass, and keep clear-to-end-of-line commands
from erasing skipped cells.

## Testing

Extend regression coverage for image ID rotation and cleanup,
placeholder preservation, and visibility of the fork progress message.

GitOrigin-RevId: 58830b81c0cb18b4d3113e6b7b2ba401ae6aba31
2026-11-26 03:33:06 +00:00
Eric Traut cc6d3e5867 Fix code fence tracking in the TUI streaming preview (#64067)
## Why

A fence marker inside a blockquote can prematurely end an unquoted code
block in the streaming scanner, exposing code to prose preview and table
detection. Fence state can also linger when a blockquote ends exactly
where the next streamed chunk begins.

## What changed

Share fence parsing between Markdown rendering and the streaming scanner
so both use the same indentation and blockquote rules. Reset the table
scanner when it reaches the renderer's completed-block boundary, including
when both offsets are equal.

## Testing

Regression tests cover table-like text inside fenced code, prose and table
handling after adjacent quoted and unquoted fences, and table detection
after indented fence-like text.

GitOrigin-RevId: 071c7745a2e925ed44ab6d6f47bf53c3d4be6143
2026-11-26 03:30:34 +00:00
Eric Traut f79875c21b Fix Unicode fuzzy matching and slash popup activation (#64058)
## Why

Fuzzy matching lowercased candidates and queries differently, so Greek
sigma variants could fail to match. The slash-command popup could also
open for fuzzy matches that its exact and prefix filters never displayed,
taking over the arrow keys while the user was editing a draft.

## What changed

- Apply the same Unicode case folding to both sides of a fuzzy match and
  use it to rank exact and prefix matches in the skill popup.
- Use the same command list and case-insensitive exact and prefix
  matching rules to open and filter the slash-command popup.

## Testing

Cover Greek sigma and long s in the fuzzy matcher, snapshot skill
results with a folded exact match above a prefix match, and check that
the arrow keys move the cursor through a draft starting with `/ſtatus`.

GitOrigin-RevId: 04cf3a65b02204221569c4f7b2d4397f48554e2d
2026-11-26 02:42:20 +00:00