Commit Graph
3586 Commits
Author SHA1 Message Date
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
Felipe Coury a669d8ffb2 Add sidebar image previews and present generated images after answers (#61919)
## What changed

- Open PNG, JPEG, GIF, and WebP file links as sidebar image previews, fitted to the available space with format and dimension labels. Show a fallback when terminal graphics are unavailable, and preserve text previews for files such as Git LFS pointers.
- In the owned transcript, place completed, saved image results after the assistant's answer, with larger, left-aligned previews and a clickable `Generated image` label. Preserve this ordering during replay and history pagination, including interrupted turns.
- Reuse native Kitty image IDs and move existing placements without retransmitting their pixels. Probe Kitty graphics support in `herdr` before enabling previews.

## Testing

Add regression coverage for sidebar preview fallbacks, generated-image ordering, pagination and search, preview layout, Kitty placement reuse, and graphics probe replies interleaved with pasted input.

GitOrigin-RevId: 22d8aa2724f17bfa7f8280a2d11d4a7e2cb66728
2026-11-17 00:13:04 +00:00
Joe Savona 30be9534c8 Fall back to the built-in status line for invalid providers (#61915)
## Why

An invalid `tui.status_line_provider` should not prevent startup in normal mode.

## What changed

Use the built-in status line when the effective provider selection is invalid and emit a startup warning identifying its source. Keep the invalid selection's precedence so it overrides lower-priority providers, while preserving the original configuration for diagnostics and `config/read`.

With `--strict-config`, reject invalid provider selections in every configuration source.

## Testing

Update coverage for malformed user settings and incomplete profile selections, and add a CLI case verifying strict provider validation before terminal checks.

GitOrigin-RevId: 797d1c71dd4803db59ca91880a07e2e2118ce097
2026-11-16 23:57:23 +00:00
Chris Dong 837f8b50be Pass a per-call voice session ID through TUI realtime startup (#61908)
## What changed

Generate a UUID v4 for each TUI realtime call, send it in the `voice-session-id` header, and forward the same value as `voiceSessionId` in `thread/realtime/start`.

## Testing

Extend realtime request tests to verify that the ID is a canonical UUID v4 distinct from the thread ID and matches across call creation and realtime startup.

GitOrigin-RevId: 8446b4bf9965b6034422b3f8cf83e20840425c43
2026-11-16 23:24:42 +00:00
Felipe Coury 3a51865c8c Open source file links at line and column targets in the TUI (#61890)
## What changed

- Extend sidebar previews beyond Markdown to source files, including extensionless files. Preserve line and column targets such as `./Makefile#L12C3`, scroll to the target, and highlight its line and character.
- Render source previews with syntax highlighting and line numbers when space permits. Keep plain Markdown links rendered as Markdown, and show source when a location is specified.
- Show local link labels without appended destinations when workspace previews are available, and emphasize links on hover. Refresh rendering when preview availability changes.
- Limit source previews to 1 MiB and 10,000 lines, and disable document previews for Windows workspaces.

## Testing

Add coverage for extensionless link parsing, matching hover and click targets, streamed file citation metadata, and source navigation with CRLF input, tab reuse, and Escape handling.

GitOrigin-RevId: c2629b122628a4f5afa17df1890f63bd1c9bbcf6
2026-11-16 21:50:03 +00:00
Felipe Coury 7c3f5e2cc2 Add search, selection, and link navigation to document previews (#61889)
## What changed

- Enable search, keyboard and mouse selection, and Markdown copying in sidebar document previews, including copying while offline.
- Navigate links with `Tab` and `Shift+Tab`, then open them with `Enter`. Open web links in the browser and resolve file links relative to the current document.
- Render local Markdown links as interactive labels and preserve distinct link occurrences across wrapping.
- Add document zoom, scroll indicators, and contextual footer hints. Disambiguate document tabs with matching filenames, including when titles are truncated.
- Cancel pending PRIMARY selection publication when a document is hidden and preserve the intended destination for composer clipboard pastes.

## Testing

Extend document preview coverage for search, selection, offline copying, link activation, hidden PRIMARY selections, and duplicate tab titles. Add rendering tests for local link labels and navigation across wrapped links.

GitOrigin-RevId: 80240fa580eed9dda971759afc49bc2bb909fcb5
2026-11-16 21:49:32 +00:00
Felipe Coury be5db96264 Add read-only document previews to the TUI sidebar (#61888)
## What changed

- Open transcript file links in sidebar tabs when the TUI workspace is enabled, resolving and reading files through the focused thread's app server and rendering their contents as Markdown.
- Support pager keys, mouse scrolling, switching between document and chat tabs, and closing previews with `Esc`. Reuse existing previews and allow failed opens to be retried.
- Show loading and error states, and prevent late document results from taking focus back after the user switches views.
- Adapt tab widths to the available space, preserve filename extensions in truncated labels, and keep divider dragging aligned to exact terminal columns.

## Testing

Add coverage for workspace-gated link opening, loading and error states, retrying, custom pager bindings, multiple previews, tab reuse, closing during loading, and preserving focus when results arrive late. Update tab and divider assertions and snapshots.

GitOrigin-RevId: e979b757c623c29a8ed50277ec929655d783ad18
2026-11-16 21:49:03 +00:00
Felipe Coury 59d8c79789 Add app-server file preview read helpers (#61887)
## What changed

Add session helpers to resolve file paths against the source thread's workspace and read preview bytes through `fs/readFile`. Require a workspace on the app-server host, restrict reads to POSIX paths, and reject reads when the workspace changes.

Add text document validation that rejects invalid UTF-8 and control characters other than tabs and line endings.

## Testing

Add a mock WebSocket app-server test covering source-thread metadata requests, relative path resolution, large text reads, invalid UTF-8, binary content, and workspace changes during a read.

GitOrigin-RevId: b51cb227e478d72cba42309828e40bbffff6d847
2026-11-16 21:46:24 +00:00
Felipe Coury d5a478e31c Preserve local Markdown document targets in transcript rendering (#61880)
## What changed

Retain eligible local `.md` and `.markdown` link targets as document metadata and allow transcript hit testing to resolve them when `document_links` is enabled. The flag defaults to disabled, and document targets are excluded from terminal OSC-8 links.

Preserve link metadata through narrow table layouts, account for grapheme widths when remapping header links, and retain literal backslashes in POSIX file URI targets. Keep validated workspace artifact links usable as terminal hyperlinks.

## Testing

Add regression coverage for opt-in document hit testing, narrow table link ranges, styled emoji and escaped pipes, POSIX file URI backslashes, and validated workspace artifact links.

GitOrigin-RevId: e5d12c8558f5210eb66c17b5be8b28b7e80d414f
2026-11-16 21:10:24 +00:00
Eric Traut dba22f2acc Support flat subgraphs in native Mermaid flowcharts (#61878)
## What changed

Parse `subgraph title` and `subgraph ID[title]` blocks and render labeled frames around their nodes and internal edges. Support edges between nodes in different groups in all four flowchart directions.

Keep nested subgraphs, edges to subgraph IDs, and subgraph-local directions unsupported, preserving source fallback for unsupported input. Document the expanded syntax subset.

## Testing

Add snapshot and regression coverage for group rendering, cross-group edges, all four directions, width limits, and invalid or unsupported subgraphs. Extend TUI native-renderer coverage to include grouped flowcharts.

GitOrigin-RevId: 5bed535bcd4991b53143e3a591eef04f46ef4bd1
2026-11-16 20:53:56 +00:00
Benjamin Carlsson 77873dd0d2 Preserve plugin skill picker ranking across version changes (#61871)
## Why

Plugin skill paths include the installed version, so changing versions loses the influence of previous selections on `$` picker ordering.

## What changed

Aggregate selection frequencies using a version-independent key for cached plugin skills. Recognize both configured and canonical plugin cache paths so usage history still applies when the cache is symlinked. Continue ranking by frequency within each match tier.

## Testing

Extend the composer regression test to load usage from an older plugin version and verify that the current version is preferred within its match tier, including a symlinked cache on Unix.

GitOrigin-RevId: 483619dc75254898982959ff5f3bcb1f17d6ff0e
2026-11-16 20:06:03 +00:00
viyatb-oai effad7568c Allow network policy to enable transparent TCP capture (#61851)
## What changed

- Add `transparent_tcp` to network configuration and managed requirements, defaulting to off. When enabled, route outbound TCP from managed Linux sandbox commands through the managed SOCKS5 proxy without requiring an executor startup flag.
- Propagate the setting through local and remote execution, require an enabled SOCKS5 proxy, and check the executor's `networkProxyTransparentTcp` capability before remote launches.
- Refresh the live proxy when switching between permission profiles with different network settings.

## Testing

Add coverage for configuration-driven sandbox capture, rejection of unsupported launch contexts, execution parameter propagation, and live permission profile changes.

GitOrigin-RevId: c4db87056de116f433a128806bef673802f35397
2026-11-16 18:19:16 +00:00
tongzhou wang 0184dfa6a4 Fix the missing label style in the mention truncation test (#61762)
Initialize the file result with `ThreadLabelStyle::Plain` in
`fuzzy_matches_preserve_graphemes_when_truncated` so the test supplies the
required `SearchResult` field.

GitOrigin-RevId: c1dbfc3b4d094511b2f480020d8365813f2d89d5
2026-11-16 06:49:48 +00:00
zm-oai 5a6bbd29a4 Clarify shell-specific login guidance for exec_command (#61744)
## Why

The `login` description claimed a fixed default and described Unix shell flags for every shell. In PowerShell, disabling login startup skips profiles, which can make profile-defined commands unavailable.

## What changed

Describe omitted `login` values as inheriting the setting. When a turn environment reports PowerShell, explain that `login: false` skips profiles and advise keeping profiles enabled for commands that depend on them, including unattended commands.

## Testing

Add coverage for shell-specific descriptions, remote environment readiness, and exact normalization of PowerShell wording in portable tool snapshots. Update prompt-prefix compatibility checks and affected snapshots.

GitOrigin-RevId: f6cb29c6c32921241cbd1be0c31f985c5ae274f9
2026-11-16 04:54:23 +00:00
Benjamin Carlsson 630c0d75ab Mark cloud threads with a cloud icon in the TUI (#61742)
## What changed

Prefix cloud thread labels with `☁︎` in resume and fork pickers, the agents overview and task details, task mention suggestions, side chat tabs and chooser, status lines, and terminal titles. Keep the marker separate from thread names, search text, and identity, and account for its width when truncating labels.

Track cloud backend identity independently of live connections so thread labels retain their marker after a disconnect.

## Testing

Extend rendering tests and snapshots to cover cloud and local labels, narrow layouts, side chat tabs and chooser, and terminal title fallbacks and truncation.

GitOrigin-RevId: ea8189ebcc5e35d2d2ef95d6a4a87ca23b5e3b8f
2026-11-16 04:23:56 +00:00
Eric Traut 540eb31ece Keep bidirectional TUI headers stable during shimmer (#61731)
## Why

Per-grapheme color updates can break native terminal bidirectional rendering in thinking and reasoning headers.

## What changed

Render text containing strong right-to-left characters or Arabic numbers as a single, static dimmed span in both shimmer implementations. Preserve logical text order and use one-second clock updates for these status headers when progress animation is disabled.

## Testing

Add snapshot coverage for Hebrew, Arabic, mixed-direction text, and Arabic numbers, checking that headers remain unchanged during the shimmer sweep. Add scheduling tests for static headers and active progress animation.

GitOrigin-RevId: 911abc50f00db597ae4dcfca9941e9f63547c2f9
2026-11-16 03:24:23 +00:00
Eric Traut eff3036bf4 Preserve graphemes in mention search match highlighting (#61726)
## Why

Splitting fuzzy matches into individual Unicode scalars can break multi-codepoint emoji when mention results are truncated.

## What changed

Render highlighted names and parent paths as whole grapheme clusters, using scalar match indices for names and grapheme match indices for paths. Bold the entire grapheme when any part matches.

## Testing

Add a regression test covering truncated plugin names and file paths containing `👩‍💻`, checking both rendered text and bold match styling.

GitOrigin-RevId: 516d6668a9a22f79483adb0c576ed190b4f4a784
2026-11-16 02:41:09 +00:00
Eric Traut e649c6d74c Fix Unicode grapheme highlighting in history search (#61725)
## Why

Ctrl+R history search highlights need to cover whole grapheme clusters so that matches on combining marks highlight the visible character.

## What changed

- Map case-insensitive matches to grapheme boundaries and deduplicate identical highlight ranges.
- Segment the separately rendered `!` bash prompt independently from the textarea so a prompt-only match does not highlight the command body.

## Testing

Extend match-range tests for repeated combining marks and rendering coverage for combining-mark matches and prompt-only matches.

GitOrigin-RevId: d8f5c5ebb06b1130153b3cfbc8631342a57cfa1c
2026-11-16 02:40:38 +00:00
Eric Traut 09c711b783 Use clip.exe for single-line ASCII clipboard copies in WSL (#61724)
## Why

Single-line ASCII copies can use the lightweight Windows clipboard writer without starting PowerShell.

## What changed

- Try `clip.exe` for printable ASCII text and tabs, falling back to PowerShell if it is unavailable or fails. Bound discovery and execution by short deadlines.
- Keep PowerShell for Unicode, multiline text, and other control characters. Pad even-length ASCII input with a trailing NUL to prevent `clip.exe` from interpreting it as UTF-16.
- Preserve precedence and command compatibility for installed Linux `powershell.exe` adapters, and defer Windows PowerShell discovery until needed.

## Testing

Extend WSL clipboard tests to cover input eligibility and padding, adapter precedence, and expired deadlines.

GitOrigin-RevId: 69b66ec1243452d0a4df119563321f38d177bea9
2026-11-16 02:39:33 +00:00
Eric Traut aea4c6ee4b Restore raw mode after returning from external editors (#61713)
## Why

An editor's suspend/resume cycle can change terminal settings while crossterm still considers raw mode enabled, preventing Codex from restoring raw mode on return.

## What changed

On Unix, clear crossterm's raw-mode cache before reapplying TUI terminal modes after an external program exits.

## Testing

Extend the external-editor PTY test to simulate an editor restoring canonical mode with `stty sane` and verify that canonical input and echo are disabled after returning to Codex.

GitOrigin-RevId: 4ae151deaf073bddf5a1c7fdfb5a1b5f4a480375
2026-11-16 00:14:36 +00:00
Eric Traut 58d5d3a040 Open Windows desktop sessions through the registered URL handler (#61711)
## What changed

Launch desktop session URLs with PowerShell's `Start-Process` instead of resolving and starting the packaged executable directly. Restrict the installed `OpenAI.Codex` package check to the two supported publisher IDs and select the first match.

GitOrigin-RevId: 350029a2101ff048de52fa9f9444e4b5dbdcc12e
2026-11-16 00:04:24 +00:00
Eric Traut 96e0673f6e Enable slash-command completion for unavailable threads (#61710)
## Why

Restricted input dismissed the slash-command popup when a thread was unavailable, preventing users from selecting recovery commands from partial input.

## What changed

Keep the command popup available while editing an unavailable thread's draft. Allow navigation, Tab completion, and submission of eligible recovery and local commands, including with custom submit keys. For example, typing `/sub` and pressing Enter selects `/subagents`.

Continue to reject commands unavailable in this state and invalid command arguments. Preserve Vim escape and search behavior without reopening the popup during search.

## Testing

Add regression tests and a popup snapshot covering highlighted recovery completion, blocked commands, custom submit keys, and Vim escape and search behavior.

GitOrigin-RevId: 38021db8cdcd9f7ec7c62cfa0efd8819bf8057da
2026-11-16 00:03:52 +00:00
Eric Traut b048d4a95c Avoid legacy transcript reads in the agents overview (#61709)
## Why

Listing even one turn of a legacy thread replays its entire rollout. Overview refreshes should avoid that work just to populate previews.

## What changed

- Fetch saved prompt and reply previews only for threads with paginated history.
- Update legacy prompt previews from user-message notifications and preserve them across refreshes and reverts.
- Retain the latest observed reply preview when a thread closes.

## Testing

Extend overview tests to reject legacy turn-list requests, verify paginated previews, preserve live prompts across stale refreshes and reverts, and retain reply previews after thread closure.

GitOrigin-RevId: 85130adda155c5ea93c5a5c2b3f89a945170ba51
2026-11-16 00:03:21 +00:00
Eric Traut 598df2d015 Refactor exec to use the shared app-server client (#61706)
## What changed

- Use `AppServerClient` throughout exec and extract turn completion into `finish_turn`, including handling for server and thread-stream disconnections.
- Move remote address parsing and auth-token resolution into `codex-app-server-client`, with re-exports from the TUI.
- Allow human-readable exec output to be initialized without a local `Config`.

## Testing

Move remote address and auth-token tests into `codex-app-server-client`, retaining coverage for WebSocket and Unix socket addresses, invalid addresses, and missing, empty, or whitespace-padded tokens.

GitOrigin-RevId: 465b17a1c03392a7d4e7700d83ce67c2cf5ef021
2026-11-15 23:50:49 +00:00
Eric Traut a394ff9cf6 Restore the terminal's original alternate-scroll mode (#61697)
## Why

Releasing TUI input modes previously disabled alternate scrolling unconditionally, overriding terminals where it was initially enabled.

## What changed

- Query alternate-scroll mode (`1007`) during the Unix startup probe and filter its replies from replayed input.
- Restore the recorded mode during editor handoff and exit, defaulting to disabled when the initial state is unknown.
- Retry scroll-mode restoration after a failed cleanup write.

## Testing

Extend startup probe tests to parse enabled and disabled reports. Add coverage for preserving both initial states across handoff and exit, and retrying failed restoration.

GitOrigin-RevId: 786a44c04da6e2c9cb9af73c096d8df92ded88e9
2026-11-15 21:38:40 +00:00