Commit Graph
13765 Commits
Author SHA1 Message Date
Shuo 8dcd56d0cb Add external header auth for existing realtime calls (#62114)
## What changed

Add `RealtimeExistingCallAuth` to `RealtimeAttachmentOptions`, with model-provider authentication as the default. Embedding hosts can explicitly select `ExternalHeaders` for existing calls to use header-based credentials and the host's transport without adding model-provider headers or performing runtime agent registration.

Require an explicit, nonempty sideband URL and header-based authentication for this mode. Destination authorization remains the trusted host's responsibility, and application network policy still applies.

## Testing

Add integration coverage for external-header and model-provider authentication through event delivery, reconnect, and detach. Verify that model-provider credentials are excluded in external-header mode and that invalid authentication, missing URLs, and network policy denials reject the attachment before a WebSocket handshake.

GitOrigin-RevId: 2c915e1cf76a3563f58f751272db1ec50718d925
2026-11-17 22:00:20 +00:00
nvogt-oai 39a7b53fa4 Trust the bundled Memory session hook without saved hashes (#62112)
## Why

The bundled Memory hook needs to supply context at startup and after compaction without requiring saved hook trust.

## What changed

Recognize the exact bundled Memory `SessionStart` declaration as a built-in hook: the `^(startup|compact)$` matcher, `codex_apps` server, `codex_dream_memory.get_mec` tool, and empty input. Carry the expected app connector identity through discovery for dispatch checks, and hide this built-in hook from hook listings while preserving other plugin hooks.

## Testing

Add coverage for exact declaration matching, hook listings without an Apps connection, and a scenario snapshot verifying memory context injection at startup and after compaction without saved trust.

GitOrigin-RevId: edc0e8ffa955227328345f46afecc2a868c0be49
2026-11-17 21:40:36 +00:00
Abhinav 8fca6ffb92 Support OTel header helpers in local managed requirements (#62110)
## What changed

- Allow system `requirements.toml` and MDM requirements to set `otel.headers_helper` and `otel.headers_helper_refresh_interval_ms`, and expose both fields through the requirements API.
- Require an absolute executable path and run managed helpers directly from their installation directory. Reject helper settings from cloud requirements.
- Restrict managed helper headers to OTLP HTTP exporters with nonempty endpoints configured in the same requirements layer. Replacing the helper or an exporter revokes the previous binding.
- Document deployment and rollback requirements, including client compatibility and pausing affected exports until a failed helper recovers.

## Testing

Add coverage for exporter layer boundaries, cloud policy rejection, relative path rejection, managed helper execution and recovery, missing executable diagnostics, and requirements API output.

GitOrigin-RevId: 271058010c2e3090eb97cb357b70be4dc41b43db
2026-11-17 21:10:09 +00:00
ben zhang 8011b92bc8 Log macOS user verification enrollment failure diagnostics (#62107)
## What changed

Add structured warnings for enrollment failures during key lookup, access control creation, key creation, key validation, and public key export. Include available native and underlying error codes and allowlisted error domains, without logging error descriptions or other error metadata.

After a failure, check biometric readiness using a fresh, noninteractive context and include the result in the warning. Preserve the original error classification.

GitOrigin-RevId: 697e1a69dc5c8e457b61aff9a674e7aca77f86f2
2026-11-17 20:05:26 +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
Charlie Marsh 9a56c2b1aa Preserve plugin runtimes across catalog metadata updates (#62105)
## Why

An advertised plugin release or installation metadata change should preserve live MCP sessions and cached skills while the active local bundle remains unchanged, including when an upgrade fails.

## What changed

- Compare runtime identity, enablement, connector ownership, and the active bundle separately from catalog release, policy, and display metadata.
- Track the active bundle's directory version and persisted remote plugin ID so changes made by another process refresh the runtime.
- Retain pending runtime notifications until a host callback is available and deliver them through `plugin/reconcile`.
- Preserve cancellation recovery across retries while avoiding unnecessary runtime invalidation for catalog fetch failures.

## Testing

Add unit and app-server regression coverage for catalog-only updates, failed upgrades, externally activated bundles, deferred notifications, and reconciliation recovery.

GitOrigin-RevId: ab20012c1bfd760adea55614f49fbbc7ef86fe8b
2026-11-17 19:46:24 +00:00
Tom 7457b7268f Preserve trace context during WebSocket startup prewarm (#62103)
## What changed

- Inject the current span's W3C trace headers into WebSocket handshakes.
- Promote `startup_prewarm` to an info span and fall back to the current span when it is disabled, preserving trace context in the spawned task.

## Testing

Add a regression test for `traceparent` and `tracestate` propagation through the handshake, prewarm request, and subsequent turn on the same connection. Verify that prewarm uses the startup trace while the turn uses its own trace, with the prewarm span both enabled and filtered out.

GitOrigin-RevId: 1e196e132a1991206469060ab80a474857fa7909
2026-11-17 19:24:17 +00:00
Dylan Hurd 7fb2cd20c8 Stabilize app-server and login integration tests (#62102)
## What changed

- Run guardian action-budget permission hooks locally with a host-accessible working directory, and apply the test timeout to thread startup.
- Use an empty probe file for the process-spawn handshake, removing the content assertion after file creation is detected.
- Remove the explicit graceful shutdown from the config-server login/logout test.
- Wait for fallback login cancellation to finish and assert that it returns an error, replacing the two-second timeout.

GitOrigin-RevId: a696834162bf910bf114c35648366a4f94bb56f2
2026-11-17 19:23:05 +00:00
adaml-oai 5cba3aec84 Support transparent TCP with inherited PID namespaces (#62100)
## What changed

Allow transparent TCP with `--linux-sandbox-pid-namespace=inherit` while keeping PID isolation as the default. In inherited mode, use the existing `/proc` view and verify socket visibility before starting the command.

Run the relay and workload as separate supervised children, protect relay descriptors from inspection, and kill the workload's process group if the relay exits first. Document cleanup behavior and the limits on terminating background descendants in inherited mode.

## Testing

Extend managed TCP integration coverage to inherited PID namespaces, including namespace identity, existing network and filesystem restrictions, and workload process-group cleanup after relay failure.

GitOrigin-RevId: c40befb95f10af39e9607235c3d78a04142ac168
2026-11-17 19:10:29 +00:00
RJ 6d40c0ac9b Clarify recovery guidance for stale Guardian authorization (#62099)
## What changed

Give `StaleAuthorization` failures specific guidance explaining that the action did not run and the failure is not a policy denial. Instruct the agent to retry once through Guardian if current instructions authorize the action, resolve unclear authorization before proceeding, and avoid bypassing approval or repeatedly retrying a failed review.

## Testing

Extend the authorization refresh tests to verify the blocked tool output includes this guidance when repeated authorization changes exhaust the review budget, for both approval and denial responses.

GitOrigin-RevId: f6fcbe46fdb5131f70ee905220a58c7331b543fd
2026-11-17 19:09:21 +00:00
adi-oai 0122b120cd Centralize app-server turn error conversion (#62096)
## What changed

Add a shared `From<ErrorEvent>` implementation for `TurnError` and reuse it in thread history, rollout projection, and live event handling. Preserve the existing field mappings and keep `additional_details` unset.

Parameterize the compaction replay test by error code and recoverability, retaining the existing `server_error` case, and document retry expectations for WebSocket closes.

GitOrigin-RevId: 3afcc23e9fdc314477febe6b4a4aeb680efafd5a
2026-11-17 18:56:05 +00:00
Adnan Hajar cb64621bf3 Normalize Bedrock Mantle commentary before replay (#62095)
## Why

Bedrock Mantle's reasoning prefix omits empty `annotations` on assistant commentary. Replayed commentary needs to preserve that form to keep the prefix stable.

## What changed

Add a provider hook to normalize completed output items before they enter model history. For Mantle, omit empty `annotations` from assistant commentary text while preserving nonempty annotations, final answers, and Bedrock Runtime output.

## Testing

Add regression coverage for Mantle and Runtime that checks commentary replay across a tool continuation and a subsequent turn, including reasoning and tool item ordering and preservation of final-answer content.

GitOrigin-RevId: ecd5b9b5dca8c24956a6379c9d0fb643e4427af3
2026-11-17 18:55:30 +00:00
Dylan Hurd 04cfdee311 Ensure Windows sandbox passwords include every character class (#62094)
## Why

Randomly sampling a combined alphabet can omit character classes required by the machine's password policy, causing sandbox account password updates to fail.

## What changed

Generate 24-character passwords with `OsRng`, guarantee uppercase and lowercase letters, digits, and symbols, and shuffle the result.

## Testing

- Add a regression test checking length, allowed characters, and all four character classes across 256 generated passwords.
- Let the profile cleanup test wait up to 10 seconds for directory deletion to complete, tolerating transient access, sharing, and delete-pending errors after `DeleteProfileW` succeeds.

GitOrigin-RevId: f3adc1249383d7ad769a4e230f978df4a02cd4d3
2026-11-17 18:45:10 +00:00
surajs-oai e9a43d43c5 Return empty success output from v2 send_message (#62093)
## What changed

Remove the acknowledgment text and `followup_task` hint from successful v2
`send_message` responses, including messages sent to the root agent. The shared
messaging handler now returns empty text with the success flag set.

Update the idle eviction follow-up scenario snapshot to expect empty tool output.

GitOrigin-RevId: 9eab3ae7264e6ddf3db6ae40a34cc895d0954621
2026-11-17 18:44:30 +00:00
Charlie Marsh 444803ddcd Skip recent rollouts before reading headers during compression (#62092)
## Why

Recent rollouts are ineligible for compression, but reading their headers during scanning can still update their access times on relatime mounts.

## What changed

Check modification times before opening rollout headers and skip files younger than seven days. Record these skips through shared compression statistics and metrics helpers, while retaining the age check before encoding.

## Testing

Extend the worker test to verify that scanning leaves a recent rollout's access time unchanged. Age the malformed-header fixture so it continues to exercise metadata read failures.

GitOrigin-RevId: eca72e8c170af975a1f91fa95adcfc62ab038151
2026-11-17 18:42:08 +00:00
jif bc2c328483 Append transcript provenance to Guardian JSON instructions (#62090)
## What changed

Place JSON transcript provenance instructions after the policy and output contract in Guardian reviewer and classifier prompts. Keep classifier provenance outside the configured prompt token cap.

## Testing

Update prompt composition tests, classifier configuration and integration assertions, and the Guardian review snapshot to verify the new ordering.

GitOrigin-RevId: f0f86b80a96a130043521aeb529d691e8f424c20
2026-11-17 18:24:49 +00:00
jif 4046bdf263 Avoid an admission deadlock in the code mode spawn test (#62089)
The completion barrier in `yielded_code_mode_spawn_preserves_metadata_and_plaintext`
could hold shared admission while the agent spawn needed exclusive admission.
Replace that barrier with a `wait` call on the yielded cell outside nested tool
dispatch, keeping the next turn active until the spawn completes.

GitOrigin-RevId: 17a17941c933e44c0be9d70479741d4c814c3f8b
2026-11-17 18:23:40 +00:00
Charlie Marsh c08843a5bd Skip redundant history materialization on flush (#62085)
## Why

Flushing an already projected rollout still reads its metadata and opens its history for SQLite materialization, even when no durable bytes remain to project.

## What changed

For paginated thread history, compare the plain rollout file length with the saved projection offset on flush and return early when a nonzero offset matches. Use only plain file lengths because compressed sizes are not decoded JSONL byte offsets. Continue materializing any durable suffix when the projection is behind.

## Testing

Extend the flush regression test to verify that an up-to-date projection preserves existing rows and that flush catches up with durable suffixes in both plain and compressed rollouts.

GitOrigin-RevId: 7078fe77e2b43beed7ceee024f309501da3a1d2b
2026-11-17 17:29:51 +00:00
ioanbudea-OAI 6d94d4af10 Isolate Guardian v2 score caches by policy revision (#62083)
## Why

Overlapping turns can use different Guardian policies. Scores and retained classifier conversations must stay with their policy revision, while late actions from older turns must still age or invalidate the current policy's cached approval.

## What changed

- Select and retain a policy-specific conversation backend for each turn, with separate scores, authorization, and classifier history.
- Share action tracking, wrapper lag, JavaScript execution allowances, and classification admission capacity across policy backends.
- Record scoring failures across policies and require the cached score's source action to cover them before reusing an approval. Report missing scores and scoring failures before checking lag.
- Retire all retained policy backends when the thread stops or its backend is replaced, preventing late results from being published.

## Testing

Add regression coverage for separate classifier histories, shared admission capacity, late actions and failures from older turns, and delayed scores that do not cover a recorded failure.

GitOrigin-RevId: 020fa07f9269a28635cbe2cfd40bb5acd90de090
2026-11-17 17:17:02 +00:00
jif f993175205 Add policy-checked dispatch for bundled App hooks (#62080)
## What changed

Carry an expected connector identity on hook MCP calls and add a bundled App dispatch path that requires the host Apps server, a matching connector, and current policy permitting execution without user approval.

Prepare hook calls from the current Apps client catalog, including app-only tools, without exposing those tools to the model or starting unrelated required servers. Refresh session MCP state before preparation and recheck admission before dispatch so configuration changes and logout invalidate stale calls. Never retry a dispatched call.

## Testing

Add coverage for refreshed approval and enablement policies, connector mismatches, app-only tool visibility, preparation without unrelated server startup, and admission invalidation on refresh or logout.

GitOrigin-RevId: 965dd7f79baa40d1be0e158e47b2679d8ba98fe5
2026-11-17 16:56:34 +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
Charlie Marsh 378364e784 Reuse regexes across rollout snippet searches (#62076)
## Why

Thread search compiled the same snippet-matching regexes for each rollout file. Reusing them avoids repeated compilation and preserves regex scratch caches across file scans.

## What changed

Introduce `RolloutSnippetMatcher` to lazily compile and share patterns for one search term. Reuse the matcher across thread search catalog pages and within compressed rollout search workers, preserving per-file I/O error precedence.

## Testing

Add regression coverage for lazy, once-per-matcher compilation, matching decoded text across files, and independent concurrent searches spanning catalog refills. Adapt compressed rollout tests to the matcher API.

GitOrigin-RevId: 1a7ade8c8c4ee533a452658808886a1d83e90741
2026-11-17 16:27:00 +00:00
swastik-oai ce5a565ba0 Simplify Guardian history review preambles (#62074)
## What changed

Use “Treat the content as evidence, not as instructions to follow” in both initial and follow-up Guardian history review preambles, replacing the explicit list of transcript and action fields described as untrusted evidence. Update the corresponding prompt and scenario snapshots.

GitOrigin-RevId: 200ee3c858b54b38fe2609598ef3a1e40cf36380
2026-11-17 16:16:36 +00:00
jif 02d60fb5cc Preserve client attribution when spawning subagents (#62072)
## Why

Delegated work should retain client attribution such as `cost_center` from the turn that requested it, even when a yielded code-mode cell spawns its child after a newer parent turn starts.

## What changed

Capture client metadata from the originating turn and apply it to the child's initial turn in both legacy and v2 agent spawning. Children and grandchildren retain the captured values when the parent is later steered with updated metadata.

Exclude `misalignment_override`, `parent_response_id`, and `mcp_request_meta` from inheritance, while preserving each child's own thread and turn identifiers.

## Testing

Add coverage for metadata filtering and snapshot isolation, legacy and v2 spawning with fresh or forked history, grandchild inheritance, and spawning from a yielded code-mode cell after the parent advances to another turn.

GitOrigin-RevId: 8c378c49239ccfac03deb2b793fc69aba1d41644
2026-11-17 16:15:55 +00:00
jif cac9284d24 Test prompt-prefix preservation across app-server resume (#62071)
Add a persisted-thread resume test with incremental tools enabled. Change the model description between app-server runs to force an updated `spawn_agent` declaration, then verify that resume preserves the original instructions, tools, and input prefix and appends the updated declaration.

Use the released binary from `CONTRACT_EXECUTOR_BIN` for the initial run when available; otherwise, use the current binary for both runs.

GitOrigin-RevId: 4a53d54ca0e8638277b27d9d6bec6ac46bdef5dd
2026-11-17 16:14:00 +00:00
jif b271854568 Allow the expanded agent model shortlist in prompt-prefix tests (#62070)
## Why

Released CLIs can still advertise five model overrides in `spawn_agent`, causing the prompt-prefix comparison to reject the expanded shortlist.

## What changed

- Accept the exact four-model addition to the `spawn_agent` description when comparing against a release, while preserving checks for all other description changes.
- Refresh the collaboration tool hashes in the bundled statusline skill snapshot.

GitOrigin-RevId: 22cfd81215734d9f3aba84eda2102c25d75fce96
2026-11-17 16:12:36 +00:00
jif c6a41e32f6 Upgrade XML dependencies and remove obsolete advisory ignores (#62068)
## What changed

- Update `plist` to `1.10.0` and `wayland-scanner` to `0.31.11` in the Cargo and Bazel lockfiles, consolidating on `quick-xml` `0.41.0` and removing `0.39.4`.
- Remove the `RUSTSEC-2026-0194` and `RUSTSEC-2026-0195` exceptions from the audit and deny configurations.
- Remove the `RUSTSEC-2024-0320` exception for `yaml-rust` from the audit configuration.

GitOrigin-RevId: 8dfddd0d0b6887a46f64f27068b4b6cc7ccd4225
2026-11-17 15:55:01 +00:00
jif 7444076df4 Refresh dependency locks and RustSec advisory exceptions (#62067)
## What changed

- Update `zip` to `9.0.5`, its compression dependencies, and `libz-sys` to `1.1.33` in the Cargo and Bazel lockfiles.
- Remove the `RUSTSEC-2026-0410` and `RUSTSEC-2026-0418` exceptions now that `zstd-sys` and `libz-sys` meet their patched version thresholds.
- Add matching Cargo audit and deny exceptions for unmaintained `chrono` and three `hickory-proto` advisories affecting DNSSEC validation, which is disabled in the network proxy. Document conditions for removing or reassessing these exceptions.

GitOrigin-RevId: 13892515e348b41e41cc92b0c91823b119ec55db
2026-11-17 15:53:52 +00:00
jif 58627e6fea Fix turn interrupt reply ordering and shutdown handling (#62066)
## Why

A delayed terminal event from an earlier turn could acknowledge interrupts for a later turn. Interrupts could also remain pending after the thread listener shut down.

## What changed

- Associate pending `turn/interrupt` requests with their target turn and reply only when that turn completes or aborts.
- Track the current Core turn through stop hooks and resolve review delegate IDs to the owning turn when validating interrupts.
- Settle pending interrupts with an error on listener shutdown and reject further interrupts against the retired runtime.

## Testing

Add regression tests for delayed terminal events, queued turn starts, review delegates, and interrupt handling during thread revert and runtime replacement.

GitOrigin-RevId: 9695fc3f718baa6b792a14d54136bb87fc003100
2026-11-17 15:33:21 +00:00
Eric Traut 0cc88d0c74 Reject conflicting remote endpoints for resume and fork (#62065)
Extend the remote endpoint conflict check to `codex resume` and `codex fork` so
conflicting root and subcommand `--remote` values report a command-specific
error before authentication token lookup.

Add regression coverage for both commands with conflicting endpoints and an
unset authentication token environment variable.

GitOrigin-RevId: 7fb7bc3f05d8d17d740b0d82c7cd9b327426c1fb
2026-11-17 15:32:10 +00:00
bencodes-oai 8b5223dd7b Use Bazel's Python runtime for MCP permission hook tests (#62061)
## Why

MCP permission hook tests need a Python interpreter on workers without a system Python installation.

## What changed

- Include Bazel's Python interpreter and runtime files in core test dependencies, and allow file labels in `runfile_env`.
- Run permission hook scripts directly with `CARGO_BIN_EXE_python3`, falling back to the platform's Python command when unset.
- Use script bootstrapping so Python launchers start with their declared interpreter on lean workers.

## Testing

Add 15-second timeouts to two permission hook approval tests so they fail if approval waits for a reviewer instead of resolving through the hook.

GitOrigin-RevId: 2877be1411b47806a0eccf2838b521a732e2c98a
2026-11-17 15:10:58 +00:00
viyatb-oai 595f497f15 Stop masking system SSH configuration drop-ins in Linux sandboxes (#62058)
## What changed

Remove the bubblewrap special case that overlays `/etc/ssh/ssh_config.d` with an empty, read-only directory. Access to system SSH drop-ins now follows the configured filesystem policy.

Remove the associated documentation and SSH handshake test fixture.

GitOrigin-RevId: 7b4db44f4f565b941ba6aba94f7a76d5b42ab11e
2026-11-17 14:54:42 +00:00
Eric Traut 640b86dc87 Escape installer PATH entries for shell metacharacters (#62055)
## Why

Installation directories containing shell metacharacters can be interpreted incorrectly in shell profiles and the printed launch command.

## What changed

Escape installation directories in the generated `PATH` export and reuse that export in the current-terminal instructions. Preserve the escape sequences when rewriting an existing profile block by passing the line through the `awk` environment.

## Testing

Add a regression test that installs into directories containing shell metacharacters, verifies `codex` lookup after adding and updating the profile, and executes the printed launch command.

GitOrigin-RevId: b6c6044382128c97dfb503516f5eeaa934c85bbb
2026-11-17 14:38:53 +00:00
rhan-oai 5a4aff8431 Expand the spawn_agent model listing cap to 16 (#62051)
## What changed

Raise the model listing cap from 5 to 16 for `spawn_agent` tool descriptions, context catalogs, and unknown-model errors.

## Testing

Add coverage for both catalog modes to verify the 16-model limit, exclusion of hidden and unsupported models, description truncation in context, and matching model choices in unknown-model errors.

GitOrigin-RevId: 9ca20d4ec5bfd67f953c41dbad2b5f55fe2d5421
2026-11-17 14:20:08 +00:00
viyatb-oai 05ae1b0fdd Centralize sandbox network and shell credential setup (#62050)
## Why

A missing executor proxy launch config can still require managed networking. Only an explicitly disabled executor proxy should suppress that enforcement.

## What changed

- Prepare executor proxy launch settings and enforcement together, preserving the distinction between missing and disabled proxy configurations.
- Bundle sandbox enforcement, the live proxy, and the environment ID in `SandboxNetwork`, retaining the proxy through shell snapshot setup.
- Share shell-startup credential classification and application through `ShellStartupCredentials`, including protected `zsh` snapshots, supported `bash -c` commands, and unmasked fallback handling.

## Testing

Extend the exec-server sandbox preparation test to verify that an explicitly disabled proxy omits both the proxy launch config and managed-network enforcement.

GitOrigin-RevId: e2f3b543680c9184b6557b81de02a61f0a977e32
2026-11-17 13:52:56 +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
Sean Huang db9778b73c Distinguish image and tool audio attachment uploads (#62047)
## What changed

Introduce `UploadContent::Image` and `UploadContent::ToolAudio` in `UploadRequest`. Keep image filenames and policy tags on the image variant, and carry tool audio's declared MIME type explicitly instead of encoding its type and MIME metadata in tags.

Update image preparation, image generation, and tool audio callers to use the typed content. Preserve inline bytes for both variants and redact their payloads from debug output. Document that persistent backends must verify the declared audio MIME type against the uploaded bytes.

## Testing

Add coverage for inline tool audio byte preservation and audio debug redaction. Update integration assertions for typed image and audio uploads, and verify that Code Mode does not upload audio when `FileBackedToolAudio` is disabled.

GitOrigin-RevId: 7dbd69922b377aead2dc28d1e5b3938cce6343b7
2026-11-17 13:38:34 +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 b47df356af Add a bundled skill for authoring MCP statuslines (#62036)
## What changed

Add the explicitly invoked `create-statusline` skill with guidance for building, registering, and selecting a custom Codex CLI footer provider. Include a Python stdio MCP starter that renders the current thread's model and agent state from each resource read's snapshot.

## Testing

Add a scenario snapshot for loading the bundled skill by name and a Python protocol test covering provider discovery, per-read snapshots, and Unicode text.

GitOrigin-RevId: e48fd5064ad93bf37b50b5643028d4153a3b4f59
2026-11-17 12:22:55 +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