Commit Graph
3559 Commits
Author SHA1 Message Date
Benjamin Carlsson 42cf4edfcd Add slash command argument completion to the TUI composer (#62343)
## Why

The slash command menu helps users find commands, but leaves them to
recall fixed arguments such as `on` and `off` for `/raw`.

## What changed

Show prefix-filtered suggestions for the first argument of supported
slash commands. For example, type `/mcp lo` and press `Tab` to complete
`/mcp login`. `Enter` and configured submit shortcuts still submit the
draft as typed.

Give mention completion priority and limit argument suggestions to
commands available in the current thread and connection state.

## Testing

Add tests for popup rendering, argument replacement, submit shortcuts,
and changes in thread availability and connection state.

GitOrigin-RevId: 8682c323064457dd9307b0a1520469011a8df9f3
2026-11-18 19:11:14 +00:00
Benjamin Carlsson 58ad62ce09 Let users open the command center from provider error screens (#62335)
## Why

Read-only chats offer a Left Arrow shortcut to the command center when
agent navigation is available. Chats blocked by model provider errors
were missing that shortcut.

## What changed

Share notice rendering and shortcut availability between provider
errors and read-only threads. Show `← command center` on provider error
notices when the shortcut is available, and open it on a plain Left
Arrow press even when offline.

## Testing

Add a regression test that checks the shortcut hint, verifies that
repeat events leave the notice open, and confirms that opening the
command center preserves the draft both online and offline. Update
provider error snapshots to cover the new hint, including at narrow
terminal widths.

GitOrigin-RevId: be2ce80cade02c84baeff7fd48fa8973f0dcc1dc
2026-11-18 18:48:22 +00:00
Benjamin Carlsson 0a82fdf49d Open Codex thread links inside the TUI (#62332)
## Why

Conversation search results can point users to saved transcripts. Users
need to be able to follow those links without leaving their terminal session.

## What changed

- Make Markdown links such as `[Review notes](codex://threads/<id>)`
  open the linked conversation from chat and transcript views. In the
  resume picker, follow the link to another transcript preview.
- Resolve nested agent links through their owning session and select the
  requested agent. Show archived conversations in read-only mode and
  let users explicitly reopen them.
- Include the Markdown link format in thread search results, including
  archived results.

## Testing

Add coverage for thread link parsing and activation, nested agent
navigation, archived thread reopening, and mouse capture during
transcript preview transitions.

GitOrigin-RevId: 40a39c43acf643b97e066ba663aefcf9cda0bc81
2026-11-18 18:28:58 +00:00
Alex Chang cc7a62e19c Report API spend limit errors by scope (#62329)
## Why

Generic quota errors hide whether the project or organization spend limit
blocked a request. Reporting the scope tells users which limit to check.

## What changed

Recognize API key, project, and organization spend limit errors across
HTTP, SSE, and WebSocket responses. Show a message that names the scope and
treat the error as non-retryable, even when the provider sends
`Retry-After`. Apply the existing usage-limit handling to goals and
compaction.

Expose distinct `CodexErrorInfo` values in the app-server protocol and
generated bindings so clients can identify the limit in live errors and
failed turn history.

## Testing

Extend the transport tests to cover all three scopes and verify that they
stop retries. Extend the app-server test to check that the error survives
`thread/read` and that a subsequent turn can succeed in the same thread.

GitOrigin-RevId: 03341f7a78daa7540e7baa519f1a29ec07e34509
2026-11-18 18:11:54 +00:00
Zahan Malkani bd00a8a42e Preserve pending realtime speech when a call ends (#62299)
## Why

A realtime call can end with completed speech that has yet to reach a
Codex turn. The next turn needs that context even if the call's transport
has already disconnected.

## What changed

- For V3 calls with realtime frame history enabled, save pending speech
  as context for the next turn. Restore it on thread reload and exclude
  it from the turn count used by rollback.
- Drain already received transcript events and settle pending handoffs
  before saving the call's closing marker. Report recovery required if
  shutdown cannot confirm that history was saved.
- Keep transport detach separate from ending a call. Reattaching restores
  saved pending speech, and an open call can be ended from persisted
  history after a reload. Use the call ID for TUI attachments so successive
  calls on one thread have distinct history.

## Testing

Add coverage for queued speech at hangup, reconnect and stop after
reload, retries after an uncertain write, and rollback across saved
session-end context.

GitOrigin-RevId: 657491f1d7e446a1a48e22189758810c8bdd82cb
2026-11-18 15:24:29 +00:00
alexsong-oai 24e236514b Allow Bedrock Runtime selection during setup and login (#62222)
## Why

The app server's Bedrock setup and login flows always selected Mantle.
Clients using Bedrock Runtime had to configure that provider separately.

## What changed

Accept an optional `providerId` in `account/bedrock/setup` for AWS profiles
and environment credentials, and in `account/login/start` for Bedrock API
keys and AWS access keys. Pass `"amazon-bedrock-runtime"` to select
Runtime. Omit the field or pass `null` to keep the Mantle default.

Save configuration for the selected provider and check that provider for
an existing `aws.credential_export` before changing credential sources.

## Testing

Extend app-server tests to cover Runtime setup with profiles and
environment credentials, Runtime login with both key types, and Mantle
fallback. Verify that environment setup selects the Runtime default
model for a new thread and that a configured Runtime credential exporter
blocks profile setup.

GitOrigin-RevId: 6396b638208ab9b12f50f13f13bd517a919d0848
2026-11-18 07:43:45 +00:00
Benjamin Carlsson ba8ab2d050 Allow paging through long choices in async questions (#62209)
## Why

A choice taller than the TUI's answer area could never be displayed in
full at that terminal size, so users could neither read it to the end
nor submit it.

## What changed

Let `PageUp` and `PageDown` scroll through the wrapped lines of an
oversized choice while keeping it selected. Allow submission once every
line of the choice has been displayed in order and at full width.

## Testing

Add regression coverage for paging without changing the selection,
rejecting submission when repeated page keys skip lines before redraw,
and rejecting choices clipped horizontally.

GitOrigin-RevId: c296323494bd387581c2bb046272a8ccd773ad75
2026-11-18 06:50:26 +00:00
Benjamin Carlsson a734a13ad7 Omit unknown server versions from /status (#62202)
## Why

`/status` appends `(unknown)` to the server label when a cloud or remote
server does not report a version.

## What changed

Show the cloud label or remote address on its own when the version is
unavailable. When a version is reported, use the same `v` prefix for cloud
and remote servers. The daemon menu still displays `unknown` for a running
local daemon whose version is unavailable.

## Testing

Add `/status` snapshots for cloud connections with and without a reported
version and for a remote WebSocket connection without a reported version.

GitOrigin-RevId: 113d2502fc7de6af37da3b3029ee28923af29e6f
2026-11-18 06:06:46 +00:00
Benjamin Carlsson e58677f0cb Add task group navigation to the agent command center (#62200)
## Why

Row and page navigation make users step through tasks to reach another group.

## What changed

Use `Shift+Down` or `Shift+J` to jump to the first task in the next
visible group, and `Shift+Up` or `Shift+K` to jump to the first task
in the previous group. Navigation stops at the ends of the list.

Expose `agents.next_group` and `agents.previous_group` in the keymap
picker and show the active shortcuts in Task shortcuts.

## Testing

Add coverage for jumps in both directions, list boundaries, and key
handling during search and rename. Update snapshots for shortcut help
and the keymap picker.

GitOrigin-RevId: 2542a75e7fdd7a3326c0914e19a9f5c191de082b
2026-11-18 05:49:12 +00:00
Eric Traut fc25d8f120 Fix stale terminal dimensions in immediate TUI redraws (#62175)
## Why

An immediate redraw can happen before the TUI receives a resize event.
For example, submitting a turn just after shrinking the terminal can
render the frame using the previous dimensions.

## What changed

Resolve the screen size and run resize handling before immediate paints
for turn submission, session lifecycle actions, startup modals, Cloud
switching, and shutdown. Consume the reserved size when drawing the frame
and preserve the scheduled recheck for settled terminal dimensions.

## Testing

Add regression coverage for fullscreen turn submission and archive
progress after a terminal shrink, plus checks that a draw consumes its
reserved size and an early paint preserves the scheduled size recheck.

GitOrigin-RevId: 494c746cb02712350cc600ea4aea64460c608639
2026-11-18 03:36:14 +00:00
Eric Traut 3dbc6f8657 Keep the TUI composer caret anchored while typing (#62174)
## Why

When the composer footer gains or loses a hint row, typing the first
character or deleting the last one can move the caret vertically.

## What changed

Reserve a row for passive footer hints when the status line is visible
and there is room after laying out the input, slash-command suggestions,
and previews. The row can stay blank until a hint appears.

## Testing

Add a regression test that checks the caret row before typing, after
typing one character, and after pressing Backspace. Extend coverage to
check that slash-command suggestions and a short status line fit together
when space is tight.

GitOrigin-RevId: 25df697826cebc4b7cb4aab4460c432b7454d5ea
2026-11-18 03:08:53 +00:00
Benjamin Carlsson 409973e0e2 Extract TUI thread resume finalization (#62171)
## What changed

Move subscription state updates, history hydration, and resumed session
setup into `finish_thread_resume`. Let callers supply a
`HistoryHydrationScope` and keep using `HistoryHydrationScope::Initial`
for the existing resume path.

GitOrigin-RevId: ebb8b422827a2374d8dce194e8d59afe57327f29
2026-11-18 02:54:51 +00:00
Felipe Coury bedafe7156 Open subagent transcripts from activity links in the TUI (#62159)
## Why

When a transcript mentions a subagent, readers have to find it in the
sidebar chooser to inspect its work.

## What changed

Underline subagent labels in transcript activity when the sidebar is
available. Clicking a label opens that agent's transcript beside the
parent conversation, including when the link is in an unfocused pane.

Use backend ancestry to confirm that the linked agent belongs to the
current conversation. If a click arrives while agent discovery is in
progress after resume, resolve it when discovery finishes.

## Testing

Cover clicks from the parent transcript and a nested-agent link in an
unfocused pane, along with clicks during discovery and inherited
activity from a fork. Snapshot the underline across a wrapped label.

GitOrigin-RevId: 75b343c56eac4a009d644f0cfc135b6d9bfbe3a0
2026-11-18 02:04:55 +00:00
Felipe Coury cc3757a99d Open subagent transcripts in the TUI sidebar (#62157)
## Why

Selecting a subagent from the sidebar switched the active conversation
to that agent. Keeping the parent conversation visible makes it easier
to review the agent's work in context.

## What changed

- Open the selected subagent in a sidebar tab alongside its parent
  conversation. Switch focus between the two panes as needed.
- Show parent-owned subagents in a watch-only reader with transcript
  navigation, search, and selection.
- Press `Esc` from the reader to return to the subagent list with the
  same agent selected. The tab also supports the sidebar's close button
  and close shortcut.

## Testing

Add a TUI integration test that opens a saved subagent through the
sidebar, snapshots the watch-only view, and covers transcript
navigation, search, resizing, and tab dismissal.

GitOrigin-RevId: 60da0759b7c046c33b665abdbb063153c5beafa4
2026-11-18 02:03:29 +00:00
Benjamin Carlsson 2f7c5a8588 Cancel Cloud overview refreshes that block TUI navigation (#62150)
## Why

An in-flight Cloud task list from the agents overview can keep the Cloud
worker busy while the TUI waits for a session request, such as listing
tasks in the resume picker or unsubscribing from a discarded blank task.

## What changed

Cancel the affected backend's Cloud overview refresh when dismissing the
overview or before session operations that need the same worker. Wait for
the aborted task to drop its request before proceeding. When opening the
resume picker, clear queued Cloud refreshes first so canceling the active
refresh cannot start another page ahead of the picker's requests.

## Testing

Add regression tests that hold Cloud list requests open while returning to
the current chat, opening the resume picker, or switching backends.
Cover canceling a refresh before starting a fresh plan implementation
session and preserving another backend's in-flight page during archive.

GitOrigin-RevId: 94993aa0014ac895a30f454e3ff5f4cbc45bb429
2026-11-18 01:35:51 +00:00
Felipe Coury 18352dc4e8 Show subagents and their status in the TUI sidebar chooser (#62149)
## Why

The sidebar chooser lists side chats and files. Adding subagents lets
users check their progress and switch to their conversations from the
same menu.

## What changed

- Add a `Subagents` section for the main conversation's spawn tree.
  Show each agent's name and status, and let users select an agent to
  switch to its conversation.
- Keep explicit outcomes such as `Completed`, `Stopped`, and `Failed`
  visible through idle or unloaded updates. Restore outcomes from saved
  activity and give live updates precedence over in-flight discovery.

## Testing

Add wide and narrow chooser snapshots and regression tests for outcome
retention and discovery updates that race with live notifications.

GitOrigin-RevId: 93092e6bd5c59724f69f52785e3c22aa2c1313d8
2026-11-18 01:11:31 +00:00
Benjamin Carlsson 2f5c413e19 Batch mouse wheel scrolling in the TUI (#62146)
## Why

Rapid wheel input can trigger a synchronous transcript redraw for each tick, even when the current layout can still be used.

## What changed

Accumulate wheel movement in the main transcript and side panes until the next frame when the rendered layout is safe to reuse. Refresh first when the transcript has changed, cached content can change height, or the side pane has buffered reply text. Refresh immediately when toggling side-pane zoom so subsequent mouse events use the new layout.

Start composer scrolling from the caret-adjusted viewport after an edit so wheel ticks can accumulate before the next frame.

## Testing

Cover wheel bursts while the plan menu is open, composer scrolling after edits, refresh requirements for mutable history and buffered side replies, and immediate layout updates when toggling side-pane zoom.

GitOrigin-RevId: 342d4d4c014d8a41b2e690b91622197ee97fc059
2026-11-18 00:58:27 +00:00
JonLuca De Caro 67d8266e06 Signal workspace routing readiness in account updates (#62145)
## Why

App-server clients receive `account/updated` both when routing is ready
for a saved ChatGPT workspace and when a user logs in, logs out, or
switches workspaces. The notification payload gives clients no explicit
way to identify the initial routing update.

## What changed

Add a nullable `reason` to `account/updated`. Set it to
`workspaceRoutingReady` on the initial saved-workspace routing
notification when the authenticated owner is unchanged, including when
routing is ready before the connection initializes. Login, logout, and
workspace-switch updates send `null`. Update the protocol schemas,
TypeScript types, and Python SDK models.

## Testing

Extend the app-server integration tests to check the reason in the JSON
payloads for saved-workspace discovery, login, workspace switching, and
logout.

GitOrigin-RevId: 96758519985a6bdb07474e48307ed53b125823ee
2026-11-18 00:46:17 +00:00
Charlie Marsh 3e5f072ca1 Use the state database first for TUI analytics thread lists (#62138)
## Why

Listing root threads for chat and task analytics can trigger filesystem
scans and metadata repair. The state database can serve these lists
without that work.

## What changed

Start root thread pagination with `thread/list` and `useStateDbOnly`
enabled. If the server returns JSON-RPC error `-32603`, discard the
partial results and restart from the first page with filesystem repair
enabled. SQLite cursors may identify different pages in the filesystem
listing.

## Testing

The chat analytics regression test simulates an error on the second
indexed page and checks that the fallback restarts pagination, excludes
discarded results, and preserves the usage estimate budget. The task
analytics test checks that only root listings use the database-only mode.

GitOrigin-RevId: 9de78a9eca4662df06d22a86cffb6e7bcba428cb
2026-11-18 00:18:42 +00:00
matthewdavis-oai 3bf4e138fe Stream partial thread search results and support cancellation (#62132)
## Why

Clients using `thread/search` have to wait for the search to finish before
they can show any matches. A search can also outlive the query that triggered
it, such as when a user changes their task mention query.

## What changed

- Add experimental `thread/search/stream` with best-effort
  `thread/search/partial` notifications. Each notification carries the original
  `requestId` and a batch of verified matches. Clients replace provisional
  matches with the final page, which determines results, ordering, and cursors.
- Support connection-scoped cancellation through `thread/search/stream/cancel`
  and `thread/search/cancel` for their respective search methods. Disconnecting
  also stops active searches and reaps their search subprocesses.
- Cancel superseded or timed-out TUI task mention searches without delaying
  available title matches.

## Testing

Add coverage for incremental results and final-page parity, slow clients,
connection-scoped cancellation and subprocess cleanup, and TUI task search
cancellation.

GitOrigin-RevId: b58abf7a1df424f191c8ede806d1d5266d299548
2026-11-17 23:46:48 +00:00
Charlie Marsh ea6b64fd12 Use the local session index in the multi-backend resume picker (#62127)
## Why

The resume picker starts local-only listings from the state database.
When multiple backends are available, the shared listing mode makes
local backends use the default thread store listing too.

## What changed

Choose the initial page mode per backend. Local workspaces start with
`StateDbOnly`, and remote workspaces use `StoreDefault`. Each backend
paginates in its current mode and can fall back to `StoreDefault`
independently. Explicit recovery requests keep their requested mode.

## Testing

Cover mixed local and remote listings, per-backend fallback and
pagination, and an explicit recovery request after fallback fails.

GitOrigin-RevId: d0c9284211b86bb781b3df6642660054cb3c6ccf
2026-11-17 23:18:54 +00:00
Benjamin Carlsson 7d7af7b903 Share picker setup for the TUI status line and terminal title (#62126)
## Why

The status line and terminal title pickers duplicated the logic for
ordering configured items and displaying live rate-limit labels.

## What changed

Build both pickers' item lists with the same helper. Keep configured
items in order, skip unknown IDs, and collapse aliases to one row per
canonical ID. Use live rate-limit names and descriptions when available.

Use the shared multi-select picker directly for terminal title setup
and opt it in to accepting input while disconnected.

## Testing

Cover alias deduplication and configured order, and assert that the
title picker accepts input while disconnected while the shared picker
defaults to disabling it.

GitOrigin-RevId: 48971f003bd73523599d1d1ad677d855844767db
2026-11-17 23:18:18 +00:00
Eric Traut 5f775c7f4f Add /rc to manage remote control from the TUI (#62121)
## What changed

Open `/rc` (or `/remote`) to enable or disable remote control for the
managed local background server. The menu checks whether the preference
was saved for the next restart and reports when saving fails. Once remote
control is enabled, **Add device** displays a manual pairing code.

The command can also manage the local server while viewing a cloud
session. Its actions apply only to local sessions.

## Testing

Add tests for menu states, daemon requests and manual pairing, local
daemon selection from a cloud session, and timeout messages.

GitOrigin-RevId: 888abaec3b041d78a6b35a9e76e28cd7dc5305ca
2026-11-17 22:45:02 +00:00
andrewgu-oai 6c0cee502d Add GPT-6.2 Sol and Astra to model catalogs (#62106)
## What changed

- Add `gpt-6.2-sol` and `gpt-6.2-astra` to the bundled, Amazon Bedrock, and Vertex catalogs, including Bedrock Runtime global and US cross-region variants.
- Make GPT-6.2 Sol the default catalog selection and refresh model ordering, descriptions, and bundled instructions.
- Increase the GPT-6.1 Sol context window to 500,000 tokens.
- Advertise the `ultrafast` service tier for GPT-6.2 Astra on Bedrock.
- Supply the same current model catalog to both executors in the prompt-prefix compatibility test so catalog updates do not cause prefix mismatches.

## Testing

Extend provider, app-server, and TUI coverage for catalog ordering, model fallback, Vertex requests, and GPT-6.2 Astra's Bedrock `ultrafast` selection and clearing behavior. Refresh model-picker and request snapshots.

GitOrigin-RevId: f28940e4a255fcdd88f7114873259bd1f3399812
2026-11-17 20:04:36 +00:00
vishnu-oai 2df29476ae Support device-code login for config servers (#62079)
## Why

`codex login --device-auth` still used browser authorization when config server sign-in was required, preventing the selected device-code flow from being used there.

## What changed

- Use device authorization for config server sign-in when `--device-auth` is selected, display the verification URL and code, and report a missing `config_server.oauth.device_authorization_url` explicitly.
- Include the configured OAuth `resource` in device authorization and token polling requests.
- Reserve sign-in per credential across Codex processes, reuse saved grants, and release the reservation when sign-in completes or is canceled.
- Report config server sign-in failures with guidance specific to `config_server.oauth` and the credential store.

## Testing

Add or extend tests for the device-code prompt, config server failure messages, OAuth resource parameters, policy reload after credential replacement, and rejection of concurrent sign-in with retry after cancellation.

GitOrigin-RevId: 013176d0e10128c347dd072b818e22b5038a2791
2026-11-17 16:42:48 +00:00
Benjamin Carlsson 49d657aad0 Add a keyboard diagram to TUI shortcut help (#62048)
## What changed

Let users switch from the grouped shortcut list to a US QWERTY keyboard diagram with `Tab`. Highlight keys with unmodified runtime bindings and point users back to the list for keys outside the diagram. Choose an available function key when `Tab` conflicts with configured bindings or chord prefixes.

Fall back to the action list when the diagram does not fit, and size the guide to fit an `80x24` conversation view. Preserve input priority for sidebar navigation and active transcript interactions.

## Testing

Add snapshots and regression tests for keyboard layouts, terminal colors, small-area fallback, remapped bindings, and sidebar and transcript input priority.

GitOrigin-RevId: 606edcc25e9dc98d0548e86d4b7544cb97f2db6f
2026-11-17 13:39:08 +00:00
Joe Savona d75ea7b0fa Record status line provider starts and failures (#62046)
## What changed

Add `codex.statusline.provider_started` and `codex.statusline.provider_failed` counters through the existing status line metrics collector. Classify failures with `kind=timeout` or `kind=error`, and ignore events from stale readers.

## Testing

Extend reader and picker tests to check counters for explicit selection, polling, invalid content, timeouts, restarts, and stale events.

GitOrigin-RevId: 8c3074743f3b31409ccd713edb228e4dce809ea8
2026-11-17 13:38:01 +00:00
Joe Savona efc5d35455 Record statusline mode on the first prompt of each thread visit (#62045)
## What changed

Emit `codex.statusline.first_prompt` once per thread visit, with a `mode` label of `feature_off`, `builtin`, or `custom`. Reset the counter guard when attaching a different primary thread, and count only user prompts for the active primary thread. Use the existing analytics consent and exporter checks.

## Testing

Add coverage for counting once across first prompts and follow-ups on fresh and resumed threads, and verify that cloud async-question replies do not emit the metric.

GitOrigin-RevId: 3ba48a8fbbb3015d22de3252efcc5ae3ba96baab
2026-11-17 13:36:36 +00:00
Joe Savona f06700bc5d Add aggregate metrics for status line provider usage (#62041)
## What changed

- Count status line picker openings and successful provider changes with fixed labels for enabling a custom provider, switching custom providers, and returning to the default. Skip unchanged selections and failed saves.
- Apply current analytics consent to the built-in exporter. Suppress built-in reporting for custom environments, unrecognized originators, or custom OpenTelemetry resource attributes and headers, while allowing explicitly configured OTLP collectors.
- Stop recording through the captured collector if the configured metrics exporter changes.

## Testing

Add assertions for picker and provider-change counters, unchanged selections, failed saves, custom resource and header suppression, and exporter changes.

GitOrigin-RevId: 600bc06d6587e83a6ca09241f0285b47d30a331e
2026-11-17 13:10:04 +00:00
Joe Savona e20ccdfa80 Add custom status line authoring to /statusline (#62037)
## What changed

- Add “Create a custom status line” when `tui_extensions_statusline` is enabled outside cloud mode. Open a new conversation with an editable draft bound to the bundled `create-statusline` skill when available, falling back to a plain request otherwise.
- Preserve the previous thread’s draft and queued input, including input restored by a late interrupt, while switching conversations.
- Guard against stale create actions and held Enter submitting the new draft. Rename the provider action to “Choose a status line provider”.

## Testing

Add regression coverage for draft editing, bundled skill binding, input preservation, activation-key handling, dismissed setup actions, and hiding the create action in cloud mode.

GitOrigin-RevId: d40dd12914cf38968e605987f67d1ddee5ba7dd1
2026-11-17 12:24:05 +00:00
Joe Savona 7df454ceb5 Add TypeScript contracts for custom statusline providers (#62034)
## What changed

Bundle a generated `statusline.d.ts` reference with the `create-statusline` skill, covering status snapshots, UI trees, colors, and canonical statusline item IDs. Add test-only `ts-rs` derives and an `UPDATE_STATUSLINE_TYPES` regeneration path.

Clarify that rate-limit usage percentages can exceed 100.

## Testing

Add a Rust test that checks key type exports in the installed skill and a strict TypeScript fixture covering provider rendering and invalid item IDs, row props, and colors.

GitOrigin-RevId: f615e0b3c2cd3d0d95a75de36ce0a84467ecd5b6
2026-11-17 11:58:26 +00:00
Joe Savona 59ac39addb Surface status line discovery failures and lookup timeouts (#61993)
## Why

Status line provider discovery failures were silently ignored, and startup lookup timeouts appeared as unavailable providers.

## What changed

- Show incomplete provider discovery in the warnings viewer, with sanitized server names, bounded summaries, and no raw RPC error details. Preserve the warning across canceled scans and clear it after a successful scan.
- Share a single five-second startup deadline across provider lookup retries and report timed-out lookups as `Status line timed out`.

## Testing

Add coverage for discovery warning rendering and lifecycle, and for a hung lookup retry exhausting the remaining startup deadline. Update the startup timeout expectation.

GitOrigin-RevId: 0403af2ed688c31c175d1b5c47d2cdd4cd355653
2026-11-17 08:08:51 +00:00
Joe Savona a3fc418fb2 Classify status line provider failures and shorten error messages (#61990)
## What changed

Replace the generic provider error with concise status line messages for unavailable providers, timed-out reads, and other failures. Each message includes `/statusline` to help users reselect a provider.

Classify lookup, snapshot, transport, RPC, and resource validation failures, and log the failure category without carrying raw RPC errors or resource content.

## Testing

Update tests to assert specific resource validation errors and the displayed messages for invalid content, RPC failures, read timeouts, and provider lookup timeouts.

GitOrigin-RevId: 4ae4953cf2552c1c146d77463680655697d0d444
2026-11-17 07:54:43 +00:00
Joe Savona 568cccd4f5 Add a status line provider picker to /statusline (#61988)
## What changed

- Add a "Choose a statusline plugin" action when status line extensions are enabled. Discover MCP providers, show the current selection, and let users save a provider or return to the default status line.
- Preserve the highlighted row when discovery completes and start reading provider contents only after an explicit selection.
- Keep the item editor open across picker transitions and disconnects, allow switching to the default while offline, and guard transitions against repeated activation keys.
- Limit displayed numeric shortcuts to the first nine selectable rows.

## Testing

Add tests for discovery focus, stale discovery results, explicit reader activation, repeated Enter keys, disconnect handling, and numeric shortcuts. Extend the terminal integration test to switch between the default status line and an MCP provider through the picker.

GitOrigin-RevId: 76a254d7afee3a1b8cfc801617a2176893276e0e
2026-11-17 07:53:33 +00:00
Joe Savona 7fb4014d52 Preserve statusline provider selections across thread startup (#61986)
## What changed

- Pass the provider advertised by the picker into statusline resolution, preserving it when selection precedes the thread ID and avoiding a redundant global catalog lookup.
- Cancel failed readers and stop requesting provider-specific usage and workspace headline data until the provider is reselected.

## Testing

Extend reader tests to cover reselection before thread startup, resolution using only the thread catalog, and snapshot suppression after invalid provider content.

GitOrigin-RevId: 9531204cb6ef93c721dc7fafdc0a8fea8c20cb99
2026-11-17 07:27:10 +00:00
Joe Savona 47d9cde20e Refresh status line providers on config and connection changes (#61985)
## What changed

- Refresh the status line after reloading configuration so provider and feature-gate changes take effect.
- Restart the provider reader after saving a selection, including reselecting the same provider to retry a failed read.
- Cancel provider reads and show the built-in status line while disconnected, then restart the provider after reconnecting.

## Testing

Add regression coverage for configuration reloads, provider changes, retrying failed reads, and discarding stale results after provider changes or reconnects. Extend the terminal integration test to verify that a new thread picks up a provider changed in `config.toml`.

GitOrigin-RevId: e86531321d190786e8a41a0a0c93167c8a5298e6
2026-11-17 07:26:02 +00:00
Joe Savona 10a3126a03 Poll MCP statusline providers with fresh state and bounded reads (#61981)
## Why

MCP statusline resources were read only once, leaving the footer stale when thread state or the display mode changed.

## What changed

- Read the selected provider again one second after each successful read, capturing fresh statusline state for every request.
- Enforce a one-second resource read deadline and stop polling with an error footer on timeouts, RPC errors, or invalid content.
- Cancel outstanding reads when the reader is retired, including thread switches and parking a voice session, and disable provider reads in voice-only mode.

## Testing

Add paused-time tests for polling cadence, fresh state, empty content, failure handling, deadlines, and cancellation. Extend the stdio provider integration test to verify that switching out of raw mode updates the provider footer.

GitOrigin-RevId: 159f17ad9291923e438117d919c875051c9d9426
2026-11-17 07:10:46 +00:00
Joe Savona 46f5a1df9f Render selected MCP statusline providers in the TUI footer (#61979)
## What changed

- With `tui_extensions_statusline` enabled, resolve the saved MCP provider and read its resource with a snapshot of the displayed thread's statusline state.
- Show initialization and error messages, validate the JSON UI tree response, and preserve provider content through native statusline refreshes. Ignore stale results when the thread, provider, or working directory changes.
- Request workspace headlines and thread usage for custom providers even when no built-in statusline items are selected.

## Testing

Add unit coverage for response validation and footer lifecycle, plus end-to-end tests for embedded and remote app servers, startup delays, current thread metadata, and rejection of project-level provider overrides.

GitOrigin-RevId: 80a46ec780c1f1536f1fd4749f468629627dedf6
2026-11-17 06:33:13 +00:00
Joe Savona 7e59b27667 Use the current billing plan for TUI thread usage (#61978)
## Why

Account reads can use a cached subscription plan, and rolling quota updates can carry an obsolete plan. This can leave thread usage unavailable or cause `/status` to display costs using the wrong billing model.

## What changed

- Prefer a known plan from a full Codex quota read over the account plan, regardless of reply order. Ignore unknown quota plans and prevent rolling updates from changing the billing plan.
- Preserve quota plan state across chat widget replacement and apply accepted quota reads even after the requesting status card is gone.
- Refresh thread usage availability when the plan changes and pair asynchronous `/status` estimates with the corrected plan, including native dollar usage for `Ent26`.

## Testing

Add regression tests for reply ordering, unknown plans, corrected pending status cards, obsolete rolling updates, and quota replies arriving after widget replacement.

GitOrigin-RevId: 238fadb587fe98cda0eeb5111c1949928acc8153
2026-11-17 06:32:38 +00:00
Joe Savona 490394c184 Keep TUI quota state scoped to the active provider (#61977)
## Why

Starting or switching chats can carry quota usage, backend banners, and pending recovery from the previous provider, even when both providers report identical account details.

## What changed

- Refresh account state when the started or cached thread uses a different provider, and discard inherited quota and backend banner state across provider changes.
- Track the provider associated with quota inherited by the task list, where the local default can differ from the previous chat's provider.
- Invalidate pending recovery when the provider changes or the chat loses its ChatGPT account, and ignore queued recovery refreshes without a ChatGPT account.
- Preserve quota state and pending recovery when opening another chat on the same provider.

## Testing

Add regression coverage for provider changes with matching account details, stale recovery replies, cached side chats, and quota and recovery preservation across `/new` and task list transitions.

GitOrigin-RevId: f4513ca565f2068489327989ae10b24cada0a9bf
2026-11-17 06:31:18 +00:00
Matthew Ma 61f5910826 Add mouse scroll speed to the TUI config panel (#61976)
## What changed

- Add an Input setting for fullscreen transcript mouse-wheel speed, with presets of 0.5×, 1×, 1.5×, 2×, and 3×. Keep custom configured values available as the current choice.
- Save selections to `tui.mouse_scroll_speed` and apply them to the transcript without restarting.
- Refresh the displayed scroll speed from local settings when changing working directories.

## Testing

Add picker and snapshot coverage for custom values and preset selection, verify persistence and live application, and check that changing directories updates the setting and picker.

GitOrigin-RevId: 4be118e1403e74f5ce819e44949f4d96d9e17648
2026-11-17 06:18:06 +00:00
Benjamin Carlsson 9a5a78925d Add a Cloud environment picker for new TUI conversations (#61974)
## What changed

- Open a searchable picker with `Ctrl+X E` to choose a saved personal or workspace environment, or use Default with the current GitHub project when available.
- Show the selected environment above the composer and expose `tui.keymap.global.choose_cloud_environment` for custom bindings.
- Preserve the composer draft and staged model, reasoning effort, and service tier when changing environments. Remember the saved environment when cycling through a local host and back to the same Cloud backend.

## Testing

Add coverage for picker search and selection, dismissal without losing the draft, keyboard routing, environment label truncation, staged settings on the first turn, and saved-environment reuse after host switching.

GitOrigin-RevId: ac9036fd46b252286852df4d792418a3330bae73
2026-11-17 05:52:43 +00:00
Benjamin Carlsson e9a2a9e115 Support saved environments when starting Cloud threads (#61956)
## What changed

- Add `EnvironmentSelection` to start Cloud threads with either a saved environment ID or a project checkout in the default environment.
- Expose saved environment discovery through the authenticated Cloud request handle, rejecting results if the account changes.
- Thread environment selection through the app-server client and TUI session startup, and defer executor readiness for either explicit environment choice.

## Testing

Extend prewarm request tests to cover saved environment IDs and deferred readiness. Extend TUI session tests to verify saved environment routing without local working-directory or workspace-root overrides.

GitOrigin-RevId: 626cec9926dad8f1a89b1a3ee9e4470850ae6a76
2026-11-17 03:17:05 +00:00
Charlie Marsh 50c227a6e2 Bound item loading for paginated read_thread calls (#61955)
## Why

`read_thread` returns at most 20 items per turn, but requesting full turns loads every item in paginated history before trimming the result.

## What changed

For paginated threads, request turn metadata without items, then fetch the newest 20 items per turn concurrently through `thread/items/list`. Restore chronological item order before building the response and share the item limit with the summary code.

## Testing

Add a regression test that verifies the newest 20 items are returned in order with `includeOutputs` both enabled and disabled.

GitOrigin-RevId: ba73a322cac7ee5262135a271f3574dc22d9d78c
2026-11-17 03:16:31 +00:00
Eric Traut 1443c64c62 Add undo and redo to the non-Vim prompt composer (#61954)
## What changed

- Add configurable `composer.undo` and `composer.redo` actions to the keymap picker. Default undo shortcuts are `Alt+Z` on Unix, `Ctrl+Z` on Windows, and `F7`, with `Super+Z` also available on macOS. Add `Shift` to redo.
- Group contiguous typing and consecutive Backspaces into separate undo steps, and keep detected paste bursts separate from preceding typing. Restore complete drafts, including attachments and large pastes.
- Make startup draft transfers undoable, preserve editing history across Vim mode changes, and clear history when a submitted draft is consumed. Track edits while disconnected so new input invalidates redo.

## Testing

Add regression coverage for grouped edits, paste detection and selection replacement, clipboard images, startup draft transfers, disconnected editing, and keybinding conflicts.

GitOrigin-RevId: 46cadf3c69320367dc972e47e0e8b3d3aac3c4ec
2026-11-17 03:15:14 +00:00
Eric Traut d3b7695db9 Refactor composer undo and redo history (#61951)
## What changed

Rename `VimHistory` to `EditHistory` and update composer edit transactions and history-search state to use it. Consolidate undo and redo stack transfers and history trimming in `EditHistory::step`, preserving the existing Vim-mode bindings and edit grouping.

GitOrigin-RevId: 355993a8c2344971c23805b3e21d587a9f368ede
2026-11-17 02:59:02 +00:00
Adam Perry @ OpenAI 5b3d2c7fce Extract user input preparation into codex-user-input (#61949)
## What changed

Move local attachment snapshotting and conversion from `UserInput` to model request content out of `codex-protocol` into a dedicated `codex-user-input` crate. Update core, the TUI, and the queue extension to use the new crate, replacing the `ResponseInputItem` conversion methods with `from_user_input`.

Move the associated attachment and message conversion tests alongside the implementation, preserving coverage for image positions, media labels, serialization, and error placeholders.

GitOrigin-RevId: 77d0f94a4cd4c2edc008b9e2e63a989995aab058
2026-11-17 02:43:52 +00:00
Benjamin Carlsson 885a1df5ee Allow agent search by thread ID and Git branch (#61926)
## What changed

Extend agent search to match case-insensitive substrings of thread IDs and Git branch names, alongside the existing name, preview, and working-directory matches.

## Testing

Extend live search coverage for branch names and partial thread IDs, and verify that history search finds a persisted thread by a case-insensitive partial ID.

GitOrigin-RevId: 6872c5af589ab5f4ffb563facb07de692fde972f
2026-11-17 00:39:06 +00:00
Felipe Coury 42248f5ef9 Add conversation files to the TUI sidebar chooser (#61922)
## What changed

- List conversation files alongside side chats and open selected files in the sidebar without jumping to a referenced line.
- Show filenames with directory context and add a scrollable full-path view through `p` or the footer action. Show why file previews are unavailable on unsupported hosts.
- Support mouse-wheel scrolling independently of selection, keyboard paging, and hover highlighting. Preserve the selected file as the inventory changes.
- Activate sidebar rows, tabs, and footer actions only after a matching mouse press and release, rejecting drags and stale targets.

## Testing

Add coverage for grouped file rendering, full-path scrolling, selection preservation, and chooser scrolling and keyboard navigation. Update sidebar interaction tests and snapshots.

GitOrigin-RevId: aa402b928c09732df4f9a5c982691b97aadb00ca
2026-11-17 00:15:16 +00:00
Felipe Coury fd05a402b2 Track conversation files for the TUI sidebar (#61920)
## What changed

Build a per-conversation file inventory from message links, completed file changes, generated images, and previously opened documents. Deduplicate destinations while preserving source locations and prioritizing recent references.

Scan older conversation items while the sidebar chooser is open without advancing transcript history. Cancel stale scans when the chooser closes or the connection changes, and refresh the inventory after reconnecting.

## Testing

Add coverage for inventory ordering, remote paths, directory filtering, review and voice items across page boundaries, and reopening the chooser. Verify that older-file discovery leaves the transcript history cursor unchanged and ignores stale completions.

GitOrigin-RevId: a80ea4f4a4e58da8dc142a099cfd048d69276836
2026-11-17 00:13:43 +00:00