Commit Graph
13120 Commits
Author SHA1 Message Date
Felipe Coury 1088aa76e2 Release 0.174.0-alpha.8 2026-11-26 20:53:07 +00:00
Eric Traut df06542138 Fix Unicode highlighting in fuzzy file search (#64214)
## Why

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

## What changed

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

## Testing

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

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

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

## What changed

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

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

## Testing

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

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

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

## What changed

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

## Testing

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

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

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

## What changed

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

## Testing

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

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

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

## What changed

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

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

## Testing

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

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

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

## What changed

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

## Testing

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

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

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

## What changed

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

## Testing

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

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

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

## What changed

Skip transcript-only reasoning summaries when grouping tool calls.

## Testing

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

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

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

## What changed

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

## Testing

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

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

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

## What changed

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

## Testing

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

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

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

## What changed

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

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

## Testing

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

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

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

## What changed

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

## Testing

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

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

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

## What changed

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

## Testing

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

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

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

## What changed

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

## Testing

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

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

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

## What changed

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

## Testing

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

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

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

## What changed

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

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

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

## What changed

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

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

## Testing

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

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

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

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

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

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

## What changed

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

## Testing

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

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

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

## What changed

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

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

## Testing

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

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

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

## What changed

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

## Testing

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

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

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

## What changed

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

## Testing

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

GitOrigin-RevId: 04cf3a65b02204221569c4f7b2d4397f48554e2d
2026-11-26 02:42:20 +00:00
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
Anthony Tafoya 963d4f5717 Honor per-executor plugin settings in capability discovery (#64052)
## Why

A plugin can be installed in several executor environments. Disabling one
installation should leave the others available, while a thread-wide exclusion
needs to apply across environments.

## What changed

- In executor capability discovery V2, allow an executor to list its own
  plugin installations subject to marketplace policy. A named entry such as
  `"notes@market": {}` inherits the executor default when the thread has
  no enablement preference. A default alone does not list any plugins.
- Apply thread enablement preferences across installations and scope executor
  opt-outs to the affected installation. When MCP server names are shared,
  use the first enabled installation.
- Preserve connector mappings for explicit `disabledPluginIds` exclusions
  so Apps tool search can honor them even when the executor has already
  disabled the installation.

## Testing

Add regression coverage for marketplace filtering, thread and executor
precedence, installation-scoped exclusions, and Apps connector suppression
after an executor opt-out.

GitOrigin-RevId: d3465a38f3ebf5042d5c45dabfdb32f8ada81727
2026-11-26 02:32:11 +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
Eric Traut 653def34fb Preserve native exit codes in Windows PowerShell hooks (#64013)
## Why

PowerShell's `-Command` can report a native command's exit code `2` as
`1`, so a `PreToolUse` hook can fail to block a tool call.

## What changed

Use `$?` to preserve successful hook results and forward
`$LASTEXITCODE` on failure when available. Pass scripts with named
blocks through as written because PowerShell forbids trailing
top-level statements after those blocks.

## Testing

Add Windows regression coverage for a native command and a PowerShell
`end` block that each exit with code `2`. Both cases check that
`PreToolUse` denies `apply_patch` before approval, reports the denial
reason, and leaves the target file uncreated.

GitOrigin-RevId: 9668b1382bb56f168794dd8d4d2fecac13d2f649
2026-11-25 22:53:41 +00:00
sayan-oai e54baff042 Move environment selection tests into a dedicated file (#64012)
Move the existing selection, readiness, and configuration inheritance
tests into `environment_selection_tests.rs` and keep them wired up as
the `environment_selection::tests` module.

GitOrigin-RevId: 304944a8875c5d92e21bcc2ab39e760e41083d37
2026-11-25 22:53:05 +00:00
teddywyly-oai 3d5a786a20 Clean up abandoned MCP sessions during HTTP recovery (#64011)
## Why

A Streamable HTTP server can assign a replacement session ID before the
initialization handshake finishes. If recovery fails or times out at
that point, the abandoned session can occupy server capacity needed by
the next attempt.

## What changed

- Track replacement sessions as soon as the server returns
  `Mcp-Session-Id`. Coordinate a single `DELETE` between handshake cleanup
  and SDK teardown, leaving successfully initialized sessions active.
- Let cleanup finish in the background when the caller's deadline
  expires. Coordinate cleanup with OAuth refresh so the deletion can use
  updated credentials.
- Keep the service, OAuth state, and expiry signal together for each
  connection. Keep recovery scoped to the failed connection and
  recheck client state before returning a replacement so shutdown can
  take precedence.

## Testing

Cover interrupted JSON and SSE handshakes, cleanup before retry on a
server with limited session capacity, OAuth refresh during cleanup,
concurrent calls on expired sessions, and recovery racing with shutdown.

GitOrigin-RevId: 0caa1b1271f4e7ae667f90f15bfa86b1bdfe7d0b
2026-11-25 22:52:27 +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
jif 30d71606a1 Allow callers to redact encoded JSON request bodies from logs (#64003)
## Why

Callers need a way to keep encoded JSON payloads out of request
diagnostics while preserving what the server receives.

## What changed

Add `EncodedJsonBody::omit_from_logs()` to replace the trace body with
`<redacted>` and show only the byte length in debug output. Preserve the
setting through private JSON enrichment and request preparation. The
setting leaves the wire payload and redirect policy unchanged.

## Testing

Add a regression test that checks trace redaction and debug output for
both plain and enriched bodies before and after preparation, and
verifies that decompressing the wire body yields the expected bytes.

GitOrigin-RevId: 5b1ae2c810242f8c7f35bcdf653af9127360c29c
2026-11-25 22:47:37 +00:00
jif 44d359767f Preserve initial turn input when suspension races with startup (#64002)
## Why

Suspension can detach the active task just as startup tries to save
unrecorded input before reading the host roster. If detachment wins,
cleanup can miss the initial submission when saving the turn for recovery.

## What changed

Store pending initial input in the shared `TurnContext` during host
admission and startup steps that can wait on the host roster. Save the
input before checking whether the task is still active, so suspension
and abort cleanup can retrieve it after the task exits. Reclaim it under
the active-turn lock when startup completes so only one path records
the submission.

GitOrigin-RevId: 2f180fc372daaa8f2d8e0ebcb4787a1b2cfd61fa
2026-11-25 22:47:01 +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
jif f3c6076ac2 Skip SessionEnd hooks when child threads shut down (#64000)
## Why

A hosted child thread can inherit the root session ID and use a custom
session source. The existing subagent source check can miss that child,
allowing its shutdown to fire `SessionEnd` while the root is still active.

## What changed

Before preparing `SessionEnd` hooks, skip threads whose ID does not match
the session ID.

## Testing

Extend the shutdown test to close a hosted child with an inherited
session ID before closing the root and verify that exactly one
`SessionEnd` hook invocation is logged for the session.

GitOrigin-RevId: 4c80a17724cab57003b33080482d00f3cc2afea4
2026-11-25 22:45:49 +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