Commit Graph
3776 Commits
Author SHA1 Message Date
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
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
Felipe Coury 06023b038f Add mouse controls to hide and restore the TUI sidebar (#64055)
## Why

Hiding the sidebar through keyboard navigation leaves no visible control
for reopening it.

## What changed

Click `›` in the sidebar tab strip to hide the sidebar and return focus
to the parent conversation. Click `‹` above the main transcript to
restore the previous sidebar content. The restore control also appears
when the terminal is too narrow to show the sidebar alongside the main
conversation.

## Testing

Cover hiding and restoring side chats and document previews with the
mouse, including reopening a side chat at narrow terminal widths and
preserving the parent conversation's reading position.

GitOrigin-RevId: 1f0f893b736b61c109e0761abbe3bde3d388e1b6
2026-11-26 02:35:01 +00:00
Felipe Coury 57a49fc013 Refactor TUI sidebar chooser input handling (#64054)
## What changed

Move chooser handling from `side_focus.rs` into a dedicated sidebar input
module. Distinguish events the chooser consumes from events it leaves
unhandled and events that produce an action.

Check row visibility and guard against stale keyboard selections before
resolving an open action to an agent, retry row, document, existing
chat, or new chat.

GitOrigin-RevId: 681dadbb3b964fbb886795120fa28760cb11be9d
2026-11-26 02:34:20 +00:00
Felipe Coury 2a3f7da445 Extract TUI sidebar input routing into its own module (#64053)
## What changed

Move sidebar hit testing and mouse press tracking into `sidebar_input`.
Resolve pointer events before executing tab actions or dispatching input
to the visible document, subagent panel, or chooser.

Keep requiring the press and release to resolve
to the same target in the current sidebar state.

GitOrigin-RevId: a818dbfd53cbf79c97ae5036d3608c7d4d67da52
2026-11-26 02:33:41 +00:00
Eric Traut 5148e3d642 Show status for subagent waits without targets in the TUI (#64026)
## Why

The TUI showed “Waiting for agents” even when a wait had no agent
targets, and “Finished waiting” even when it failed or was interrupted.

## What changed

When a wait has no receiver thread IDs or agent states, show “Waiting,”
“Waited,” “Failed to wait,” or “Interrupted” according to its status.

## Testing

Extend the collaboration transcript snapshot to cover all four statuses
for waits without targets.

GitOrigin-RevId: 62097034b160852b5921d869e0a04737b69923f9
2026-11-26 00:46:20 +00:00
Felipe Coury 1d05b9851c Show Command Center shortcuts that match focus and input (#64025)
## Why

The Command Center can show action shortcuts while the conversation has
keyboard focus or while a search or rename field consumes those keys.

## What changed

Use the shared footer renderer to show a focus shortcut in the unfocused
Command Center and action hints when it has focus. Keep the editor cursor
in the active pane and hide header shortcuts when their actions are
unavailable. For example, the default `g` grouping hint disappears while
typing a search because `g` goes into the query.

## Testing

Extend the workspace navigation test to check the focus hint and cover
custom accept and grouping bindings during search and rename.

GitOrigin-RevId: a96a093b77b6ef04d717b542e30b041164d1210c
2026-11-26 00:33:01 +00:00
Felipe Coury dbb9b2e31e Show TUI shortcut hints for the focused pane (#64024)
## Why

The sidebar can stay visible while the conversation has keyboard focus.
Showing sidebar shortcuts in that state makes keys such as `Esc` look
like they act on the sidebar even when the conversation receives them.

## What changed

Hide keyboard hints in unfocused panes and show the configured shortcut
for focusing the sidebar when it is available. Keep mouse controls
clickable, including the file path view's Back button when its keyboard
binding is disabled. An unmodified left click in the file path body
focuses the sidebar.

Use configured pager bindings for reading and search hints. Watch-only
agent transcripts use single-key pager bindings because they handle
pager keys directly.

## Testing

Add coverage for file path focus and mouse controls, hint placement and
click targets in narrow panes, and pager hints in watch-only transcripts.

GitOrigin-RevId: 3d9375d957789c9f71f6e45f919f815713536622
2026-11-26 00:30:45 +00:00
Eric Traut 2055a99af4 Support numeric MCP elicitation fields in the TUI (#64023)
## Why

MCP forms with numeric fields fell back to a generic approval prompt,
where users had no way to enter the requested values. That prompt also
offered acceptance for forms whose required fields could not be filled in.

## What changed

- Render `integer` and `number` fields with schema defaults, validate
  minimum and maximum bounds, and submit answers as JSON numbers.
- Show the requesting server on forms, allow users to skip blank optional
  inputs with the submit key, and add `F6` to decline a form. `Esc` cancels
  the request.
- Explain when a form cannot be displayed and offer acceptance without
  answers only when the form has no required fields.

## Testing

Exercise invalid numeric input and defaults, exact large integer
submission, blank optional fields, and queue advancement after declining.
Snapshot the numeric validation error and the fallback prompts for
unsupported forms with and without required fields.

GitOrigin-RevId: 1dd65b78fb271a027d9ae479c6fc9754607189f2
2026-11-26 00:19:57 +00:00
Eric Traut 58b14699ec Keep interrupt guidance visible during TUI streaming (#64018)
## Why

Streaming output hides the working status row and its interrupt shortcut.
When a message without a phase finishes before the turn does, the status
row can also stay hidden while Codex is still working.

## What changed

Show the configured interrupt shortcut in the composer footer while output
streams and the status row is hidden. With the default binding, the footer
shows `esc twice to interrupt` in Vim insert mode.

Keep the status row visible through whitespace-only output. Restore it
after a message without a phase completes and the stream queues drain if
the turn is still running.

## Testing

Cover whitespace-only output, footer hints with a draft and in Vim modes,
hint layout at narrow widths, and status restoration before turn completion.

GitOrigin-RevId: 246180593baf2d6ead0e84634bf7bd8ee4ec3ea5
2026-11-25 23:35:26 +00:00
Eric Traut ad07f04e47 Show background command launches and late results in the TUI (#64015)
## Why

A background command can outlive the turn that launched it. Its result
could be dropped when no turn was active or appear as a separate
transcript entry if later output had already displaced its running row.

## What changed

- Show background commands as they start, including commands that don't
  match a recognized tool action. Keep tracking their exits after a
  turn ends or is interrupted.
- Update the original transcript row with the exit status and output,
  including when the command finishes in a parked side conversation.
- In rich terminal scrollback, label an unfinished launch `Started`.
  If the launch has already printed, append the result in order.
  Otherwise, replace the queued launch with the completed entry.

## Testing

Cover late exits after turn completion and interruption, completion
during a side conversation handoff, and result ordering behind queued
scrollback.

GitOrigin-RevId: 65f069af28c112078d85613da2c95e5c1c4f29bf
2026-11-25 22:54:56 +00:00
Eric Traut 2f83e4843f Surface session lookup errors in the TUI (#64014)
## Why

Looking up a session by ID treated every `thread/read` failure as a
missing session, hiding errors such as unreadable session metadata.

## What changed

Startup resume and fork report lookup failures after cleaning up the
app-server session. In an active TUI, `/resume` displays lookup errors
in the current chat or invokes transport recovery when applicable. If
a Cloud chat must be opened first, `/resume` directs the user to run
the command without an ID and select the chat from the picker.

## Testing

Add regression coverage for missing and unreadable sessions, preserving
the active session after a failed lookup, and showing picker guidance
for an unopened Cloud chat.

GitOrigin-RevId: dddac289a2959133809c050b8701975ab474ef13
2026-11-25 22:54:19 +00:00
Joe Savona 09b1cfd337 Add inline badges to custom statuslines (#64010)
Add a `badge` element to the statusline UI tree and TypeScript contract.
It renders one string as a padded, single-line label with normalized
whitespace. The optional `color` accepts `secondary` (the default),
`info`, `success`, `warning`, or `danger`. The renderer uses the
active theme for the label and blends the fill with the surrounding
background when its color is known.

Badges wrap as a unit. When a line limit requires an ellipsis after
earlier content, a trailing badge that cannot fit is dropped. At the
viewport edge, the right padding can clip while the full label remains
visible.

## Testing

Add rendering tests for wrapping, clipping, theme colors, and linked
badges, along with checks for UI tree limits and the TypeScript contract.

GitOrigin-RevId: be9e9799d6832976d325ba5fda48f5793dbbc722
2026-11-25 22:51:53 +00:00
Joe Savona 8d8de8f693 Add flexible spacers to custom statusline layouts (#64009)
## Why

Statusline authors can set fixed gaps or justify a whole row. An expandable gap lets them place a field at the far edge by putting a spacer between it and the other fields.

## What changed

Add the empty `spacer` element to the statusline renderer and its bundled TypeScript contract. Spacers share the remaining width on each wrapped row line before `justify` is applied. In columns stretched by a taller sibling, spacers share the added height.

## Testing

Add renderer tests for wrapped and nested layouts, background fill, and clipping. Cover empty spacer declarations and reject spacer children in the parser and TypeScript contract tests.

GitOrigin-RevId: d8bb58304b2a1f10ac0c60ec198aa3c25a169cae
2026-11-25 22:51:18 +00:00
Joe Savona 163c555f18 Add a directional box element for custom status lines (#64008)
## What changed

Custom status lines can choose between row and column layouts by setting
`direction` on a `box`. Omitting `direction` stacks children in a column.
Both layouts require `gap`, and only rows accept `wrap` and `justify`.

Horizontal boxes group adjacent strings into one layout item even when
`justify` is omitted. Use separate elements to insert a gap between
text items.

## Testing

Add renderer tests for default column layout, wrapping and alignment in
rows, and spacing around empty boxes. Extend the TypeScript contract
checks to cover dynamic direction, required gaps, and rejection of
row-only props on columns.

GitOrigin-RevId: 3ff9b4a8be6ae79b90512c1ad1ec1c16dafad0cf
2026-11-25 22:50:40 +00:00
Joe Savona b8498ada1c Add maxLines to statusline text blocks (#64007)
## Why

Long statusline text can wrap across enough lines to push fields below it out of view.

## What changed

Set `maxLines` to a positive safe integer to cap a text block after wrapping. If content exceeds the cap, the last visible line ends with an ellipsis when space permits. Long words can break at grapheme boundaries so a clamped block can shrink alongside other fields.

## Testing

Cover invalid limits, visibility of neighboring fields, and truncation that preserves whole graphemes and leaves the ellipsis outside hyperlinks.

GitOrigin-RevId: 42f57b3f92e81860f888b733ce6121bb94dc78c3
2026-11-25 22:50:04 +00:00
Eric Traut 897d47ac95 Batch native scrollback replays during history refill (#64005)
## Why

Refilling terminal scrollback can take several history pages. Replaying
scrollback after each page rebuilds it while more history is still loading.

## What changed

Buffer older pages while the next page is loading, then replay them together
when the refill finishes. Flush buffered history if a page request fails,
the transcript overlay opens during the refill, or the five-second deadline
from the first buffered page expires. The overlay still updates page by page.

## Testing

Extend the scrollback refill test to cover batching across pages, replay
after a page failure, and replay at the deadline with a request still pending.

GitOrigin-RevId: 577b9f7394e2741267099e4595f69345a6a70a21
2026-11-25 22:48:50 +00:00
jif 9b6a7e3d0e Update the TUI thread replay snapshot to include composer borders (#64004)
GitOrigin-RevId: ba97eedebbe9558cd698f0af4955a16c3041c5aa
2026-11-25 22:48:14 +00:00
iceweasel-oai f39c3c78d7 Initialize Statsig feature gates across Codex launch modes (#64001)
## Why

Enabling `statsig_gates` can only load evaluations if the process starts
the Statsig runtime. Several Codex entry points never started it.

## What changed

Start Statsig in standalone and embedded app servers, the TUI when it
connects to a separate app server, eligible `codex sandbox` launches, and
local and remote exec servers. This also covers `codex exec` through its
embedded app server. Use the serving or local account where applicable
and installation identity for remote execution. Share the runtime with
the embedded TUI and flush it on normal shutdown.

## Testing

Add a CLI integration test that checks which evaluation endpoint each
launch mode requests, including signed-in and signed-out sandbox launches.
Supply a bundled fixture key in Bazel and nextest CI builds so the test runs.

GitOrigin-RevId: 64df9933c1a9783a86be8712fa012b495f34b0f8
2026-11-25 22:46:26 +00:00
Felipe Coury b420c7ca54 Preserve sidebar clicks when the terminal gains focus (#63999)
## Why

A terminal can report a focus gain between mouse-down and mouse-up.
Clearing the pending sidebar press on that event causes the release to
be ignored, so clicking the tab chooser's close button can fail to open
the confirmation dialog.

## What changed

Keep the pending sidebar press on `TuiEvent::FocusGained` so the mouse
release can complete the click.

## Testing

Extend the tab chooser test to send a focus gain between the press and
release and check that the close confirmation dialog appears.

GitOrigin-RevId: 4173292c50383304e9ef62104251434be7580789
2026-11-25 22:45:11 +00:00
Felipe Coury fd95d89146 Skip reasoning effort animations during TUI thread replay (#63998)
## Why

Switching back to a thread restores its current settings before replaying
older updates. Those updates can trigger reasoning effort animations and
leave the status line temporarily showing an older effort level.

## What changed

Set the composer's reasoning effort baseline before refreshing it for
each replayed settings update. The status line reflects the replayed
effort immediately, and live changes still animate.

## Testing

Add a regression test that replays earlier effort changes after restoring
a thread, checks the displayed effort, and verifies that a subsequent
live change starts the animation.

GitOrigin-RevId: 3daadc7b8b5917eba1055940c67399b8ab729eda
2026-11-25 22:44:36 +00:00
Felipe Coury 03f4f4e6b7 Make TUI workspace divider drags more responsive (#63997)
## Why

Rapid mouse motion can queue more drag reports than the TUI needs to
resize a pane. Rebuilding sidebar document layouts at each preview width
also adds work while the divider moves.

## What changed

- Share drag handling between the Command Center and sidebar dividers.
  Let users grab either column of the Command Center gutter, keep the
  grab offset, and highlight the divider on hover and during a drag.
- Use the release position for the final width. If focus loss interrupts
  a valid drag, keep the last width. When the terminal holds image pixels,
  show a guide and defer pane reflow until the drag ends.
- Batch consecutive mouse motion reports during divider drags while
  preserving input order at batch boundaries. Rewrap cached sidebar
  document content during live previews and rebuild its layout at the
  final width.

## Testing

Cover gutter hit testing, grab offsets, release and focus-loss behavior,
drag batching at input boundaries, and document layout reuse during
preview followed by a rebuild.

GitOrigin-RevId: 949a805a42d269f4bac1a86ac7e4b7f8c2a4cacf
2026-11-25 22:43:58 +00:00
Felipe Coury 76696132f0 Fix clipboard notices in the transcript overlay (#63996)
## Why

Copying a whole message can leave the overlay showing “Copying selection…”
because the copy has no active selection to receive the clipboard result.

## What changed

Track which clipboard request owns the notice so its completion can show
success or failure even without an active selection. Older results leave a
newer notice intact.

Track the last rendered transcript width for resize detection and render
prewrapped rows without hyperlinks using Ratatui’s `Paragraph`.

## Testing

Add a snapshot test that checks pending, failure, and success notices
without a selection, verifies that an older result leaves the notice
intact, and confirms the overlay stays open.

GitOrigin-RevId: c4076ccc425240ca39af9fd5c8cf6fca96303dda
2026-11-25 22:43:24 +00:00
Eric Traut db360f8b00 Suppress Kitty graphics replies on every pet image chunk (#63992)
The first chunk of a Kitty pet image upload already requests quiet mode,
but continuation chunks omit that setting. Send `q=2` on every
continuation chunk, including the final one, to suppress terminal replies
throughout the upload.

## Testing

Extend the command snapshot test to check the headers of a three-chunk
upload, including the final `m=0,q=2` header.

GitOrigin-RevId: cd12c3e6f4c27320c4823f593657ab92824c83ff
2026-11-25 22:40:59 +00:00
Felipe Coury ceed625df9 Keep TUI tool groups independent when results arrive late (#63989)
## Why

When a command or tool finishes in a different transcript group from where it
started, both groups can share an identity. The later group can inherit the
original group's expanded state or steal its keyboard focus.

## What changed

Assign distinct identities to repeated tool activity in chronological order.
Keep those identities stable as the live transcript updates and results move
into history, so each group retains its own expansion state and focus.

## Testing

Add regression tests for a command that finishes after assistant commentary
and an MCP tool that returns an error in a later turn.

GitOrigin-RevId: ca69a68bb32746bdbe22ec7bc9633e4323f38347
2026-11-25 22:39:45 +00:00
Eric Traut 590be70f75 Fix pasting packed bitmap images on Windows (#63888)
## Why

When a packed `CF_DIBV5` bitmap stores pixels immediately after its
header, the clipboard decoder skips the first three pixels as if they
were additional color masks. This can cause a short read or shift the
image when the clipboard buffer includes trailing padding.

## What changed

For supported 32-bit `CF_DIBV5` bitmaps, supply an explicit BMP pixel
offset and enforce the decoder's allocation limits. Keep PNG as the
preferred clipboard format and handle bitmaps that repeat the color masks
before the pixels.

## Testing

Add a regression test for packed, padded, and repeated-mask bitmaps that
checks decoded RGBA values and allocation limits. The test also covers
missing pixel data.

GitOrigin-RevId: 7bb47a180584633c8a3f47c909b0e291d0003020
2026-11-25 11:50:14 +00:00
Felipe Coury 600595d67c Wait for subagent transcripts before enabling sidebar selection (#63887)
## Why

The sidebar can learn about a subagent from live activity before it can
open the transcript. During that gap, the chooser can offer a row whose
transcript is still unavailable.

## What changed

- Start transcript discovery when the TUI observes subagent activity
  and retry when the chooser opens with disabled rows.
- Keep starting and unconfirmed subagents visible but skip their rows
  during keyboard and mouse selection. Show whether an unconfirmed
  transcript is loading or unavailable once the subagent leaves
  `Starting`.
- Resolve provisional status from discovered threads, including idle
  and unloaded ones, while preserving newer live outcomes. Open
  transcript links only after discovery confirms the subagent.

## Testing

Extend TUI coverage for discovery retries, status updates arriving
during discovery, disabled row navigation and clicks, and transcript
links that wait for a follow-up refresh.

GitOrigin-RevId: e4d3b992830884532531239507083e4bd2df6687
2026-11-25 11:49:41 +00:00
Eric Traut cec14d27b5 Show the quota plan in /status (#63877)
## Why

The ChatGPT plan shown in `/status` can differ from the plan reported alongside the rate limits. Refreshing the limits could leave the card showing the old plan.

## What changed

Use the cached quota plan for new status cards when available. If a rate-limit refresh changes the plan label, update the existing card in place, including when `/status` runs before a thread starts.

## Testing

Cover a rate-limit response that changes the label from Plus to Pro 200 in terminal scrollback, copied status output, and subsequent `/status` cards.

GitOrigin-RevId: c8def774ac2b344a2bb14b5eb834dec1d07d0099
2026-11-25 10:30:05 +00:00
Eric Traut ebd0765aaf Render bidirectional text in full-screen transcripts (#63845)
## Why

The terminal's bidirectional layout was already used for scrollback, but
full-screen transcripts could still show mixed right-to-left and left-to-right
text in source order.

## What changed

Use the terminal's bidirectional layout setting in the live transcript,
history pager, and resume picker previews. Reorder each wrapped row for
display and map its screen columns back to the source graphemes. This keeps
hyperlink hit targets and search highlights aligned with the displayed text.
Mouse selection follows the displayed glyphs, while copying preserves source
order.

## Testing

Add regression coverage for mixed Arabic, Hebrew, and Latin text across
terminal widths, including link hit targets, highlights, and logical text
order. Exercise mouse and keyboard selection and verify right-to-left
rendering in the resume picker preview.

GitOrigin-RevId: ea0518ea8791d0fcc031dd0ebf306775918f373b
2026-11-25 06:40:44 +00:00
Eric Traut f0c0f0a14d Render bidirectional transcript text on terminals without native ordering (#63844)
## Why

Terminals that leave bidirectional ordering to the application can display
Arabic and Hebrew transcript text in the wrong order, especially when it
includes URLs, numbers, or inline code.

## What changed

Use the terminal's bidirectional mode report when available on a direct
connection, with a fallback for Windows Terminal, Ghostty, and Alacritty.

Resolve direction before wrapping and reorder graphemes for display in the
live transcript and scrollback. Preserve styling, hyperlink destinations,
and logical text for copying. Keep URLs and inline literals left to right,
and skip reordering for code blocks, tables, and lines with shell syntax
that could be misrepresented.

Measure hyperlink columns by painted graphemes so Arabic ligatures do not
shift clickable ranges in the transcript or composer.

## Testing

Cover agreement between streaming and finalized scrollback, preservation
of shell command boundaries, startup probe reply handling, and wrapped
composer links following Arabic text.

GitOrigin-RevId: 9ffa0f491a93c78fef423acfc6a951cb037abd4d
2026-11-25 06:40:04 +00:00
Eric Traut 1698314bb3 Scope TUI rate limits to the active thread's provider (#63838)
## Why

A resumed thread can use a different provider from the server default.
A successful account quota read can then show warnings and banners for
quota the thread does not use.

## What changed

Apply account quota reads and prefetch quota only when the active
provider uses account quota. Preserve remote provider definitions when
reloading local preferences, refresh custom provider definitions on
remote resume, and clear cached quota when the provider or its
definition changes.

For providers with independent quota, use turn updates for warnings and
composer notices. Keep omitted windows from sparse updates, clear the
notice when reported usage falls below the warning threshold, and omit
the `/status` hint. Limit the model-switch prompt to the built-in OpenAI
provider.

## Testing

Extend coverage for starting and resuming sessions across providers,
including an authentication change under the same provider ID. Verify
that custom-provider turn updates can show and clear a quota notice
without triggering a model-switch prompt.

GitOrigin-RevId: 4e6c95efe46ec420cee7b09d5f5a94862307530c
2026-11-25 06:20:31 +00:00
Jackson Moody e2c31f625a Use ChatGPT account preferences for Codex voice chat (#63810)
## Why

Codex stored voice selections in `realtime.voice` and supplied voice overrides when starting realtime sessions. Reading and saving the ChatGPT account preference lets Codex use the same voice selection as ChatGPT.

## What changed

- Add experimental `account/voiceSettings/read` and `account/voiceSettings/write` methods. The terminal voice picker shows the selected voice and available display names, then saves the chosen voice ID to the connected app server's ChatGPT account, including when the server is remote.
- Require ChatGPT sign-in for terminal voice chat and create its WebRTC calls through the ChatGPT backend.
- Remove voice overrides from realtime session startup. Existing `realtime.voice` entries still parse but are ignored.

## Testing

Cover voice picker loading and saving, remote catalog failures, the ChatGPT sign-in requirement for local calls, and omission of voice overrides from realtime call payloads.

GitOrigin-RevId: 9e6f30b8020c47701d3c1604075063924f191685
2026-11-25 02:31:54 +00:00
Eric Traut cb491754f6 Centralize terminal capability checks in the TUI (#63802)
## What changed

Use `terminal_capabilities` to select notification protocols, apply
Ghostty's 255-byte notification limit, and provide the focused-window
notice for notification tests. Reuse the shared tmux passthrough encoder
for OSC notifications.

Move program-status support checks and startup telemetry labels into the
same module.

## Testing

Extend the OSC 9 capability test to verify the notification body limit
for each supported terminal.

GitOrigin-RevId: ef3c9806dfafceba77cce3714073472224f1d173
2026-11-25 02:00:08 +00:00
Eric Traut 21fdf0f834 Centralize TUI image capability checks (#63801)
## What changed

Reuse shared terminal session detection and tmux passthrough escaping for
image commands. Drive image rendering with explicit checks for fullscreen
virtual placement, pixel data retention after placement removal, and
whether a protocol's images survive history insertion.

## Testing

Extend the automatic pet image protocol test to check that either `TMUX`
or `TMUX_PANE` alone requires virtual placement.

GitOrigin-RevId: 5d85e09bd9d1dcdfd01588adc8c2f0f4c6019ea1
2026-11-25 01:59:00 +00:00
Eric Traut bede3b5df8 Centralize TUI clipboard decisions in terminal capabilities (#63797)
## Why

Terminal checks for clipboard behavior are spread across the clipboard
worker, local settings, and right-click paste handling.

## What changed

Use `terminal_capabilities` to determine whether the terminal forwards
copy shortcuts or handles paste itself, whether X11 primary selection is
available, and how to send OSC 52 through tmux or GNU Screen. Have TUI
callers use the same SSH and WSL session checks.

Keep the automatic copy-on-select decision in settings and base it on
whether the terminal forwards the copy shortcut. Route tmux clipboard
copies through the client buffer with OSC 52 as a fallback.

GitOrigin-RevId: 623599783b70d66a06c52458fc82305a422cf507
2026-11-25 01:42:33 +00:00