Commit Graph
9 Commits
Author SHA1 Message Date
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 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