Commit Graph
3751 Commits
Author SHA1 Message Date
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
Eric Traut 8603da0718 Centralize terminal compatibility policy in the TUI (#63793)
## What changed

Have startup and screen code consume capability decisions for inline mode,
Kitty graphics, mouse capture, session polling, and pointer reset. Keep
terminal and multiplexer detection behind the capability helpers for these
decisions.

Share stdout color detection between the CLI and standalone TUI exit
messages, and use the TUI's terminal warning helper for the CLI startup
confirmation.

## Testing

Exercise mouse-capture cleanup in separate Kitty and Ghostty test processes
and verify that each emits its expected OSC 22 reset sequence.

GitOrigin-RevId: 15cb972034397e521a97c2813628533b71539530
2026-11-25 01:27:56 +00:00
Eric Traut ebb1ff0e8b Centralize TUI terminal capability decisions (#63790)
## Why

Terminal-specific checks are spread across rendering and scrollback code.
Independent capability queries let callers share those checks without
starting unrelated terminal probes or caching live settings together.

## What changed

Move scrollback strategy, title encoding, and Markdown link display
decisions into `terminal_capabilities`. Route color detection and resize
reflow limits through the same module. Rendering and scrollback code
apply the selected modes.

GitOrigin-RevId: 6803e4b50ff5d3517efb5c07474d9ce17690e12d
2026-11-25 01:14:25 +00:00
Eric Traut 6e32b34f27 Consolidate terminal capabilities in the TUI (#63789)
## What changed

Group terminal probing and identity, keyboard modes, resize reflow, and
tmux settings and clipboard forwarding under `terminal_capabilities`.

Move pet image protocol detection and its tests into the same module
tree.

GitOrigin-RevId: 6d77b980982f6ea160b6d947760f04749352d94e
2026-11-25 01:13:41 +00:00
Eric Traut da973317bb Collapse turn details by default in the full-screen transcript (#63788)
## What changed

Summarize tool calls and collapse completed turns when
`tui.collapse_turn_details` is unset, including when the entire `[tui]`
table is absent. Set `tui.collapse_turn_details = false` to opt out.

Keep patches out of tool-call summaries so their inline diffs stay
available for review during approval. Record the configured setting at
startup with the `codex.tui.collapse_turn_details` counter.

## Testing

Update configuration tests to cover the new default and an explicit
opt-out.

GitOrigin-RevId: 8a1de12bd2a26f445bbc1eee68f31fe93fe4925a
2026-11-25 01:13:00 +00:00
Eric Traut 1ace17a02e Show a resize cursor on the TUI workspace divider (#63786)
## Why

The divider between the command center and the conversation pane is
draggable, but it lacks the resize cursor that signals this on the
sidebar divider.

## What changed

Show the resize cursor when the pointer is over the workspace divider
and keep it visible while dragging. Use the same hit test for hover and
drag start, and track sidebar divider highlighting separately from the
cursor shape. Clear workspace drag state when focus is lost or tmux
mouse support is disabled.

## Testing

Extend the workspace navigation test to cover cursor changes on hover,
press, drag, release, and focus loss, and verify that dragging moves
the divider.

GitOrigin-RevId: f63db5196bb73d28df3f341646f767394982b357
2026-11-25 00:58:35 +00:00
Eric Traut c7f0d3da0c Preserve multiline pastes without bracketed paste markers (#63785)
## Why

When a terminal sends pasted text as individual keystrokes, the TUI can
mistake a pasted newline for a submit key. This can happen after a short
Unicode prefix or after a redraw has already displayed a pasted line.

## What changed

Keep the paste detection window open after buffered text becomes visible.
Treat plain Enter within that window as a pasted newline and buffer any
following indentation with it. A single IME character still allows Enter
to submit in the regular composer.

Apply the same paste timing to startup drafts so Enter can confirm the
draft once the paste window expires. Keep newline-and-tab-only pastes
literal inside blockquotes.

## Testing

Cover multiline pastes with Unicode prefixes, tabs after pasted newlines,
and Enter handling before and after the paste window expires.

GitOrigin-RevId: e8f63dfead0cc97d44001000e961a6f6d05d4900
2026-11-25 00:57:54 +00:00
Eric Traut a6fadff7a2 Prevent accidental TUI interrupts after a steer is accepted (#63784)
## Why

A pending steering message offers a shortcut to interrupt the running turn
and send the message immediately. If Codex accepts the message before the
terminal redraws, pressing the shortcut while that hint is still visible
can interrupt the turn even though the message has already been accepted.

## What changed

Track whether the interrupt-and-send hint appeared in the last terminal
frame. If Codex has since accepted the last pending steer for the running
turn, ignore one interrupt press and its key repeats and briefly show
“Message received. Ignored one interrupt.” A fresh press can still interrupt
the turn. If the hint was never drawn or a redraw has removed it, the first
press interrupts as usual.

## Testing

Add regression coverage in both TUI rendering modes for an interrupt before
and after redraw, a hint that was never displayed, held-key repeats, and an
image submission in progress.

GitOrigin-RevId: 8be3bd51c623af44c108987fe0c2148eeb4515c7
2026-11-25 00:57:16 +00:00
Dmitriy Kovalenko 17b00277cc Make Bazel Rust tests portable across Linux environments (#63773)
## Why

Some test fixtures depend on `python3` being on the host's `PATH` or
on reading Rust's process arguments from a constructor. Bazel workers
need a declared Python runtime, and musl does not provide those
arguments to constructors.

## What changed

- Put Bazel's Python 3.12 runtime on `PATH` for Linux test suites that
  invoke `python3`, including their Wine launchers.
- Use standalone helper binaries for exec-server and sandbox fixtures on
  musl, and read `/proc/self/cmdline` for the MCP hook fixture.
- Add launcher options for test execution tags and for routing selected
  Linux cases to a local companion target that shares the test binary.
- Adjust test fixtures for platform differences in file creation
  timestamps and shell script execution. Keep cloud-config error tests
  pointed at their mock server after startup falls back to defaults.

## Testing

Exercise marketplace upgrade negotiation at Git 2.20 and check whether
the installed Git supports limiting the refs advertised by the clone.

GitOrigin-RevId: 3a83cde954d52ca29d346d67488c9a25c0790614
2026-11-24 23:57:49 +00:00
Brandon Zhang ff146c344d Support structured dynamic tool results in Code Mode (#63766)
## Why

Dynamic tool clients could return JSON as text in `contentItems`, so Code Mode scripts had to parse that text to access fields in the result.

## What changed

App server dynamic tool requests advertise `supportedResultFormat: "structuredContent"`. Clients can reply with `structuredContent` and a `success` flag, report a failure with `errorMessage` and `success: false`, or continue using `contentItems`.

Code Mode exposes structured replies as MCP-style tool results, with the original JSON under `structuredContent` and failure status in `isError`. Completed tool items include a text representation of the reply. Matching post-tool-use hooks can receive the structured result for successful calls.

## Testing

Add protocol tests for the wire formats and rejection of ambiguous replies, plus an app server integration test that exercises structured results, content items, and errors through Code Mode.

GitOrigin-RevId: d63152633b43bd5bd236f6e0dcb41ee7e98e7947
2026-11-24 23:38:37 +00:00
Joe Savona 110f065202 Add whitespace preservation to status line text (#63757)
## Why

Status line text collapses spaces and tabs by default. Authors need a
way to retain indentation and alignment while styling parts of the text.

## What changed

Add the optional `preserveWhitespace` prop to text nodes. When enabled,
it preserves spaces and tabs across nested styles and uses the same
wrapping rules as inline code. Inline code continues to preserve
whitespace automatically.

## Testing

Add a rendering test that compares styled and unstyled text across
terminal widths and checks tab expansion and bold styling. Add a
TypeScript contract fixture that uses the new prop.

GitOrigin-RevId: 525ae1d7df2df036d74990e18092286030041b23
2026-11-24 22:45:14 +00:00
Joe Savona 15843299be Support inline code in custom status lines (#63755)
## Why

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

## What changed

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

## Testing

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

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

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

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

## Testing

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

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

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

## What changed

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

## Testing

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

GitOrigin-RevId: 1acb06e0bb900a7f99bc06e542518708b89b7728
2026-11-24 21:42:02 +00:00
Eric Traut c6b00eacb9 Add composer borders when the terminal background is unknown (#63741)
## Why

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

## What changed

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

## Testing

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

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

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

## What changed

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

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

## Testing

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

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

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

## What changed

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

## Testing

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

GitOrigin-RevId: 67909c92b628ff5389ea9b417e7e5133a9acdeec
2026-11-24 20:35:36 +00:00
surajs-oai 7a24022794 Allow async user messages through code mode (#63730)
## Why

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

## What changed

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

## Testing

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

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

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

## What changed

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

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

## Testing

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

GitOrigin-RevId: 09ef2a8558190eb2f63f5c286b4271838f228f67
2026-11-24 19:55:43 +00:00
Eric Traut 7f8dcb3e64 Detect Ghostty truecolor when SSH omits COLORTERM (#63710)
## Why

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

## What changed

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

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

## Testing

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

GitOrigin-RevId: e7b6832fc7e721d5e2c23ef19df5fe55fbfeb21a
2026-11-24 18:50:19 +00:00
Eric Traut 2ee23c7f8f Show URL elicitation instructions in the TUI confirmation (#63701)
## Why

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

## What changed

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

## Testing

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

GitOrigin-RevId: 85566e783341fc46d8e21ef4710b7c30687316f8
2026-11-24 18:19:40 +00:00
Felipe Coury 39c6485cb7 Fix Home and End navigation in the agent center (#63677)
## Why

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

## What changed

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

## Testing

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

GitOrigin-RevId: e508c7926ce83b68c229d638364e6e41f671490e
2026-11-24 17:02:17 +00:00
ioanbudea-OAI 77acaa207f Keep rejected audio file IDs out of protocol events (#63667)
## Why

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

## What changed

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

## Testing

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

GitOrigin-RevId: 982dd85d0037cebee056caf61d70988762e42767
2026-11-24 16:14:00 +00:00
jif 3781b6c627 Remove no-op rate limit polling hooks from the TUI (#63661)
## What changed

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

GitOrigin-RevId: c25c33a53d63be982d8cfebf405401a4c4f0e0c4
2026-11-24 15:35:38 +00:00
jif e351ffa4b6 Remove the legacy test-only /mcp renderer (#63639)
## Why

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

## What changed

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

GitOrigin-RevId: 69f1601f19b34576ea2d9dcebdd2bfb30f414d99
2026-11-24 13:29:54 +00:00
jif 8b096dce07 Remove the TUI snapshot test for /mcp secret masking (#63619)
## What changed

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

GitOrigin-RevId: d42092505760639776a779e93837a675ac14dece
2026-11-24 11:36:36 +00:00