Commit Graph
11872 Commits
Author SHA1 Message Date
daniel-oai 28b91c7c31 Honor the OTLP metrics temporality preference (#51220)
## Why

Some metrics backends require cumulative metrics, while configured OTLP exporters previously always used delta temporality.

## What changed

Read `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` for configured HTTP and gRPC metrics exporters. Accept `delta`, `cumulative`, and `lowmemory` case-insensitively, retaining delta for unset, empty, or unrecognized values. Document the setting and preserve existing temporality for the built-in Statsig exporter and runtime snapshots.

## Testing

Update the HTTP loopback test to set the preference in an isolated subprocess and assert that the exported counter uses cumulative aggregation temporality.

GitOrigin-RevId: ca212eea20054b947005d323186c8b9a819ace9d
2026-10-06 01:36:17 +00:00
yunhan-wei 4171362e44 Preserve review targets and scope misalignment continuation metadata (#51217)
## What changed

- Carry opaque `review_target` values through misalignment errors and expose optional `reviewTarget` in the app-server protocol and generated clients. Preserve the value verbatim and redact it from debug output.
- Keep target-based `misalignment_override` metadata on turn requests, preserve it across steering updates, and exclude it from compaction and external MCP metadata. Reject overrides from global Responses metadata while retaining legacy timestamp behavior for per-turn overrides.

## Testing

Extend coverage for error propagation, debug and rollout redaction, steering preservation, and metadata filtering. Verify that automatic compaction omits the review target while turn requests before and after compaction retain it.

GitOrigin-RevId: 8c1abb076a206ff5927a4acc31bd25e3efc2bff9
2026-10-06 01:26:11 +00:00
Owen Lin a811c72969 Measure raw MCP tool catalog sizes in telemetry (#51215)
## What changed

Record the total serialized JSON size of raw MCP tool definitions in the `codex.mcp.binding_catalog.raw_definition_json_bytes` histogram, before filtering or model preparation.

Emit an `mcp.binding_catalog` trace event for each server with its tool count, definition size, server kind, plugin ID, and cached or live catalog source. Reuse bounded product SKU attribution for both metrics and events, and skip size measurement when neither telemetry output is enabled.

GitOrigin-RevId: abda7cbf46d5470eb321455f047dd7429084740e
2026-10-06 01:17:03 +00:00
viyatb-oai 7aa8f51049 Reject sandbox-writable bubblewrap executables from PATH (#51211)
## Why

Bubblewrap discovery probes executables before confinement. Excluding only the command's current directory leaves candidates in other writable roots eligible to run outside the sandbox.

## What changed

- Filter canonical `PATH` candidates using the filesystem policy and effective user permissions, including writable ancestors, symlinked roots, and full-disk write access. Preserve protected system installations while rejecting replaceable paths.
- Select the launcher with the command's permissions before the proc-mount preflight, retaining the bundled bubblewrap fallback.
- Use the effective permission profile and policy working directory for startup warning probes.

## Testing

Add unit coverage for writable roots, symlinks, read-only carveouts, replaceable parents, and full-disk policies. Add Linux integration tests showing writable `bwrap` candidates are neither probed nor launched, including when the command runs in a workspace subdirectory or uses managed networking with full-disk write access.

GitOrigin-RevId: 188c9f45e727eaace062f5abb1205dc23fdf3c51
2026-10-06 00:58:19 +00:00
Alex Zamoshchin 4d15794336 Add ranked tool discovery to JavaScript code mode (#51209)
## What changed

- Add the default-disabled `code_mode_tool_search` feature to expose `await tools.tool_search({query: "...", limit: 8})` in code mode when the model supports tool search.
- Return BM25-ranked deferred tools as `{tools: [{name, description}]}`, including callable names and TypeScript declarations for use in later code cells.
- Filter results through the current step's nested-tool policy before applying the limit, preserving namespace restrictions, normalized identities, description prefixes, and schema budgets.
- Add ranked-search guidance while retaining `ALL_TOOLS` catalog discovery and description overrides.

## Testing

Add coverage for feature and model-capability gating, namespace restrictions, argument validation, schema budgets, and discovery followed by deferred MCP and dynamic tool calls. Extend the scenario snapshot to cover search, invocation, yielding, and completion through `wait`.

GitOrigin-RevId: 092a29dd5f0773c518f53a001b9cafb917422f13
2026-10-06 00:36:25 +00:00
Brian Lee 5ad6891696 Gate CLI Daybreak controls and selection behind an opt-in feature (#51207)
## What changed

Add `features.cli_daybreak`, disabled by default, to gate Daybreak controls and automatic access-program selection in the TUI and `codex exec`. Apply the gate to resumed sessions and background task turns, and hide `/daybreak` when disabled. Explicit `--cyber-access-program` overrides remain available.

## Testing

Extend tests to cover disabled controls, history replay, foreground and background turn requests, exec resume/fork behavior, and explicit access-program overrides with the feature disabled.

GitOrigin-RevId: ae96a4a8c7ab97c619716b9f39ea9f295df6e5a6
2026-10-06 00:16:44 +00:00
peilin-openai c19525e55e Record initialization analytics for resumed subagents (#51206)
## Why

Reloaded subagent threads did not emit initialization analytics, and subagent initialization events always reported `new`.

## What changed

Emit initialization events for resumed spawned subagents before notifying thread listeners. Inherit parent client metadata before reserving a residency slot can evict the parent, preserve the thread's original `created_at`, and report `initialization_mode` as `resumed`. Refresh stored analytics metadata when a subagent resumes; newly created subagents continue to report `new`.

## Testing

Extend the cold-resume integration test to verify a single worker initialization event with the expected session, parent, source, resume mode, and original creation timestamp. Update serialization and session tests to check initialization modes.

GitOrigin-RevId: e78b0c4d88b6ddbe993ca7e1fe7717b6f74bf3d9
2026-10-06 00:16:18 +00:00
Charlie Marsh 685270a56a Make apply_patch preserve line endings unconditionally (#51203)
## Why

Updating a CRLF file with `apply_patch` previously normalized its line endings to LF unless preservation was explicitly enabled. Preserve the file's existing line endings without requiring an opt-in.

## What changed

- Use line-ending-preserving updates for both tool calls and standalone `apply_patch` invocations, removing the legacy normalization mode.
- Mark `apply_patch_preserve_line_endings` as removed.
- Always set `CODEX_APPLY_PATCH_PRESERVE_LINE_ENDINGS=1` in child environments for compatibility with older patch executables, overriding stale values.

## Testing

Update CLI, tool-call, shell-heredoc, and app-server tests to check CRLF preservation by default. Keep coverage for overriding stale compatibility environment values.

GitOrigin-RevId: 96d0b0e5350faa3fc7a45d63627a132657b44523
2026-10-05 23:52:06 +00:00
Alex Kira 93f8e79fd2 Distinguish namespace removals in incremental tool updates (#51202)
## Why

Removing a whole namespace previously listed both the namespace and every member as unavailable tools.

## What changed

Emit separate namespace and individual-tool sections in one removal notice for Responses Lite. A removed namespace subsumes its members, with instructions allowing tools declared in a later update to become available again. Keep individual removal notices for tools in surviving namespaces and for built-ins.

## Testing

Expand unit tests and snapshots to cover mixed removals, empty catalogs, restoration, and replacing a namespace with a built-in of the same name. Extend the MCP refresh scenario to verify namespace removal and restoration, successful calls after restoration, preserved request history, and no repeated updates on unchanged turns.

GitOrigin-RevId: 66aa43a41db956cb5458121ea1db8c673a7ce948
2026-10-05 23:49:21 +00:00
Adam Perry @ OpenAI ade17c62b0 Upgrade Bazel to 9.2.0 and refresh the module lockfile (#51200)
## What changed

Update `.bazelversion` from 9.0.0 to 9.2.0 and refresh
`MODULE.bazel.lock`, including lockfile format version 28, registry hashes,
module extension digests, and cached crate metadata.

GitOrigin-RevId: 52689e818bf0eb37d9339df8d8a09c6cbe43e4d8
2026-10-05 23:13:50 +00:00
andrewgu-oai 54dd21741d Allow concurrent release builds while serializing publication (#51198)
## Why

Release builds for different tags can run concurrently, but publication must remain serialized so channel checks and updates cannot race or move release pointers backward.

## What changed

Scope workflow concurrency to `${{ github.workflow }}-${{ github.ref }}`. Keep `release`, `publish-r2`, `publish-npm`, `winget`, and `update-branch` on a shared `rust-release` concurrency group with `queue: max` and `cancel-in-progress: false`.

GitOrigin-RevId: 75b42fd765db6091fb9190aae2ecccd2bb959d08
2026-10-05 23:09:09 +00:00
John Nastos a6c5f3a9fa Add browser extension request headers to config requirements (#51194)
## What changed

Support `browser_use.extension.request_headers` as a list of `name`/`value` pairs and expose it through `config/requirements/read` as `browserUse.extension.requestHeaders`. Update the generated JSON schemas, TypeScript types, and Python models.

Preserve header values, including template strings, verbatim. Higher-priority requirement layers replace the entire header list, including with an explicit empty list. Redact header values in Rust debug output while retaining them in API serialization.

## Testing

Add coverage for parsing and malformed entries, extension scoping, empty-list overrides, API mapping and read responses, and debug redaction without changing serialized values.

GitOrigin-RevId: 02299e82a91aa863966d0277091bc5e8cc1ebe07
2026-10-05 22:52:14 +00:00
Brent Traut b4e3726d73 Test thread archiving before the first turn (#51193)
Extend the app-server thread metadata test to archive a thread after pinning
and unpinning it, before any turn starts. Assert that the thread appears in
`thread/list` results with `archived: true` and `use_state_db_only: true`.

GitOrigin-RevId: dde58e892b28843870bc3f678134fc86b93cd79c
2026-10-05 22:42:17 +00:00
Eric Traut 0d3868a30c Wait for SIGCONT when resuming the TUI (#51192)
## What changed

Install a temporary `SIGCONT` handler and unblock the signal during `Ctrl+Z` suspension. After sending `SIGTSTP`, wait for the handler to confirm resumption, returning a timeout error if no confirmation arrives within the bounded wait.

Restore the previous signal handler and thread signal mask, resume terminal stderr handling, and reapply terminal modes even when suspension fails. Propagate signal setup, delivery, and restoration errors to the caller.

GitOrigin-RevId: 1a7e10e982b1f6b2c7c7d75362a01989409b3b4d
2026-10-05 22:41:53 +00:00
Eric Traut 36df9544a3 Clean up Unix app-server control-socket startup lock files (#51191)
## Why

Unix control-socket shutdown removes the socket and rendezvous link but leaves the startup lock file behind.

## What changed

Keep a removable startup lock with the control-socket guard and release the lock after publishing the rendezvous link. On cleanup, reacquire the lock and verify that the path still identifies the same file before removing it.

Use nonblocking acquisition with asynchronous retries, checking file identity after acquisition to handle lock-file replacement.

## Testing

Add tests for nonblocking lock contention and dangling symlink rejection, and extend the control-socket lifecycle test to verify that the lock file is removed on shutdown.

GitOrigin-RevId: 469ed5269f32ae1c0655d40d28519ef5e94ba6be
2026-10-05 22:38:32 +00:00
pakrym-oai 062439b2f8 Record base instructions in incremental tool history (#51188)
## What changed

- Record nonempty base instructions as a developer message after tool declarations at the start of each incremental tool context window, and omit the request-level `instructions` field.
- Preserve this prefix when rebuilding history after local or remote compaction, while keeping the compaction summary last.
- Count recorded base instructions once when estimating context usage and trimming tool outputs.

## Testing

Add regression coverage for instruction placement, omission of request-level instructions, compaction ordering, and token accounting. Exercise remote compaction trimming with both request-level and recorded base instructions.

GitOrigin-RevId: 6a6fda92c5c6eb33852a77b38d34c028cf78b164
2026-10-05 22:20:38 +00:00
andrewgu-oai 5cbcf810e5 Prevent stable release pointers from moving backward (#51186)
## Why

Publishing an older stable version should not replace a newer release as the default download or installation target.

## What changed

- Compare stable versions before marking a GitHub release as latest, allowing same-version reruns to finish publication.
- Guard npm `latest` and platform dist-tags, publishing older versions under separate `release-<version>-<tag>` tags.
- Check R2's `latest` channel before updating it or the installer aliases, while allowing same-version reruns to repair interrupted installer updates.
- Reject invalid existing stable release metadata and consolidate GitHub latest and canary checks in `releases.py`.

## Testing

Add regression tests for stable version ordering, same-version reruns, npm package and platform tags, and invalid channel metadata. All 21 tests in `.github/scripts/test_releases.py` pass.

GitOrigin-RevId: e6bad3ee163b279ac1661b9070712a41eedd50ff
2026-10-05 22:19:18 +00:00
cassirer-openai aa6635ece5 Retry transient gRPC code-mode session admission failures (#51185)
## Why

Transient admission errors or connection resets can prevent a code-mode session from opening before any execution starts.

## What changed

- Retry `OpenSession` and the initial lease message on `Unavailable` or `ResourceExhausted`, with at most three attempts and 100 ms and 200 ms delays within a single startup deadline.
- Classify HTTP connection and request failures as `Unavailable` so admission can recover from connection resets, while preserving error sources.
- Keep retries limited to initial admission so established executions are never replayed.

## Testing

Add gRPC integration tests covering transient status recovery, the retry limit, immediate failure for non-retryable statuses, and successful session execution after a connection reset.

GitOrigin-RevId: 3b654bcd377a5addf7c3ed58bb1c72a449b2f7f7
2026-10-05 22:18:55 +00:00
felixxia-oai 7f21b5ee9c Remove obsolete Guardian thread-context enables from tests (#51184)
## Why

Thread-owned Guardian context is always enabled, and `guardianv2.thread_context` is deprecated and ignored.

## What changed

Remove explicit `GuardianThreadContext` enables from retained-context and heartbeat tests. Parameterize the heartbeat skill-context test with optional feature lists so it covers the default behavior and `GuardianRootHandoffContext`, each with one or three heartbeats.

GitOrigin-RevId: 78e3159832bff08b79c7977d876d9acb587e9c71
2026-10-05 22:17:02 +00:00
chess 7c2ce90716 Sign the PowerShell installer in Windows releases (#51158)
## What changed

Extend the Windows signing action with an `additional-files` input and sign `scripts/install/install.ps1` with Azure Trusted Signing in the x64 release job. Stage the architecture-independent installer after compression so it remains a plain script, and publish the signed artifact as `install.ps1` instead of copying the unsigned source.

## Testing

The Windows release workflow verifies that the installer has a valid Authenticode signature and a timestamp certificate before staging it, failing the job if either check fails.

GitOrigin-RevId: 6f16a084b8f350fbf3644c36d75651a6f4b88506
2026-10-05 18:54:42 +00:00
Adam Perry @ OpenAI 42312d4ff4 Enforce required environment skills before model inference (#51157)
## What changed

- Accept per-environment `skills.required` lists through `environment/add` and `environments.toml`.
- Before inference, require each named skill to be enabled and supplied by the selected environment. Missing skills fail the turn before a model request, including when environment setup fails.
- Stop applying an environment's requirements after it is deselected. Exempt isolated Guardian reviewers, which have no skill catalog.

## Testing

Add tests for available, missing, disabled, and wrong-environment skills, failed environment setup, recovery after deselection, and propagation of TOML requirements to the correct environment.

GitOrigin-RevId: 302ced4774697d2f414f745fe0535e71f747eda2
2026-10-05 18:54:17 +00:00
pakrym-oai c9253c4977 Send base instructions as Responses input messages (#51156)
## What changed

Move base instructions from the top-level `instructions` field into a prefixed `developer` message in `input` for standard Responses requests, matching Responses Lite. Remove the field from HTTP and WebSocket request types and assign instruction messages stable IDs derived from the thread and instruction text.

## Testing

Extend standard and Responses Lite tests to cover instruction message serialization, stable IDs, and resume consistency. Update WebSocket tests to verify that changed instructions trigger a full request without `previous_response_id`.

GitOrigin-RevId: e2de4b8e30a9339377fac133ceda981abd1a112b
2026-10-05 18:52:51 +00:00
felixxia-oai 3f1ccb7ceb Isolate Guardian checkpoint recovery flags per review attempt (#51140)
## What changed

Give the initial Guardian review and its checkpoint recovery attempt separate recovery flags instead of resetting a shared flag. Keep the single restart under the original review deadline.

Represent reviewer selection explicitly with `ReuseIfAvailable` and `FreshParentCheckpoint`, so recovery requires a fresh session and ignores reusable fork snapshots.

GitOrigin-RevId: 35f63f375e2a8bef10271944e222ffce1d1939c4
2026-10-05 17:36:58 +00:00
felixxia-oai 16cb72218c Force fresh Guardian sessions for parent-checkpoint recovery (#51139)
## Why

A Guardian review restarting from the parent checkpoint must bypass cached reviewer sessions and snapshots, even when another review is using the cached session.

## What changed

- Add `ReviewerRequest::requires_fresh_session` and enable it for parent-checkpoint recovery.
- Replace an idle cached session with a fresh reusable session, or start a fresh ephemeral session when the cached session is busy. Neither recovery path inherits a cached snapshot.
- Reserve the review permit before validating a cached session and before exposing a newly spawned session to concurrent requests.

## Testing

Add tests covering recovery with idle and busy cached sessions, verifying that recovery receives no cached snapshot and that subsequent reviews reuse the appropriate session.

GitOrigin-RevId: 894f685736da54312336932aa2037e74a20629d9
2026-10-05 17:36:33 +00:00
felixxia-oai 5f8b37cc65 Recover Guardian reviews from parent checkpoints (#51137)
## Why

Reviewer compaction can invalidate previously admitted transcript evidence. When a parent checkpoint is available, restarting from that checkpoint preserves the captured parent context instead of relying on a lossy reviewer summary.

## What changed

- Restart an invalidated reviewer once from the action-time parent checkpoint, within the original review deadline.
- Preserve fresh checkpoints during startup and fit review input using the existing budget selection.
- Select transcript evidence from the checkpoint actually loaded by the reviewer. Track the transcript source so cursors remain valid across legacy-history eviction and reset when the source changes.
- Resume transcript deltas after successful recovery, including authorization added after the parent checkpoint.

## Testing

Add regression coverage for checkpoint recovery, post-checkpoint authorization, resumed deltas, and stopping after one restart. Extend history tests to cover both legacy retention and parent-checkpoint reuse, and update the checkpoint-migration snapshot.

GitOrigin-RevId: bc20fb9489afaad963303beff1c79f62fa5023f7
2026-10-05 17:35:24 +00:00
swastik-oai 4c9f42f4f8 Allow Guardian Decisions to fall back to OPENAI_API_KEY (#51133)
## What changed

Use `OPENAI_API_KEY` for the Guardian Decisions sampler when `CODEX_GUARDIAN_DECISIONS_API_KEY` is absent, the provider is `openai`, and no custom base URL is configured. Preserve dedicated-key precedence, including empty values, and do not fall back for other providers or custom base URLs.

## Testing

Add a credential-selection test covering fallback, dedicated-key precedence, empty dedicated keys, and provider and base URL restrictions.

GitOrigin-RevId: a2a62c28789597f013544b51e142b21f9e214080
2026-10-05 17:24:06 +00:00
Channing Conger 28a264fbc7 Add promise settlement streaming helpers to code mode (#51126)
## What changed

Expose two JavaScript globals for consuming results as inputs settle:

- `as_settled(promises)` returns an async iterator of fulfilled and rejected records in settlement order, preserving queued results while the consumer is busy.
- `stream_settled(promises, emit)` delivers those records to a callback, awaiting each invocation and propagating callback errors.

Records include an `index`, a `status`, and either a `value` or a `reason`. Iterable inputs use positional indices; `Map` inputs retain their keys. Both helpers accept promises, thenables, and plain values.

## Testing

Add runtime coverage for ordering, input types, object identity, callback behavior, early iteration exit, and termination. Add stdio and gRPC host tests for partial results across waits, plus a scenario snapshot verifying fulfilled and rejected records reach the model.

GitOrigin-RevId: cddc9f3679ae04f2421e154caa0417afb15f550d
2026-10-05 16:58:29 +00:00
Alex Kira 402f5b6fdf Clarify incremental tool namespace updates in Responses Lite (#51119)
## Why

Incremental namespace declarations contain only changed or added tools. Their descriptions need to make clear that previously declared tools remain available unless explicitly marked unavailable, and that redefinitions replace earlier definitions.

## What changed

Append this guidance to updates of existing namespaces, preserving any namespace description. Leave initial declarations and catalog hashes unchanged.

## Testing

Extend unit and request-history coverage for the namespace hint, unchanged turns that append no tool definitions, and MCP tool removals that append a standalone notice without rewriting history or repeating the notice on the next turn.

GitOrigin-RevId: e32f3c9948efb44a1253868fe67967f117cc21e8
2026-10-05 16:18:54 +00:00
pakrym-oai 8571b9eaa4 Install full context in compaction replacement history (#51117)
## Why

Manual, pre-turn, and post-turn compaction previously deferred rebuilding initial context until the next turn. Their saved replacement history could omit refreshed instructions and skill catalogs.

## What changed

- Install initial context during local and remote compaction, before the last real user message or summary, keeping the compaction summary last.
- Persist matching full world-state and turn-context baselines with every replacement instead of retaining only partial extension metadata.
- Build replacement context and recompute token usage for the current model even when the previous model performs compaction. Reuse that captured context for eligible current-model retries.
- Capture manual compaction context centrally and propagate preparation errors to the task runner.

## Testing

Update assertions and snapshots for context ordering, refreshed instructions, resume and fork history, current-model checkpoint baselines, and cloud skill catalog retention across compaction and resume.

GitOrigin-RevId: 8572a76c31c6884a3c580b3bbb350d49af876bd1
2026-10-05 16:10:27 +00:00
swastik-oai 823ea830c0 Preserve trusted-tool context in Guardian Decisions requests (#51070)
## Why

The Decisions adapter rejected developer messages, including host-annotated trusted-tool context. Requests containing that context could not be classified.

## What changed

Append developer text annotated with `TrustedTool::KIND` to the classification rubric, preserving its authority while keeping user evidence in the input messages. Accept only a single text part with a single matching annotation; continue rejecting other developer messages and unsupported evidence.

## Testing

Add a regression test covering trusted-tool context alongside untrusted user text, plus rejection of incorrect roles, missing or mismatched annotations, multiple annotations or content parts, and image content.

GitOrigin-RevId: 65b6301b2ee1ac54d67275978ccb5e37dcac7c16
2026-10-05 10:16:03 +00:00
jif 39e013c8b7 Use issuing-step context for Guardian MCP elicitation reviews (#51067)
## Why

MCP elicitation reviews used turn-start context, which could omit remote environments that became ready before the tool invocation and use stale environment permissions.

## What changed

Capture the issuing step's Guardian review context with each live MCP invocation and reuse it for elicitation reviews. Fall back to turn context when no matching live invocation is available, and preserve the captured context for in-flight actions.

## Testing

Extend the deferred-executor regression test to cover MCP elicitations, checking that Guardian receives the newly ready remote environment and its denied paths, excludes stale local denied paths, and returns the denial to the parent model.

GitOrigin-RevId: 0cc58b8f30543a9af87d53e1a90f574a8e6a2f84
2026-10-05 10:08:59 +00:00
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