Commit Graph
10705 Commits
Author SHA1 Message Date
Eric Traut 19e554bb70 Avoid reading the current directory when resolving absolute paths (#50558)
## Why

`AbsolutePathBuf::relative_to_current_dir` previously read the current directory even for absolute paths, causing resolution to fail if the current directory had been deleted.

## What changed

Route absolute inputs through `from_absolute_path` without querying the current directory. Relative inputs continue to resolve against the current directory.

## Testing

Extend the Unix regression test to verify that `relative_to_current_dir` succeeds with a deleted current directory and produces the same normalized path as `from_absolute_path`.

GitOrigin-RevId: 6bc6cb43d9f4d57359639708c4d30524d89cfa92
2026-10-03 07:14:12 +00:00
Eric Traut 6b43e6fe1f Skip daemon auto-start for Windows-mounted WSL homes (#50555)
## Why

The managed daemon writes an executable and Unix-style state beneath `CODEX_HOME`. Windows-mounted WSL filesystems (DrvFS/9p) do not reliably support the required permission semantics, which can cause startup to fail before the TUI opens.

## What changed

Detect WSL homes on 9p filesystems, checking an existing ancestor when `CODEX_HOME` does not yet exist. Keep the TUI in embedded mode instead of automatically starting the shared background server, and show a startup warning explaining the exclusion.

## Testing

Extend the daemon exclusion warning snapshot to cover the Windows-mounted WSL message.

GitOrigin-RevId: 995e6236d79d8190b0ab1e6b4761eeef3c068467
2026-10-03 07:05:36 +00:00
Ahmed Ibrahim 55b6f282a8 Keep MCP resource helpers available in code mode (#50546)
## Why

In `CodeModeOnly`, MCP resource helper definitions changed when the first server was added or the last server was removed.

## What changed

Always register `list_mcp_resources`, `list_mcp_resource_templates`, and `read_mcp_resource` in `CodeModeOnly`, even without configured MCP servers. This keeps their definitions stable across server configuration changes.

## Testing

Add a regression scenario that calls all three helpers before adding a server, with a server registered, and after removing it. Assert identical tool definitions across requests, empty resource and template lists, and the expected error when reading from an unknown server.

GitOrigin-RevId: c5777efac250b83dd4bb1c9100a6b6169470556f
2026-10-03 06:42:48 +00:00
pakrym-oai 6326163b9a Send incremental tool catalog updates in Responses Lite (#50540)
## What changed

When `IncrementalTools` is enabled for Responses Lite, track tool definitions in world state and conversation history. Send the initial catalog once, then append only added or changed definitions while preserving earlier request history. Emit developer notices for removed tools and namespace instruction changes.

Use history-supplied definitions for normal requests and remote compaction, and omit empty `additional_tools` prefixes. Keep the existing tool delivery behavior for the Responses API and when the feature is disabled.

## Testing

Add unit and snapshot coverage for catalog and namespace transitions, empty catalogs, and stable hashing across JSON object key order. Add a request-history scenario covering unchanged tools, a model switch that changes one definition, persisted catalog hashes, and Responses API behavior.

GitOrigin-RevId: 76bde175973b81f8ad23873919da3c8ddcdf6065
2026-10-03 05:59:07 +00:00
Ahmed Ibrahim e1b5b56a4f Keep shared MCP types stable in Code Mode exec descriptions (#50536)
## Why

Changing a deferred tool's output schema could add or remove the shared MCP type preamble from the `exec` description.

## What changed

Include the default or configured MCP TypeScript preamble whenever `code_mode_only` is enabled, regardless of the available tools' output schemas. Preserve an empty preamble override as a way to omit the section.

## Testing

Add a regression test that checks description stability when a deferred tool gains an MCP output schema, covering default, custom, and empty preambles. Update description expectations, request snapshots, and two Guardian context-budget test thresholds for the added preamble.

GitOrigin-RevId: 725035d6159e9da3c4beff5482c426c082e768b4
2026-10-03 05:51:19 +00:00
guinness-oai 7d5f55bdad Persist realtime transcript tails before closure without inference (#50531)
## Why

When `flush_transcript_tail_on_session_end` is enabled, remaining speech must be available in thread history as soon as realtime closure is reported, even while a model response is still running. Saving that transcript should not trigger another model request.

## What changed

Record the transcript tail directly in model and client history, attaching it to the active turn or creating a completed history turn when idle. Flush persistence before emitting `RealtimeConversationClosed`, and keep realtime context active until recording finishes so the return to text instructions follow the transcript.

## Testing

Extend core and app-server tests to cover immediate history visibility in paginated and legacy modes, idle and active turns, closure without extra inference, transcript reuse in subsequent text turns, and interruption after closure.

GitOrigin-RevId: ae323b711f22aa88db1432e24ad4bb3eb3f08f6b
2026-10-03 05:37:28 +00:00
Eric Traut b65ab465ce Reject unknown TUI keys in strict config validation (#50525)
## Why

Flattened notification settings prevent `serde_ignored` from detecting unknown keys in `[tui]`, allowing them to pass `--strict-config` validation.

## What changed

Detect unknown TUI keys by comparing configured keys with a serialized `Tui`, keeping accepted keys derived from the configuration type. Apply this check to config files and `-c`/`--config` overrides so keys such as `tui.bogus_key_xyz` produce an unknown-field error while valid notification settings remain accepted.

## Testing

Add regression coverage for unknown TUI keys, diagnostic source ranges, valid notification settings, and generic validation behavior. Extend CLI tests to cover TUI overrides and config validation before terminal checks.

GitOrigin-RevId: b04467523442183e7a54415d82c3f632f97ef319
2026-10-03 05:16:04 +00:00
pakrym-oai 86a54b051c Add scenario coverage for remote /compact context preservation (#50516)
## What changed

Add a scenario test and snapshot covering the request before remote `/compact`, the compaction request, the persisted replacement history, and the first subsequent user turn.

Capture the replacement history before the next turn can update its context, and assert that the compaction request contains one `compaction_trigger` and the next request includes the returned encrypted checkpoint.

GitOrigin-RevId: e22e12f16bdb11b1296e81a2e0ffd5f70e560ff6
2026-10-03 04:24:52 +00:00
jackz af5d95f255 Require GovCloud guidance acknowledgment after Bedrock setup (#50510)
## What changed

After successful Amazon Bedrock setup, check whether the configuration uses AWS GovCloud. If detected, show application configuration and security guidance with a terminal hyperlink and require an explicit Enter press to continue. Allow scrolling in short panes while keeping the acknowledgment visible.

Continue onboarding without the warning for non-GovCloud configurations, failed checks, or checks that exceed the 15-second timeout.

## Testing

Add snapshots and tests for the checking and warning screens, explicit acknowledgment, guidance hyperlinks, and scrolling in short panes, including a one-row content viewport.

GitOrigin-RevId: d5d0352af0a50b58e8b8feab5daf75fde428ece7
2026-10-03 03:31:31 +00:00
zm-oai c542fb93ef Record Windows sandbox service stop diagnostics (#50507)
## What changed

Persist the service's last reported lifecycle reason and numeric HRESULT in the existing service registry key. Distinguish requested stops, shutdown, owner removal, startup failure, broker failure, and interrupted registration, and reset the record on startup. Recording is best-effort and does not affect the service lifecycle.

Emit `codex.windows_sandbox.service_stopped` when a provisioning client observes a stopped service, including the recorded reason, HRESULT, and Windows service exit codes. Recheck the service status and registry record before emitting to avoid pairing inconsistent evidence during a concurrent restart. The metric counts observations, not unique outages; the recorded reason is advisory.

Update the cached service status only after `SetServiceStatus` succeeds. Extract diagnostic error codes from typed errors without collecting error text or user data.

## Testing

Add a test covering Win32-to-HRESULT conversion, preservation of Windows HRESULTs through error context, and a zero fallback for untyped error text.

GitOrigin-RevId: d0d39d091410e2b5499a0803475804d12235f836
2026-10-03 03:20:37 +00:00
Benjamin Carlsson 47379efd52 Keep Command Center selection adjacent after task removal (#50505)
## Why

Archiving or deleting the selected task could make Command Center selection jump to the current task instead of a neighboring task in the displayed list.

## What changed

Choose the next surviving task in displayed order before removing tasks, falling back to the previous task when needed. Apply this selection behavior to archive, delete, and hide actions, respecting filtering and grouping.

Preserve the pending selection across view rebuilds, batched removals, and duplicate server notifications. Allow selection to fall back when a rename target disappears while retaining the existing notice about its unsubmitted title.

## Testing

Add regression tests and snapshots for archive/delete selection across project, status, and model grouping, with and without filtering. Cover removal of the attached task, external removal notifications, removal of a pending successor, repeated repaints, and an empty task list. Update the disappeared-rename-target snapshot to verify that the remaining selection is preserved.

GitOrigin-RevId: ca93d664fadbc602993fbdae316c7a375b449345
2026-10-03 03:06:40 +00:00
Benjamin Carlsson d42aecc56b Center TUI confirmations over their retained backdrop (#50504)
## What changed

Render confirmation dialogs as centered overlays while preserving the composer or parent picker behind them. Share dialog sizing and cursor placement across stacked views and full transcript rendering, with input still routed exclusively to the active dialog.

Use the shared confirmation preset for prompts including full access, session archive/delete, goal changes, and log upload consent.

## Testing

Add coverage for backdrop retention and cursor routing at multiple terminal sizes, and for preserving the compact viewport and composer draft after dismissing a confirmation without replaying history. Update confirmation snapshots to show the retained backdrop.

GitOrigin-RevId: 026af89904ec345e2b330317b8cc844512125d0e
2026-10-03 03:00:46 +00:00
Felipe Coury 9ce35d337a Use Enter to accept transcript Find results and Escape to cancel (#50503)
## Why

Accepting a Find result must not let a held `Enter` submit the composer draft, including when terminals report repeated keys as fresh presses.

## What changed

- Make `Enter` accept the displayed result for reading, while `Ctrl+P` and `Ctrl+N` navigate older and newer matches.
- Make `Escape` cancel query editing and restore the pre-search presentation; after acceptance, it returns to the latest transcript content.
- Consume unmodified `Enter` while reading a result, but let modified `Enter` reach configured composer bindings.
- Update footer hints to show acceptance, cancellation, and the active Find state.

## Testing

Extend input-routing coverage for repeated `Enter` presses and modified composer bindings. Update search tests and footer snapshots for acceptance, cancellation, and result navigation.

GitOrigin-RevId: 2a2b7c389240ffa941e3623d7fb7d877455fa9a5
2026-10-03 02:52:56 +00:00
Eric Traut 55922b7984 Include installer stderr in daemon update failures (#50499)
## Why

Daemon updates discard installer stderr, leaving failed installs with only an exit status and no installer diagnostics.

## What changed

Capture the last 2 KiB of installer stderr and append it to errors when the installer exits unsuccessfully. Drain stderr concurrently and wait at most one second after failure so subprocesses holding the pipe open cannot delay error reporting indefinitely. Keep captured details within the manual update response limit, and configure PowerShell output as UTF-8 to preserve non-ASCII diagnostics.

## Testing

Add coverage for stderr tail truncation, bounded draining when a subprocess keeps stderr open, and manual update responses containing heavily escaped diagnostics. Extend the Windows installer test to check non-ASCII error text.

GitOrigin-RevId: d0da19b233006f97770d3f7f5f057e5e98fd2913
2026-10-03 02:39:17 +00:00
zm-oai 8f7a0f7a87 Skip managed config loading for registered Windows sandbox refreshes (#50480)
## Why

Registration-only refreshes retain the existing sandbox, so package maintenance should not require another cloud-policy fetch.

## What changed

Skip managed configuration loading when a provisioning request has both `registered_core` and `refresh_only` set. The registered-runtime transaction still checks the existing owner, accounts, and unchanged settings under the setup lock. Other provisioning requests continue to enforce managed policy.

## Testing

Update the invalid-impersonation-token test to cover all four flag combinations, verifying that only registered refreshes succeed without loading configuration.

GitOrigin-RevId: e65ba1359be65e6314fa483b24fb66ed57a444ac
2026-10-03 01:21:59 +00:00
Eric Traut 6c15cc4aaf Use the app-server default output cap for TUI workspace commands (#50477)
## What changed

Remove the fixed 64 KiB output cap from `WorkspaceCommand` and send
`output_bytes_cap: None` in `command/exec` requests so bounded commands use
the app-server default. Preserve `disable_output_cap` for commands that need
uncapped output, including Git diffs.

GitOrigin-RevId: 6f2ed0d127d9ff2317670851894ae4988f7c7508
2026-10-03 01:09:24 +00:00
Celia Chen 604061ce51 Enable Ultrafast service tiers for Amazon Bedrock Astra models (#50472)
## Why

Bedrock catalogs cleared all service-tier metadata, and requests omitted every selected tier. This prevented users from selecting `ultrafast` or using tiers defined in custom catalogs.

## What changed

- Advertise `ultrafast` for `openai.gpt-6-astra` on Mantle and the `global.openai.gpt-6-astra` and `us.openai.gpt-6-astra` Runtime variants, while retaining the implicit default tier unless users select otherwise.
- Preserve custom catalog speed tiers, service-tier definitions, and defaults while continuing to normalize Bedrock web search compatibility.
- Send selected service tiers only when the Bedrock model advertises them, including `flex`.

## Testing

Add coverage for `model/list` tier discovery, custom catalog preservation, configured and per-turn HTTP request tiers, and TUI slash-command selection, toggling, and model switching.

GitOrigin-RevId: 4793e7af7b9f604a6b7812611030da6adb8acd35
2026-10-03 00:31:51 +00:00
Owen Lin be48ae396e Account for JSON overhead when truncating MCP tool results (#50470)
## Why

Truncating the preview alone can leave the serialized MCP tool result above its byte budget because JSON escaping and the result wrapper add bytes.

## What changed

Measure the complete serialized replacement and progressively reduce the preview budget until the result fits or the preview is empty.

## Testing

Strengthen the regression test with quotes, backslashes, and newlines. Assert that the serialized result fits within the 1,024-byte budget and that truncating it again returns the existing result unchanged.

GitOrigin-RevId: ebd97b1a6ca71343941a96e472cb313028ac680c
2026-10-03 00:13:58 +00:00
Felipe Coury f5a2272c6c Copy transcript selections as literal text while preserving rich HTML (#50467)
## Why

Copying rendered transcript selections added Markdown formatting and escapes to the plain-text clipboard payload. Selecting bold text such as `hello` could paste as `**hello**`.

## What changed

Separate the literal selection text from the Markdown source used to render clipboard HTML. Plain-text copies omit inline formatting delimiters, added code fences, and Markdown escapes while retaining list and table structure. Rich-text pastes continue to preserve formatting through HTML.

## Testing

Update clipboard and transcript selection tests to verify literal text alongside rich HTML, including lists, inline code, paths with Markdown punctuation, hard breaks, streamed code blocks, and tables across layout widths.

GitOrigin-RevId: 980ee2ed0b0e201b581a3a301fa04d796c65af2e
2026-10-03 00:02:11 +00:00
Anton Panasenko ef8cfe5e96 Retry registry authentication outages and jitter executor reconnects (#50465)
## Why

Remote executors need to recover from confirmed authentication-service outages and spread reconnect attempts after a shared outage. Registration retries must remain limited to confirmed failures before a write, since replaying an ambiguous request can replace a newer registration.

## What changed

- Retry registry responses with HTTP 502 and `authentication_service_unavailable`, alongside the existing HTTP 503 `registration_conflict` retries.
- Accept structured registry errors in `detail`, keeping the canonical `error` authoritative when both are present.
- Randomize reconnect delays between half and all of the current exponential backoff, retaining the 30-second cap.

## Testing

Add coverage for reconnect jitter bounds, authentication-outage retry cancellation, error-envelope precedence, and preservation of Noise identity and initialized sessions across retries. Make the HTTP-header helper cleanup test wait for the helper PID before cancellation and verify process termination when the provider is dropped.

GitOrigin-RevId: 35fdb57732d17b0bbfeca8a4dc557a0988e29a31
2026-10-02 23:54:32 +00:00
pakrym-oai a0bfaac70c Add the incremental_tools feature flag (#50464)
Register `incremental_tools` as an under-development feature that is disabled by default, and expose it in the configuration schema for top-level and profile feature settings.

GitOrigin-RevId: 9579822c745e9fce598085bdc5ef8da6aabb06d7
2026-10-02 23:49:14 +00:00
Benjamin Carlsson 09bced5ad9 Populate thread previews from delegated task inputs (#50462)
## Why

Delegated turns can begin without a user message, leaving threads without a task preview. Populate the preview from delegated input so these threads are discoverable before a user follow-up.

## What changed

- Extract previews from completed `create_thread` and `send_message_to_thread` outputs in the `codex_app` and `codex_tui` namespaces.
- Unwrap recognized `<codex_delegation>` inputs and decode their escaped task text for display, preserving model content. Keep plain or unrecognized wrappers as text and ignore blank inputs.
- Fill missing previews in state metadata extraction and live thread metadata updates without replacing existing previews or setting the title or `first_user_message`.

## Testing

Add tests for delegation decoding and tool filtering, preview-only metadata updates, preservation of later user-message metadata, and database listing before a user follow-up in both legacy and paginated history modes.

GitOrigin-RevId: f7b3c60ef75e08c76b4084d043e3967bf2bade22
2026-10-02 23:34:11 +00:00
Celia Chen c6049ebd96 Add capability overrides for custom model providers (#50459)
## What changed

Allow Responses-compatible providers to configure live web access and remote compaction under `model_providers.<id>.capabilities`:

```toml
[model_providers.custom.capabilities]
external_web_access = false
remote_compaction = "v2"
```

`external_web_access = false` keeps hosted web search from accessing the live web. `remote_compaction` accepts `v2` to send `compaction_trigger` items through the Responses endpoint, or `unsupported` to use local compaction. Omitted capabilities retain existing provider defaults.

## Testing

Add unit coverage for preserving unspecified defaults and a request-snapshot scenario verifying cached web search and V2 compaction for a custom provider.

GitOrigin-RevId: fbcc4870aa51c112af575d711679a3941d1e7878
2026-10-02 23:26:27 +00:00
Owen Lin 820f85cf59 Truncate oversized MCP results in paginated thread history (#50458)
## Why

Paginated thread history can persist large MCP results in completed tool-call items. Bound these stored results to avoid retaining multi-megabyte payloads.

## What changed

Apply a 64 KiB preview budget when persisting oversized MCP results in paginated history. Replace the result with a truncated text preview of its serialized JSON, preserving `is_error` and clearing `structuredContent` and `_meta`. Leave small results unchanged.

Share the truncation helper with the existing MCP tool-call event path.

## Testing

Add helper tests for unchanged small results and oversized results with structured content and metadata. Add a thread-history test verifying that persisted MCP results contain a bounded preview with the beginning, end, and truncation marker while preserving tool arguments.

GitOrigin-RevId: 09dce73c70bfd357c9b9630f456e9e5c1d8492cf
2026-10-02 23:15:02 +00:00
Owen Lin 3c3a990da0 Measure rollout persistence size reductions (#50454)
## What changed

- Record original and persisted item sizes in `codex.rollout.persistence.item_bytes_v2`, distinguished by stage, and record positive size reductions in `codex.rollout.persistence.bytes_removed`. Count the full original size as removed for dropped items.
- Use explicit histogram boundaries from 1 KiB to 64 MiB for item sizes, bytes removed, and `codex.rollout.persistence.turn_bytes_v2`. Larger values remain represented in the overflow bucket and histogram sum.
- Align item and turn size stages and report a measurement error when a kept item's persisted size cannot be measured.

GitOrigin-RevId: 6487acf1c6f2c041ab9680ab398491d3c1541388
2026-10-02 23:06:56 +00:00
pakrym-oai fd75aa116c Remove the provider capability gate for tool namespaces (#50447)
## What changed

- Remove `namespace_tools` from `ProviderCapabilities` and `namespaceTools` from `ModelProviderCapabilitiesReadResponse`, updating generated schemas and SDK types.
- Preserve tool namespaces and configured collaboration tool namespaces without a provider capability check, and always use Responses Lite tool serialization for Responses Lite requests.
- Gate tool search on `supports_search_tool` and retain the existing image generation and web search checks without requiring a namespace capability.

GitOrigin-RevId: ae1843563736765a40e03a02c41ff5e470018a93
2026-10-02 22:55:08 +00:00
Dmitriy Kovalenko 9b0a676d5d Bundle rollout attachments into a gzip tar archive (#50446)
## What changed

- Combine file-backed rollouts and buffered rollout prefixes into `rollouts.tar.gz`, keeping diagnostics as separate attachments.
- Bound the archive and its upload envelope by the existing size limit, skip invalid or duplicate archive filenames, and fall back to individual rollout attachments if archiving fails.
- Add `rollout_archive_filename` to the report thread index so rollout filenames identify archive entries or fallback attachments.

## Testing

Add an upload test that extracts the archive and verifies the filenames and contents of both a compressed file-backed rollout and a buffered rollout. Update the thread index test to check the archive filename.

GitOrigin-RevId: 973da6eec2249b04ef7992b5e1e4fd27f044b80f
2026-10-02 22:47:52 +00:00
Sean Huang d4eed6dca5 Assert that only direct tool calls emit timing events (#50445)
## What changed

Strengthen `tool_call_timing_guard_ignores_code_mode_source` to capture tracing output and assert that direct and nested code-mode calls together emit exactly one `codex.tool_call` event. Disable ANSI formatting and keep callsite interest independent of untraced parallel test threads.

GitOrigin-RevId: cbf0c9bf6d4e5a72b6a1eb08e6aac43e257f2dcb
2026-10-02 22:47:30 +00:00
Sean Huang a4bfd07d51 Stabilize paused-time code-mode service tests (#50443)
## Why

Tokio's paused clock can auto-advance while tests await the V8 thread. The service tests need explicit control over time when checking yield limits and grace periods.

## What changed

- Hold virtual time with a blocking-task guard that is released when dropped.
- Replace bounded polling loops with tool-start notifications and direct awaits of response tasks.
- Return an error from the test helper if the cell closes before a nested tool starts.

## Testing

Add tests covering tool-start acknowledgement when a cell throws or is terminated before invoking a nested tool, including assertions on the resulting cell responses.

GitOrigin-RevId: c221c0501ec0354052102c0211cc651008babff3
2026-10-02 22:29:52 +00:00
asohrabi-oai 3629508849 Preserve native USD amounts in thread usage responses (#50442)
## What changed

Add optional `native_usage_usd_micros` fields to thread usage totals and breakdown groups, and carry backend values through the client alongside existing credit and USD estimates. Missing or null native amounts remain `None`, while explicit zero amounts remain `Some(0)`.

## Testing

Add coverage for native totals and group amounts, mixed batches with legacy responses, and the distinction between missing, null, and zero native group amounts.

GitOrigin-RevId: 53891fc95807138e2eccb99d4cda1520b857dba4
2026-10-02 22:20:55 +00:00
pakrym-oai 0df76892b1 Support ordered response items in world-state context updates (#50441)
## Why

World-state sections could return only a single optional text fragment, with message separation controlled by the fragment itself. They could not contribute explicit `ResponseItem` values alongside instructions.

## What changed

- Let sections return ordered `WorldStateUpdate` values containing fragments or response items, with `Prefix`, `Standalone`, or `Mergeable` placement.
- Preserve explicit item boundaries when grouping context updates, and place prefix updates first when assembling initial context.
- Move standalone-message decisions from fragments to world-state updates and retain snapshot handling.

## Testing

Add tests for mixed fragment/item ordering, role and standalone boundaries, initial-context prefix placement, and snapshot restoration without repeated updates.

GitOrigin-RevId: c2514c3c98538da83f5140c10a9d89f531de6549
2026-10-02 22:12:07 +00:00
chess 12a30d4e6d Add a CLI command to uninstall the legacy Windows sandbox (#50437)
## What changed

Add `codex sandbox uninstall` to remove machine-wide legacy Windows sandbox accounts and network rules with administrator privileges. Run cleanup without loading configuration, preserving Codex home, sandbox directories, and filesystem permissions. Reject the command on other platforms.

Keep commands after `--` forwarded to the sandbox, including `codex sandbox -- uninstall --help`.

## Testing

Add parsing coverage for the uninstall subcommand and command separator. Add an integration test verifying that help and invalid arguments work with malformed configuration and leave configuration and credentials unchanged.

GitOrigin-RevId: d2b02ef7bc0a05742dd5eb3c47292ad517d46664
2026-10-02 21:51:46 +00:00
pakrym-oai 602d2add6e Persist additional tool definitions in rollout history (#50435)
## Why

`additional_tools` response items were excluded from rollout persistence, dropping their tool definitions from saved history.

## What changed

- Persist `additional_tools` items in both legacy and paginated history modes.
- Expose the variant in generated JSON schemas, TypeScript types, and Python models, with an optional `id`, a `role`, and arbitrary JSON tool definitions.

## Testing

Add a recorder round-trip test that verifies tool definitions survive recording and loading in both history modes without parse errors.

GitOrigin-RevId: 0e7c7b1c10401ec6513fb744de642a1cf9e461d7
2026-10-02 21:42:45 +00:00
Benjamin Carlsson c536ffcb18 Add keyboard copy selection to the owned transcript (#50434)
## What changed

- Make `/copy` select the latest completed response directly in the owned transcript. Navigate user messages, code blocks, and blockquotes with arrow keys or `j`/`k`, use `g`/`G` to jump to the ends, and press Enter to copy or Escape to close.
- Highlight selected blocks and keep surrounding context visible during navigation and resizing. Preserve source payloads for code and quotes, including rendered Mermaid diagrams and fenced Markdown tables.
- Pause queued submissions until copy mode closes, and report clipboard results in the transcript footer.

## Testing

Add tests for copy routing, keyboard navigation, highlighting and resize behavior, source whitespace and line endings, clipboard completion, and queued-input resumption.

GitOrigin-RevId: bd4f58ec17568f95d0e91014e5ddba33ca8bd57c
2026-10-02 21:42:23 +00:00
Eric Traut 66561d0301 Allow API-key accounts to use Daybreak in the TUI (#50433)
## What changed

Allow accounts using an API key with the OpenAI provider to access `/daybreak` and Daybreak policy notices. Model availability and the connected server still determine program access.

Use the same eligibility checks for turn submission, continuation, and retries. For API-key accounts, send the selected `cyberAccessProgram` when Daybreak is enabled and omit it when Daybreak is off.

## Testing

Extend session lifecycle coverage to check API-key turn parameters with Daybreak enabled and disabled. Add an API-key `/daybreak` help snapshot and update the signed-out error snapshot.

GitOrigin-RevId: ab6d4313c430f316ef9835d4facb878aab0b9725
2026-10-02 21:40:39 +00:00
Benjamin Carlsson b6903c0669 Preserve terminal hyperlinks in agents overview previews (#50431)
## What changed

Keep Markdown link destinations attached to prompt and last-message previews in the agents overview details pane as text wraps and is clipped. Render visible links as terminal hyperlinks, while keeping truncation ellipses unlinked.

## Testing

Add a regression test and snapshot covering links that span multiple rows, prompt links, and clipped previews with unlinked ellipses.

GitOrigin-RevId: d121e062b197790ce45a70d6d64aadcb181e4dde
2026-10-02 21:28:40 +00:00
Owen Lin bee28e8a06 Cap persisted command output in paginated history at 64 KiB (#50427)
## Why

Paginated history previously persisted completed commands' full `aggregated_output`, allowing large command outputs to inflate stored history.

## What changed

- Limit persisted command `aggregated_output` to 64 KiB, including a truncation marker. Preserve the beginning and end of the output without splitting UTF-8 characters.
- Apply the shared persistence policy to rollout recording, thread-store appends, and legacy-to-paginated history migration.
- Measure persisted payload bytes after truncation so persistence metrics reflect the stored representation.

## Testing

Add coverage for the byte limit, UTF-8 boundaries, unchanged inputs that fit, and markers that exceed the budget. Verify capped output in paginated thread history and migrated legacy history, and verify persistence metrics use the truncated payload size.

GitOrigin-RevId: 01d420d396ad34b42dc5dc208c0bf88d890639ee
2026-10-02 21:00:06 +00:00
Adam Perry @ OpenAI 44dd77b71e Honor Retry-After headers in failed Responses events (#50418)
## Why

Streamed `response.failed` events can carry retry advice in `response.error.headers`. Ignoring it loses server-provided delays or uses a conflicting delay from a rate-limit message.

## What changed

- Parse nested `Retry-After` headers using the existing HTTP header validation and retry parser, and preserve them for rate-limit, overload, and generic retryable failures.
- Prefer valid headers over rate-limit message advice, falling back to the message when the header is absent or invalid. Keep terminal error classifications unchanged.
- Reject unrepresentable plaintext retry durations without panicking.

## Testing

Add regression coverage for header precedence, validation, and terminal errors, plus retry-loop coverage for SSE sampling, remote compaction, and WebSocket failures.

GitOrigin-RevId: 46433c2e9e6d5e804211ef96950fadd70e322b49
2026-10-02 20:19:28 +00:00
Benjamin Carlsson dff5270b29 Clarify Git worktree choices for new and forked conversations (#50416)
## What changed

Label the `/new` and `/fork` picker options “Use current Git worktree” and “Create new Git worktree”. Explain that creating a worktree makes a separate checkout of the repository in another directory.

## Testing

Update picker assertions and snapshots for both commands to cover the revised labels and description.

GitOrigin-RevId: b7fb1aac3107e39c324707f9ae69c210a97346d7
2026-10-02 20:04:57 +00:00
Owen Lin c5d242fa79 Consolidate command execution output into aggregated_output (#50402)
## What changed

- Remove `stdout`, `stderr`, and `formatted_output` from `CommandExecutionItem` and `ExecCommandEndEvent`, retaining `aggregated_output` as the output field.
- Update command event producers, legacy conversion, rollout traces, and the precomputed schema. Use aggregated output for terminal trace results.
- Clear `interaction_input` in emitted and migrated command completion items.

## Testing

Update command execution and trace tests to use aggregated output, and assert that legacy rollout migration preserves `aggregatedOutput`.

GitOrigin-RevId: ed59827d4a5ec9a767084ee4feac72c2042440f2
2026-10-02 18:48:49 +00:00
Benjamin Carlsson d61c7a824f Honor pager bindings for transcript page keys (#50396)
## Why

Transcript scrolling hardcoded `PageUp` and `PageDown` to full-page movement, ignoring customized pager bindings.

## What changed

Resolve unmodified `PageUp` and `PageDown` through the pager's scroll bindings so they can scroll by a full page, half a page, or one row, or remain unbound. Preserve the one-row overlap for full-page scrolling and leave pager typing shortcuts unhandled by the transcript.

## Testing

Add a regression test and snapshot covering default, half-page, single-row, and unbound configurations. Verify that `PageDown` reverses `PageUp` scrolling and that `j` and `Ctrl+u` remain unhandled.

GitOrigin-RevId: 945e99d7370f84f326ab71037be2924dddada32c
2026-10-02 18:29:19 +00:00
Eric Traut f88a6efe43 Honor configured keybindings before transcript navigation (#50389)
## Why

Transcript selection can consume a configured composer shortcut such as `ctrl-space`, preventing it from submitting a prompt or steering a running turn.

## What changed

Let explicitly configured shortcuts for active actions take precedence over transcript key handling when no transcript interaction is active. Include global binding fallbacks, while preserving empty `Enter` returning to the latest transcript content and default `PageUp` scrolling.

## Testing

Add regression coverage for `ctrl-space` submission with idle and running turns, default `PageUp` scrolling, and empty `Enter` returning to latest with composer or global submit bindings.

GitOrigin-RevId: 16613043a7634b47fd24e4ee9feacdce94a9fabd
2026-10-02 18:11:50 +00:00
Yuzhu Shen 1ab8c6ef28 Fix thread unloading after disconnect during MCP startup (#50380)
## Why

If required MCP startup outlasts the requesting connection's cleanup, the newly created thread can remain loaded without subscribers because its listener is never started.

## What changed

Start the thread listener even when the requesting connection has already closed, allowing normal idle unloading to clean up the thread while preserving the `ConnectionClosed` result.

## Testing

Add a regression test that disconnects during blocked required MCP startup, then releases startup and verifies a `thread/closed` notification, an empty `thread/loaded/list`, and MCP process exit on Unix.

GitOrigin-RevId: 4ad912a82177266316042d806f5faa1713a48fa4
2026-10-02 17:40:09 +00:00
Ian MacLeod 50b4c5e58c Use printable ASCII terminal titles under GNU Screen (#50375)
## Why

GNU Screen truncates Unicode in OSC titles to a byte, which can turn visible characters into control bytes and spill title text into the terminal.

## What changed

Detect Screen through `STY` and convert the full terminal title to printable ASCII. Map activity spinners and the status dot to ASCII equivalents, and replace other non-ASCII content with `?`. Keep Unicode titles outside Screen and preserve Unicode in TUI status rendering.

## Testing

Add coverage for ASCII title output with activity indicators and Unicode names, preserved Unicode outside Screen, and removal of control and invisible formatting characters.

GitOrigin-RevId: e6b45b9be0d06ab3c3eece89885647f3e9db17da
2026-10-02 17:21:14 +00:00
Owen Lin c73775f19e Remove initial messages from session configuration events (#50360)
## What changed

Remove `initial_messages` from `SessionConfiguredEvent` and the corresponding schema. Stop attaching replay history to startup events for resumed or rejoined threads, and remove `InitialHistory::get_event_msgs`.

## Testing

Update the MCP resume test to verify persisted tool events through `load_history`, and retain coverage that resumed requests include prior conversation items.

GitOrigin-RevId: 54b72bc44423c9b1ef2051891ef392c0ede32fe5
2026-10-02 16:55:41 +00:00
Eric Traut 91168365a5 Render ANSI styles in TUI hook system messages (#50359)
## Why

Hook system messages were rendered as plain text, leaving ANSI formatting uninterpreted.

## What changed

Parse hook system messages into styled spans so colors and text styles render across lines. Preserve hook prefixes, continuation indentation, and trailing blank lines.

## Testing

Add a snapshot test for multiline ANSI styling and style resets, and extend multiline coverage to include a combining character and a trailing newline.

GitOrigin-RevId: 0a5a88ec26fac114fc66efa656bacf6fa15a1adf
2026-10-02 16:45:32 +00:00
Brent Traut f4e18a95bb Skip unrelated subtrees during config alias normalization (#50354)
Return a clone immediately when the current path is not a prefix of any
registered legacy config key. This avoids recursively visiting unrelated
subtrees while preserving alias normalization along matching paths.

GitOrigin-RevId: 1c7e62898e12ab3f468b978f865805989914ac44
2026-10-02 16:37:30 +00:00
cooper-oai 9d2b60303e Back off automatic remote control reconnects with jitter (#50348)
## Why

Closed WebSocket connections previously triggered immediate reconnects, and successful handshakes reset backoff even when connections were short-lived.

## What changed

- Delay automatic reconnects before token refresh or enrollment, and report `Connecting` while waiting.
- Use exponential backoff with jitter between half and all of the delay, starting at 5 seconds and capped at 30 seconds.
- Retain backoff across short-lived connections and reset it after a connection lasts at least 60 seconds.
- Interrupt the reconnect delay on shutdown, auth owner invalidation, or enable/disable changes, including an immediate disable/enable pair.

## Testing

Add connection tests for delayed token refresh, backoff retention and reset, explicit re-enabling, and prompt shutdown. Update retry tests to check jitter bounds, saturation during sustained failures, and backoff retention after a successful handshake.

GitOrigin-RevId: 0b9055ff64ff7d96f2d974b73ced8d4ffd02ac9e
2026-10-02 16:05:51 +00:00
Eric Traut 84d5437b6e Keep the subagent picker consistent with thread archive state (#50345)
## Why

Cached subagents can remain in the TUI picker after being archived, including when archive notifications are missed.

## What changed

- Hide archived threads from the picker and keyboard navigation, and restore them when unarchived.
- Refresh both active and archived descendants to reconcile cached visibility, including after dropped server events. Queue a follow-up refresh when needed and preserve visibility changes received during an in-flight refresh.
- Preserve picker selection by thread ID as visible rows change, and mark archived thread attachments as replay-only.

## Testing

Extend regression coverage for missed archives, unarchive notifications, hidden subagent navigation, and the subagent enable prompt when only archived subagents are cached.

GitOrigin-RevId: 9e75906dfe6946b1400583a386922453e2b77ea1
2026-10-02 15:56:32 +00:00
Michael Bolin 4cedd0caac Add end-to-end coverage for MCP sandbox state enforcement (#50339)
## What changed

Add an MCP integration test that forwards sandbox state from tool-call metadata unchanged to `codex sandbox --sandbox-state-json` and runs a real subprocess.

Verify that workspace writes succeed, overwriting an existing file outside the workspace fails and preserves its contents, and relative paths resolve against `sandboxCwd` rather than the MCP server's working directory.

GitOrigin-RevId: 768513c74679010e806a62dffdde6b7cccbfb41f
2026-10-02 15:26:58 +00:00