Commit Graph
11841 Commits
Author SHA1 Message Date
swastik-oai 315f0efb34 Scope Guardian V2 response timing to snapshot sampling (#51065)
## What changed

Measure `responses_duration` directly around `sampler.sample()` in the snapshot classification path. Leave it unset for conversation classification instead of timing submission and waiting for the score.

GitOrigin-RevId: 4cfac9db6f19f3c8513d7bf839ea9631d41bf3ac
2026-10-05 09:52:25 +00:00
jif c8949e55c2 Ignore stale refresh responses in agents overview tests (#51064)
## Why

Aborting a refresh task cannot retract a response already queued for delivery. The test helper could consume that stale response and return before the replacement refresh completed.

## What changed

Make `finish_overview_refresh` skip responses whose request ID does not match the active refresh. Extend the lifecycle test to queue an invalidated response before removing a task, exercising the wait for the replacement refresh.

GitOrigin-RevId: 97341681682e8dce9a9512fbcc1d5c0351b084f5
2026-10-05 09:51:15 +00:00
jif cacdc46619 Honor prior cancellation before starting Codex delegates (#51063)
## Why

An already-cancelled delegate spawn can report a runtime admission or startup error instead of `TurnAborted`, including when runtime shutdown has been requested.

## What changed

Check the cancellation token before runtime admission and session startup so prior cancellation returns `TurnAborted` immediately after approval-policy validation.

## Testing

Extend the pre-cancelled spawn test to cover both normal operation and requested runtime shutdown, asserting `TurnAborted` within a one-second timeout.

GitOrigin-RevId: 5a25a211acdd5c246a3c638243ccc8b7240fd051
2026-10-05 09:50:51 +00:00
jif 435d1b3f19 Gate Guardian continuation tests on classifier request capture (#51061)
## Why

Snapshot classifier requests can arrive out of order, so continuation tests need to keep the next tool blocked until the current tool's classifier request has been captured and checked.

## What changed

Gate every mock Guardian review in high-risk review continuation scenarios. Release each review after checking the corresponding classifier request, preserving the ordering needed by the existing assertions.

GitOrigin-RevId: 9e52acd2bb1ce2fb71100fe0e1b92304d29e9634
2026-10-05 09:42:37 +00:00
alishobeiri-oai 7f892275e3 Isolate tracing in the strict third-party tool deferral test (#50977)
## Why

The warning assertions need tracing callsite interest to remain independent of untraced parallel tests, even when the test runner already owns the global subscriber.

## What changed

Run the test on a current-thread Tokio runtime and capture warnings with a thread-local subscriber and an explicit buffer. Keep a `NoSubscriber` dispatch alive to stabilize callsite interest, and assert the deferral warning and `client_echo` directly against the captured logs.

GitOrigin-RevId: 5bf22b2cbfefcf8f65016d2cc1444112d9f6a6c7
2026-10-04 23:07:12 +00:00
Ahmed Ibrahim 4ad985e2ca Track inference tool changes in turn analytics (#50964)
## What changed

Add `tools_change_count` to turn profiles and turn analytics events. Compare the full model-visible tool list before each sampling request, retaining the previous list across turns and connection resets. The first list establishes a baseline; subsequent changes increment the current turn's count.

## Testing

Add coverage for schema changes, tool additions, ordering changes, empty lists, and tracking across sessions and transport fallback. Extend the turn event serialization test to include `tools_change_count`.

GitOrigin-RevId: 44a15c42dc7d0b35c166666faeb9627b718b33dd
2026-10-04 21:19:05 +00:00
Ahmed Ibrahim 335c7f8eca Gate stable environment tool exposure behind a feature flag (#50962)
## What changed

Add the default-off `stable_environment_tools` feature flag. When enabled, advertise environment-backed tools before an executor is ready, keep environment selectors stable as readiness changes, and include the `shell` and `login` parameters. Execution still requires a usable environment and its policy.

When disabled, expose environment-backed tools only when a usable environment exists, derive selectors from usable environments, and condition shell parameters on the execution configuration. Restore tool-specific unavailable-environment errors and skip the environment readiness check for `write_stdin`.

## Testing

Parameterize the empty-environment tool availability test for both flag states, check that commands require a ready transport by default, and explicitly opt tests that rely on stable tool exposure into the feature.

GitOrigin-RevId: 68c6240fb3adf85d7f9b407804d4823c515abfdc
2026-10-04 21:08:31 +00:00
zm-oai de3721a7be Recover malformed Windows deny-read ACL state safely (#50940)
## Why

Malformed `deny_read_acl_state.json` previously caused deny-read ACL reconciliation to fail. Recovery must restore bookkeeping without removing unknown existing restrictions or modifying a linked file's contents.

## What changed

- Retry malformed reads for up to two seconds, then rebuild bookkeeping only after excluding active writers and successfully applying current deny-read ACLs. Preserve unknown historical denies and continue propagating I/O errors.
- Validate the opened state file before reading or writing, rejecting reparse points and files with multiple hard links.
- Write state in place without truncating before validation, preserving file identity and permissions. Retry sharing violations during writes while preventing replacement through delete access.

## Testing

Add Windows tests for corrupt-state recovery, linked-file rejection, concurrent writer and delete-handle behavior, file identity and ACL preservation, and subsequent permission-profile changes. Extend the elevated sandbox integration test to verify that denied reads remain blocked after recovery while allowed writes and deletes succeed.

GitOrigin-RevId: 4aca32df00d015df3763fdc447ffdfbe3fd6cec0
2026-10-04 19:07:36 +00:00
Eric Traut c2f7fe89d8 Use server model defaults for connected TUI fresh starts (#50913)
## Why

Fresh starts connected to an app server can bootstrap with stale client model settings before reading the server configuration. An empty model catalog can also prevent startup even when managed new-thread defaults provide a model.

## What changed

- Read server configuration before model bootstrap for fresh starts using a local daemon or remote server without an explicit profile.
- Preserve explicit model and reasoning-effort overrides, clear implicit client settings when `config/read` is unsupported, and allow managed new-thread defaults to supply a model when the catalog is empty.
- Use the launch directory for local daemon configuration reads and the server directory for remote reads.

## Testing

Update startup-default tests to cover managed model selection with an empty catalog. Strengthen the reconnect test with a stale client model and an assertion that `config/read` uses the server directory.

GitOrigin-RevId: 8fe1485c6e66c8d46560b34d904ce1724458993a
2026-10-04 16:57:01 +00:00
Eric Traut afb436df8b Honor server reasoning summary defaults in new TUI threads (#50811)
## Why

New embedded TUI threads forced reasoning summaries off when no summary was explicitly configured, overriding the model's default. Client settings could also override the destination server's reasoning summary configuration.

## What changed

Use the same launch override handling for embedded and remote thread starts so server configuration and model defaults determine reasoning summaries. Forward explicit profile and command-line choices for `model_reasoning_summary` and `features.concurrent_reasoning_summaries`, preserving both enabled and disabled values.

## Testing

Extend coverage for model defaults reaching Responses requests, concurrent summary delivery, direct startup, and replacement sessions with profile and command-line overrides.

GitOrigin-RevId: c60e33d077298d7a89d6b95f94b1292c175d6c77
2026-10-04 07:12:06 +00:00
Eric Traut e57fc9ea5a Prune TUI snapshots and consolidate behavior tests (#50808)
## What changed

- Remove redundant snapshot fixtures and selected rendering test cases across the TUI.
- Replace several full-output snapshots with direct assertions on messages, popup state, status indicators, and rendered content.
- Consolidate slash-command aliases, command-prefix selection, category titles, and hook events into shared test loops.
- Use shared snapshots for the setup import prompt and paginated transcript overlay across platforms.

GitOrigin-RevId: 461e30ebaf70ba930d91a135d2fc598ee4f04f27
2026-10-04 06:46:50 +00:00
Eric Traut ab45264919 Preserve review lifecycle ordering on failure (#50804)
## Why

A review can fail before the UI receives the event that enters review mode. Failed-turn completion also needs to preserve the running indicator when a queued `/review` has already been submitted and is awaiting startup.

## What changed

- Emit the review-entry lifecycle before starting the review task, after aborting existing tasks and clearing connector selection.
- When a live failed-turn completion repeats an already handled error, refresh task state only if no user turn is pending startup, and continue processing queued input.

## Testing

Add regression tests for lifecycle ordering on a server-overload response and for preserving the running indicator while a queued review awaits startup after a failed turn.

GitOrigin-RevId: 0f91d3d1a1a983542c54c2686630de9c232321b1
2026-10-04 06:35:16 +00:00
Eric Traut 8f82b8a31c Use the managed daemon for eligible remote-control launches (#50803)
## What changed

Make plain `codex remote-control` start or reuse the managed daemon and enable remote control when daemon auto-start is enabled and the environment is eligible. Fall back to the foreground server when no managed backend is available or Windows restricts detached launch.

Add `codex remote-control --no-daemon` to explicitly run the foreground server, and honor the top-level `--no-daemon` flag. Reject this flag with `start`, `stop`, or `pair`. Keep `--json` and launches with configuration overrides or unsupported environments on the foreground path.

GitOrigin-RevId: cb28ae3f6074993b748660972c3cb7cbf6612c2f
2026-10-04 06:28:20 +00:00
Eric Traut b989f795b1 Fall back to mklink when Windows daemon junction updates are denied (#50802)
## Why

Some Windows policies deny in-process reparse-point mutation while allowing the system junction creator, preventing managed daemon release selection.

## What changed

Fall back to `cmd.exe` with `mklink /J` when native junction creation or retargeting returns `PermissionDenied`. Pass quoted paths through environment variables and disable delayed expansion to handle shell metacharacters.

Create the replacement junction before moving the existing `current` junction aside, and attempt to restore the previous junction if installation fails. Preserve it for recovery if restoration also fails.

## Testing

Extend the Windows junction test to cover fallback creation, native retargeting, and fallback replacement under a path containing spaces, `&`, `%`, and `!`, while verifying that no standalone CLI installation is created.

GitOrigin-RevId: 039ee850f8c788f44f08116614ca3927e3e9952f
2026-10-04 06:27:57 +00:00
Benjamin Carlsson b8dceb0d4f Open slash commands from empty drafts in Vim Normal mode (#50788)
## Why

Pressing `/` in Vim Normal mode starts a composer search, even when the draft is empty. Allow this key to open slash commands directly on an empty draft.

## What changed

When slash commands are enabled, a standalone `/` on an empty draft switches to Insert mode, inserts `/`, and opens command completion. Preserve Vim search behavior for nonempty drafts, `?`, and pending operators.

## Testing

Add a snapshot test for the Insert mode transition and command picker. Exercise Vim slash-command entry in the transcript overlay test across terminal sizes, and extend command sparkle coverage to Vim mode.

GitOrigin-RevId: 806c2f6b841190ccdc1a258f88dfa590773ba33a
2026-10-04 04:33:42 +00:00
Benjamin Carlsson acf9818fae Remember Command Center grouping across launches (#50786)
## Why

Command Center previously reset to project grouping on startup, losing the user's selected grouping.

## What changed

Save grouping changes to `tui.agents_overview_grouping` in the client’s user configuration and restore the saved choice at startup. Support `project`, `status`, and `model`, with `project` as the default. Report save failures in Command Center while keeping the selected grouping active.

## Testing

Add tests for cycling through and persisting all grouping modes, preserving unrelated settings in a custom configuration file, displaying save errors, and restoring saved grouping during startup.

GitOrigin-RevId: fd56dfecb4b79cfa8439f54420ce58cc0ed66ec7
2026-10-04 04:25:31 +00:00
Eric Traut d0759639f2 Retry Windows daemon release publication on transient file locks (#50782)
## Why

Executable scanners can briefly hold newly staged files without delete sharing, causing the rename that publishes a managed daemon release to fail on Windows.

## What changed

Retry publication on permission-denied or sharing-violation errors at 50 ms intervals, up to 100 retries. Report the staging and release paths if publication fails.

## Testing

Add a Windows test that holds the staging directory open without delete sharing, releases the handle after a delay, and verifies that publication succeeds with the payload intact.

GitOrigin-RevId: 4fbd50934ec8937d3b440d38203a2cb7356a316d
2026-10-04 04:01:04 +00:00
Eric Traut f365d5754b Restrict TUI MCP startup notifications to owned threads (#50781)
## Why

MCP startup notifications from unrelated threads could create TUI event channels, allowing subsequent approval requests from those threads to appear in the current session.

## What changed

Check the parent of an untracked subagent before accepting its MCP startup notifications. Read thread metadata with bounded retries for threads that are not yet found or loaded, and ignore notifications unless the parent belongs to the TUI.

Share thread ownership checks across notification and approval routing, including side threads.

## Testing

Extend approval-routing coverage to verify that owned subagent approvals are preserved both before thread-start notifications and after MCP startup notifications, while unrelated threads do not create event channels or display approval prompts.

GitOrigin-RevId: 6f78f237f7441aadf10b491ed191357df75c3a6a
2026-10-04 03:51:52 +00:00
Benjamin Carlsson dde5f8c5ae Allow /archive while a turn is running (#50764)
## Why

`/archive` was disabled during a running turn, preventing users from archiving the current session until the turn ended.

## What changed

Enable `/archive` during a running turn and warn in the confirmation dialog that archiving will stop the current turn. Cancelling the dialog leaves the turn running.

## Testing

Extend confirmation tests to cover both idle and running sessions, add a snapshot of the running-turn warning, and verify that cancellation leaves the task running without emitting archive events or operations.

GitOrigin-RevId: c7c530aa671b5f04e5dc2a637e3d27a81d98d8bf
2026-10-04 02:32:39 +00:00
Benjamin Carlsson cd7d9e128c Show unavailable slash commands when searched in side conversations (#50756)
## Why

Side conversations hide unavailable slash commands, leaving users without an explanation when searching for a known command.

## What changed

- Show matching unavailable commands as disabled rows with the reason `not available in a side conversation`. For example, `/arch` now shows a disabled `/archive` entry. Keep these commands hidden from the unfiltered `/` menu.
- Rank available matches first and skip disabled rows during keyboard selection and completion.
- Prevent `Tab` from queuing input when only disabled matches are visible, and insert `/` normally when no selectable command is present.

## Testing

Add a rendering snapshot and regression tests for unavailable command discovery, navigation, available command completion and queuing, blocked queuing of unavailable matches, and slash insertion.

GitOrigin-RevId: 7160b308ca57a24a5dcb6e2686b5248a8eb4b6a7
2026-10-04 01:36:25 +00:00
Won Park 550eb50545 Keep environment-backed tools exposed across readiness changes (#50741)
## Why

Environment readiness previously changed which tools and command parameters were advertised to the model, even when the selected environments stayed the same.

## What changed

- Keep enabled command, patch, image, and permission tools exposed when environments are absent, starting, or failed.
- Return a consistent message asking the model to wait when no usable execution environment is available, while preserving distinct errors for unknown environment IDs.
- Derive environment selectors from all selected environments rather than only ready ones.
- Always advertise `exec_command`'s `shell` and `login` parameters while continuing to enforce login policy at execution time.

## Testing

Expand integration coverage for empty, pending, failed, ready, and recovered environments, including stable command parameters and login-policy rejection. Update subagent and skill-catalog snapshots, with separate Windows expectations.

GitOrigin-RevId: bb08084066896a9f14b3b568c081c3eaac981db7
2026-10-03 23:22:59 +00:00
Eric Traut 3e238776e8 Show model and reasoning effort near the top of task details (#50727)
## What changed

- Display reasoning effort alongside the model in the agents overview, using `Unknown` when unavailable.
- Place model, reasoning, project, and usage information before attention details, activity, and the last message.
- Truncate long model and reasoning values with an ellipsis to keep each on one line.

## Testing

Update overview snapshots for the new layout and extend fixtures to cover a known model and long model and custom reasoning values.

GitOrigin-RevId: 1f36e5e1e0ccf09a851f8982bbbe4fbc7d9c7461
2026-10-03 22:13:55 +00:00
Benjamin Carlsson 447eac3b81 Decode Windows Terminal's mapped Shift+Enter sequence (#50720)
## Why

Windows Terminal's `sendInput` mapping delivers `ESC[13;2u` as individual console key events. Decode it as `Shift+Enter` so the mapping inserts a newline in the composer.

## What changed

- Wrap the Windows event stream with a decoder for the complete Escape-prefixed sequence, including interleaved key releases.
- Use a fixed 50 ms deadline for partial sequences and replay incomplete or mismatched input unchanged. Preserve literal text, paste events, and native key events.
- Update the `crossterm` revision and dependency lockfiles.

## Testing

Add tests for repeated and fragmented mappings, deadline handling, unchanged input, error and end-of-stream replay, and composer newline rendering with a snapshot.

GitOrigin-RevId: 95ab39960510d71322824c63817710633a2fda23
2026-10-03 21:20:56 +00:00
Eric Traut b172810921 Let the transport create the Windows remote-control socket directory (#50700)
## Why

Foreground remote control on Windows should let the transport create its socket parent with a protected DACL instead of inheriting the broader ACL from a temporary directory.

## What changed

Use `codex-remote-control/rc-<pid>.sock` under `std::env::temp_dir()` on Windows, leaving parent directory creation to the transport. Keep the existing temporary socket directory behavior on other platforms.

GitOrigin-RevId: 6482ed0fc4ebc6b0e5de4e1d0e13adc93afa56d1
2026-10-03 19:10:17 +00:00
Benjamin Carlsson 3a69ec3ef8 Preserve local Markdown link labels in the TUI (#50695)
## Why

Path-like link labels were collapsed into their destinations, discarding the author's label text and formatting.

## What changed

Preserve nonblank local link labels alongside the formatted destination as `label (target)`, including in tables. Empty or whitespace-only labels show only the destination. Keep destination formatting and fall back to the original destination when a local file URL cannot be parsed.

Render file citations without a label so they continue to display only the formatted destination.

## Testing

Update rendering and transcript-copy tests and snapshots to cover preserved path labels, styled labels, empty labels, malformed file URLs, tables, and Markdown escaping.

GitOrigin-RevId: 2810b70f1ecdc59d7f90fa1b254b1e9069c8fc29
2026-10-03 18:44:14 +00:00
Ahmed Ibrahim 58ae3ba611 Keep third-party tools deferred in strict Code Mode Only (#50687)
## Why

Third-party exposure settings can eagerly expose tool schemas or exclude tools from `exec`. Keeping eligible tools deferred lets MCP catalogs change between turns without changing the model's eager tool prefix.

## What changed

Add the disabled-by-default `code_mode_only_strict_3p_tools` feature, applied only when the effective model tool mode is Code Mode Only.

- Defer eligible MCP, app, and client-supplied dynamic tools while keeping them discoverable and callable through `exec`.
- Override `deferLoading`, MCP/app `omit_tools_from`, and direct-only or excluded namespace settings. Log conflicts without adding prompt warnings.
- Preserve disabled, app-only, policy-denied, and over-budget tool restrictions. Keep built-in tool exposure unchanged, including when a dynamic tool has the same name.

## Testing

Add unit and integration coverage for exposure overrides, effective model modes, tool eligibility, and app discovery and dispatch. Add an MCP refresh scenario that verifies the eager tool prefix stays unchanged as tools are added, replaced, and removed while `exec` tracks the current catalog.

GitOrigin-RevId: a6a8e401214119bb02ea4711473c8fa3ec85c81a
2026-10-03 18:15:13 +00:00
Eric Traut b741e480e2 Allow transcript selection and copying while bottom modals are open (#50564)
## Why

The plan confirmation prompt allowed transcript scrolling but blocked selecting and copying the visible plan text.

## What changed

Allow mouse selection and copying in the visible transcript while a bottom modal is open, preserving drags across redraws. Keep other keyboard input with the modal and suppress transcript link activation, disclosure toggles, and follow-control clicks during modal mouse handling.

## Testing

Extend the plan prompt test to cover selection, `Ctrl+Insert` copying, selection highlighting, and popup bounds. Add coverage confirming that ordinary and Control-clicks do not open links in selection-only mouse handling.

GitOrigin-RevId: 9e1fdfcb4bc18215e62a714f173bc8cb372b090a
2026-10-03 07:45:47 +00:00
Ahmed Ibrahim 58ca099b03 Keep Code Mode tool discovery guidance stable across catalog changes (#50562)
## Why

Tool availability can change between calls. Conditioning discovery guidance on whether deferred tools are currently present changes the `exec` description when the catalog changes.

## What changed

Always include the configured discovery guidance in the Code Mode `exec` description, even when no deferred tools are present. The default guidance explains how to find tools in `ALL_TOOLS` and notes that availability can change between calls. Custom guidance and explicit empty overrides remain supported.

## Testing

Add regression coverage for stable guidance with empty and populated deferred tool catalogs in both Code Mode configurations, including custom and empty overrides. Update tool-description assertions and request snapshots.

GitOrigin-RevId: 086ea19a48e3c51ec8c429a619676a936d658721
2026-10-03 07:37:00 +00:00
Eric Traut 1a169eda11 Distinguish daemon release identity from executable contents (#50559)
## Why

Releases can contain different resources while shipping identical executable bytes. The daemon must recognize those release changes, while a stale updater should be able to hand off without restarting an already-current daemon.

## What changed

- Include a digest of the resolved executable path in `ExecutableIdentity` to distinguish release generations with identical binaries.
- Keep content-only comparisons for package preparation and manual update reporting.
- Check the running daemon's identity and version before restarting during updater adoption, manual updates, and production restoration. Preserve scheduled retries when the daemon is not ready.

## Testing

Add coverage for path-sensitive identity, scheduled no-op updates that preserve the daemon, and resource-only release updates that restart it despite identical executable bytes.

GitOrigin-RevId: bbea06cf502abb2251e70d4ba4b422cae867116c
2026-10-03 07:17:20 +00:00
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