Commit Graph
3800 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
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
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
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
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
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
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
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
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