Commit Graph
12034 Commits
Author SHA1 Message Date
Adam Perry @ OpenAI 845345b1dd Preserve subagent capabilities independently of forked history (#52241)
## Why

Subagents should retain the spawning turn's selected skills and plugin choices whether `fork_turns` is `none` or `all`. Capability selection should not depend on copied conversation metadata.

## What changed

- Use a shared child startup path for fresh and history-forked agents, inheriting selected capability roots from the spawning environment snapshot.
- Pass the spawning turn's `disabled_plugin_ids` through both spawn handlers. When omitted, inherit the parent's current choices; explicit lists, including an empty list, override them.
- Resolve the parent before startup so inherited client MCP settings apply even when only the session source identifies the parent.
- Carry plugin choices into delegates with inherited isolation and preserve saved capability roots when resuming a child.

## Testing

Add regression coverage for executor skill listing and reading, plugin MCP registration with both history modes, plugin overrides, capability-root precedence and isolation, and restoring saved child settings after parent settings change.

GitOrigin-RevId: 2a6891a9bc6372fd2d1f30add2b5611f96b60594
2026-10-08 19:21:57 +00:00
surajs-oai 137f25f643 Recover gRPC code-mode sessions after missing-session errors (#52235)
## Why

A host can reject a request for an unknown session while its lease streams remain open. Keeping that session binding prevents subsequent execution from recovering.

## What changed

Invalidate the session when `Execute` (including its response stream), `Wait`, or `Terminate` returns `NOT_FOUND`, allowing the next execution to open a fresh session. Return the failed call's error without replaying execution.

Document that these RPCs reserve `NOT_FOUND` for unknown sessions, while `CompleteToolCall` can use it for a missing invocation.

## Testing

Add regression coverage for recovery with lease streams still open, no replay of failed execution, and preservation of session state after `INVALID_ARGUMENT`. Add a cancellation-race test confirming that a late tool-completion `NOT_FOUND` leaves the session open.

GitOrigin-RevId: 85b38fdbd6d59268447b6aa6a85ea7c60ec869a7
2026-10-08 19:15:17 +00:00
mattj-openai 54685110a7 Support request IDs in exec-server WebSocket handshakes (#52234)
## What changed

- Add optional `websocketRequestId` to `environment/add` and send it as `X-Request-ID` on direct WebSocket upgrades, including reconnects. It requires a secure transport or a loopback destination.
- Echo a supplied `X-Request-ID` in the exec-server WebSocket upgrade response.

## Testing

Add coverage for `websocketRequestId` serialization and for handshake header forwarding and echoing, both with and without a request ID.

GitOrigin-RevId: 235303ff7e1150405b7e1158d6024223144e0cc3
2026-10-08 19:13:52 +00:00
Brian Lee 5505a80f38 Honor API-key feature gates in TUI Daybreak selection (#52228)
## Why

API-key accounts could retain a saved Daybreak preference without `ApiKeyCyberAccessPrograms` enabled. Eligible API-key turns also omitted the `standard` access program when Daybreak was off.

## What changed

- Require both `CliDaybreak` and `ApiKeyCyberAccessPrograms` for known API-key accounts, and refresh Daybreak state when either flag changes.
- Use account eligibility consistently for normal turns, continuations, and background tasks so eligible API-key accounts can select the catalog's `standard` program when Daybreak is off.
- Preserve resumed preferences while account state is unknown and update `/daybreak` help to reflect API-key eligibility.

## Testing

Extend regression coverage for feature-flag combinations, API-key continuations, resumed preferences, and `/daybreak` help.

GitOrigin-RevId: 966f4789c9d685ff122da196a13da50c60a4b393
2026-10-08 19:02:53 +00:00
Felipe Coury 96d238d0b9 Include foreground activity in iTerm2 session status (#52226)
## Why

The iTerm2 session status reports `Working` without describing the current activity.

## What changed

Populate the OSC 21337 `detail` field from the TUI status header during foreground work, for example `Reading source`. Leave it empty for idle, waiting, background-only work, and the generic `Working` header.

Reuse terminal-title text filtering and the 240-character limit, then escape semicolons and backslashes for the status payload. Include detail in the emission cache so activity changes update the terminal even when the lifecycle state stays the same.

## Testing

Add coverage for foreground-only details, payload encoding, text filtering and truncation, and cache updates when the detail changes.

GitOrigin-RevId: b27a287b80e0db52be6cd9d5d246f03897e2996b
2026-10-08 18:56:04 +00:00
virajrai-oai bfe0fb9bb9 Fix config rebuild call in the Windows MXC preference test (#52225)
Remove the obsolete `default_zsh_path` argument from the call to
`Config::rebuild_with_session_layers` in
`local_mxc_preference_preserves_configured_backend` to match its current
signature.

GitOrigin-RevId: ddb7a73535cc605917971b974333d69bf3a92a93
2026-10-08 18:55:41 +00:00
jackz d570b3632b Enforce application network policy for daemon updates (#52223)
## Why

Daemon updates must honor application network restrictions and stop when their configuration cannot be loaded.

## What changed

Activate the configured application network policy before creating the HTTP client for daemon updates and the PID update loop. Propagate configuration errors instead of falling back to a default HTTP client.

## Testing

Add tests for configuration error propagation and managed network requirements, covering denied and unlisted destinations as well as an allowed destination. Retain coverage for `features.respect_system_proxy`.

GitOrigin-RevId: 960485c7c57f34654402d7316cab9e0f66f24af3
2026-10-08 18:53:17 +00:00
stevenlee-oai 89d68bc8d2 Add configurable default plugin activation policy (#52220)
## What changed

Support `plugins._default.enabled` with explicit per-plugin `enabled` overrides. Omission preserves existing source and account enablement; configuration cannot activate a plugin disabled at its source. Plugin settings such as remembered tool approvals inherit the default unless `enabled` is explicitly set.

Apply the policy to plugin skills, MCP servers, Apps, and hooks, including selected executor roots and runtime configuration refreshes. Preserve the latest plugin policy when adding MCP dependencies and rebuild hooks when concurrent configuration updates replace their inputs.

Report effective enablement in `plugin/list`, `plugin/installed`, `plugin/read`, and `plugin/share/list`. Remote installation still installs disabled packages, but skips MCP and Apps authentication setup without writing an enablement override.

## Testing

Add regression coverage for default inheritance and explicit overrides, source-disabled plugins, policy refreshes during active turns, disabled or malformed selected plugin roots, and remote installation authentication behavior.

GitOrigin-RevId: 83b70c5b47fc95474fec292f248683f1f887221e
2026-10-08 18:42:58 +00:00
lsingh-oai 79773e8826 Enforce application network policy in standalone MCP commands (#52215)
## Why

Standalone MCP commands must honor `application.network` restrictions during OAuth discovery and login, even when the MCP server is allowed by its identity requirements.

## What changed

- Apply local network policy to cloud configuration bootstrap authentication and activate the effective policy on the loaded CLI configuration.
- Load `codex mcp add` through the shared cloud configuration loader and use its resolved `codex_home` when saving server configuration.
- Block disallowed OAuth discovery requests before connecting while preserving the ability to save a server when discovery is unavailable.

## Testing

Add isolated regression tests for blocked MCP discovery and login, discovery with network policy disabled, allowed and denied HTTPS destinations, and rejection of malformed managed network policy. Connection checks verify that denied requests never reach a TCP listener.

GitOrigin-RevId: f91401b51d6e6b9472bb01838f0d0903f83d62f3
2026-10-08 18:22:39 +00:00
jif a645742bb5 Stop bundling patched zsh in Codex packages (#52213)
## What changed

Remove the patched `zsh` resource from package assembly and macOS signing, along with the `--zsh-bin` and `--zsh-manifest` packaging options.

Delete the standalone `codex-zsh` release workflow, build scripts, and DotSlash manifests. Update package documentation and layout and signing tests to match the remaining resources.

GitOrigin-RevId: 429a8db55048fed7facec89957910206523b6013
2026-10-08 18:17:04 +00:00
Felipe Coury ade12342e2 Expose Codex lifecycle status in iTerm2 sessions (#52203)
## What changed

Emit `Idle`, `Working`, or `Waiting` with colored indicators through iTerm2's `OSC 21337` session status protocol. Pending user action takes precedence over running tasks and background processes.

Limit emission to direct iTerm2 TTY sessions without a terminal multiplexer. Deduplicate successful writes, refresh status after terminal handoffs and resume, and clear status on suspension and exit.

## Testing

Add coverage for lifecycle transitions, protocol encoding, terminal detection, write retries, deduplication, and re-emission after terminal handoffs.

GitOrigin-RevId: 750e9ec92aeefc57651886a08ef6aea07675d175
2026-10-08 18:07:35 +00:00
Felipe Coury c079352d83 Allow plugin toggles while searching and preserve filters on refresh (#52200)
## Why

In `/plugins`, Space edits a nonempty search query, leaving filtered plugins without the advertised toggle shortcut. Refreshing the popup also clears the query.

## What changed

- Add `Tab` to enable or disable the selected plugin while searching, and update toggle hints.
- Preserve the search query and selected plugin when the popup refreshes after a toggle.
- Give configured list bindings precedence over the `Tab` toggle and hide its hints when `Tab` is already bound.

## Testing

Add regression tests and snapshots for filtered toggles, search and selection preservation, and custom `Tab` binding precedence and hints.

GitOrigin-RevId: de98ba2bb3f9d8928ced7216dcc5e4b4fa4c4968
2026-10-08 18:06:19 +00:00
tongzhou wang ad54b75574 Track source attribution for individual context parts (#52195)
## What changed

- Add `ContentItemMetadata` to distinguish user input, developer instructions, `AGENTS.md`, skills, harness context, and tool-supplied context independently of message role and content classification.
- Keep attribution attached to content through prompt assembly, history processing, and hook-output spilling. Distinguish command hooks from MCP hooks and retain tool namespaces when known.
- Treat missing historical attribution as unknown and send per-content metadata only to Responses Lite.

## Testing

Update request and history assertions to cover attribution persistence and Responses Lite metadata handling.

GitOrigin-RevId: 24e56005f5bdb98bf82f2b3943f29c4c81f3d587
2026-10-08 17:56:54 +00:00
iceweasel-oai f90a578f76 Enforce managed MXC requirements on Windows (#52193)
## What changed

Add `windows.require_mxc` to managed requirements. When set to `true` on Windows, reject configurations whose effective local sandbox backend is not MXC without changing the selected backend.

Validate after cloud configuration loads and outside startup recovery fallbacks. Apply the check to app-server startup and configuration loads, in-process bootstrap, session creation, sandbox debugging, and runtime configuration refreshes.

## Testing

Extend configuration tests to cover required and optional MXC selection, separately loaded policy requirements, and runtime refresh validation. Expand app-server startup tests to cover local and cloud MXC requirements, cloud preference selection, and failures without default-config recovery.

GitOrigin-RevId: 16456611bfd9df77e7f959b52515f1885b59ac75
2026-10-08 17:48:32 +00:00
Eric Traut 5fe2152b60 Preserve side conversations across thread navigation (#52184)
## Why

Navigating to another thread discarded side conversations, preventing users from returning to them later.

## What changed

- Keep side conversations and their event listeners, channels, and pending requests across thread switches and session resets.
- Reopen a parent's existing side conversation with `/side` and submit any supplied question there. Resolve side toggles by the current thread's parent relationship.
- Limit explicit return-and-discard behavior to the active side conversation, and shut down retained side conversations when exiting.

## Testing

Extend regression tests to cover reopening a side conversation after navigating away, preserving its listener and pending approval during a reset, and restricting discard selection to the active side.

GitOrigin-RevId: ff80566970414ba190ff650d5e413ef63dc65449
2026-10-08 17:31:08 +00:00
jif d650bd7c05 Add optional descriptions to agent message board channels (#52183)
## What changed

- Accept an optional `description` in `create_channel` and return it in channel summaries so agents can describe a channel's purpose.
- Enforce a limit of 512 UTF-8 bytes and account for JSON escaping in the output budget before creating the channel.
- Store descriptions in both board backends and migrate existing SQLite databases, leaving older channels without descriptions.

## Testing

Add coverage for UTF-8 byte limits, serialization, output budgets, legacy database migration, and persistence after reopening. Update the model-context scenario to create and list a described channel before posting and reading a message.

GitOrigin-RevId: cf6f395944da23e238e078eefa5de201c8b9c197
2026-10-08 17:25:39 +00:00
Michael Bolin 78a19f5ab5 Expose a verified sandbox launcher to local MCP servers (#52182)
## Why

MCP servers receiving sandbox state need a usable Codex executable to launch commands with the issuing call's policy. HTTP and remote servers cannot assume access to the host's filesystem.

## What changed

- Include optional `codexExecutable` metadata for local stdio servers when the host supplies an absolute, UTF-8 path to a CLI supporting `sandbox --sandbox-state-json`. Cache capability probes by executable path and bound them to five seconds.
- Document forwarding the sandbox state unchanged and requiring an explicit opt-out rather than silently falling back to PATH lookup or unsandboxed execution when the launcher is absent.
- Honor `useMxc` from forwarded sandbox state when selecting the Windows sandbox backend and network proxy policies, preserving a parent's selection made through CLI overrides.

## Testing

Add coverage for launcher eligibility across local, remote, and HTTP servers, invalid or missing executable paths, and binaries without sandbox-state support. Extend metadata integration and serialization tests to cover the optional launcher field, legacy state, and unknown future fields.

GitOrigin-RevId: ea8cd3770616e5a620b423a01052a7bc828bceb9
2026-10-08 17:25:09 +00:00
Michael Bolin e9e6cf6349 Strip symbols from source-built release package binaries (#52178)
## What changed

On Linux and macOS, strip the packaged copies of source-built release entrypoint and `codex-code-mode-host` binaries while retaining symbols in the original build outputs.

Add `--strip auto|all|none` and `--strip-tool`. The default `auto` preserves prebuilt inputs and other build profiles; `all` also strips those package copies, and `none` disables stripping. Select target-compatible strip tools and fail on missing tools or strip errors. Leave third-party resources unchanged.

## Testing

Add a regression test that compiles an executable with debug information, verifies stripped package binaries are smaller and still runnable, and checks that original inputs, preserved package copies, and third-party resources remain byte-for-byte unchanged.

GitOrigin-RevId: dc363c04690aa9e772690417a52a8eff31650278
2026-10-08 17:12:09 +00:00
Michael Bolin bc1f22455d Set a User-Agent for package archive downloads (#52177)
Send `User-Agent: codex-package` when downloading archives in
`scripts/codex_package/dotslash.py`.

GitOrigin-RevId: b12dc962b28d795704ba780b020fbf7ab91f5d50
2026-10-08 17:11:45 +00:00
jackz 6f6e80bcdd Show AWS GovCloud guidance at startup and remember acknowledgment (#52176)
## Why

GovCloud guidance was tied to Bedrock credential setup, so users with an already configured provider could miss it.

## What changed

Check for GovCloud during TUI startup using the app server's resolved provider, including when connecting to a server. Require acknowledgment before proceeding and save `notice.hide_gov_cloud_guidance = true` to suppress the screen on subsequent launches. Quitting the guidance exits startup without saving acknowledgment.

## Testing

Add a terminal integration test covering acknowledgment persistence, quitting without saving, and suppression after restart. Retain coverage for explicit acknowledgment and scrolling in short panes.

GitOrigin-RevId: f09fd73a66fb02f94ebdd3c3b0dbe5712dfa9be7
2026-10-08 17:10:20 +00:00
surajs-oai 8c818cbed4 Make environment context date and timezone configurable (#52164)
## What changed

Add `include_environment_context_time`, enabled by default. Setting it to `false` omits `<current_date>` and `<timezone>` while retaining the rest of the environment context, and skips the clock read used to populate the date.

## Testing

Extend configuration, session context, and external time provider tests to cover enabled and disabled time fields, context updates across turns, and current-time reminder behavior.

GitOrigin-RevId: 5071ce1701c044b680624d0cdbba7e0bc2b5bbe6
2026-10-08 16:27:10 +00:00
jif cd85a26cae Remove the patched zsh shell execution backend (#52160)
## What changed

- Use the standard shell executor and remove the zsh fork escalation runtime, `codex-execve-wrapper`, and `shell-escalation` crate.
- Ignore `shell_zsh_fork` and `unified_exec_zsh_fork`, emit migration notices for legacy configuration, and warn when ignoring managed requirements for these flags.
- Keep the active session's `apply_patch` alias directory readable under restricted filesystem permissions.

## Testing

Add coverage for legacy configuration startup and shell execution, migration notice rendering, active alias directory selection, and nested `apply_patch` execution while other files in `CODEX_HOME` remain unreadable.

GitOrigin-RevId: 43af461fea32b4980550ee7237effd2bc0646ed8
2026-10-08 16:19:09 +00:00
Leonardo Di Donato 9b738582b1 Expose originating tool call metadata in command environments (#52119)
## Why

Command processes need thread and tool call labels for correlation, without stale values from inherited environments or cached shell snapshots.

## What changed

- Export the originating `exec_command` call ID as `CODEX_TOOL_CALL_ID`; later `write_stdin` calls leave it unchanged.
- Apply executor metadata as `CODEX_THREAD_ID` and `CODEX_TOOL_CALL_ID` after environment policies, overlays, and snapshot replay. Clear omitted fields when metadata is present; without metadata, preserve thread context and remove the call ID.
- Exclude both IDs from newly captured snapshots and omit the call ID from capture and validation helpers.
- Preserve empty call IDs, omit NUL-containing IDs, and handle case-insensitive environment names on Windows. Document that these labels support correlation, not authorization.

## Testing

Add regression coverage for metadata precedence, missing and invalid IDs, snapshot capture and replay, local and remote execution with pipes and TTYs, sandboxed remote execution, and preservation of the originating call ID across later input.

GitOrigin-RevId: 1027212b5d495d8e7cfac0f498c3134e060aa897
2026-10-08 13:45:19 +00:00
jif 2fdf047c96 Fix idle cleanup for disconnected multi-agent v2 children (#52081)
## Why

Persisted multi-agent v2 children created after the client disconnects need lifecycle listeners so their runtimes can be released once idle. Listener attachment must also wait for an earlier runtime's cleanup to finish.

## What changed

- Start lifecycle listeners for persisted v2 children even when no initialized clients are connected, and defer attachment until pending unload cleanup completes.
- Keep ephemeral children loaded so follow-up tasks retain their model context.
- Raise the default `thread_unload_delay_secs` from 60 seconds to 1800 seconds (30 minutes), updating the configuration documentation and sample.

## Testing

Add regression coverage for children spawned after disconnect with zero- and one-second unload delays, including waiting for pending cleanup, keeping running threads loaded, releasing idle runtimes, and preserving an ephemeral child's earlier reply across a follow-up. Update configuration tests for the new default and explicit overrides.

GitOrigin-RevId: 2fecc77b5c03237aa8fd7eacc4bd119b99d36e0a
2026-10-08 11:52:25 +00:00
ioanbudea-OAI be2e129ecd Require assessment text in the Guardian parser (#52065)
All callers already check that an assessment payload is present before parsing it. Change `parse_guardian_assessment` to accept `&str` instead of `Option<&str>` and remove its redundant missing-payload check.

Update the callers and existing parser tests to pass text directly.

GitOrigin-RevId: e4fb4bf7aca5b20f25f5b27300ce9a6f22c97939
2026-10-08 11:01:28 +00:00
jif 48bd7667ca Add scenario coverage for worker context across idle eviction (#52062)
## What changed

Add a scenario test that queues a message for an idle worker, evicts it, and resumes it with `followup_task`. Assert that the same worker is reloaded and that queuing mail and eviction do not start another model turn.

Snapshot the complete parent and worker request histories and the resumed worker's mailbox to verify that earlier context and unread mail survive eviction in order.

GitOrigin-RevId: 2d0f7c63a2221df9c3d7e378eecaf14b8441d2b9
2026-10-08 10:53:45 +00:00
felixxia-oai 624b45c4dc Run Guardian conversation classifiers concurrently and preserve action order (#52061)
## Why

A conversation classifier waiting for preparation or full response completion can block newer classifications. Concurrent reviews also need to prevent a later action's evidence or low-risk score from being reused for an earlier action.

## What changed

- Run conversation classifications independently, forking the latest compatible completed history from an earlier action. Only a valid completion with a newer action index can replace retained history.
- Keep admission and observation ordering atomic, and hold capacity permits through full response completion.
- Reject cached low-risk scores from later actions for tool-linked approvals, including initial approval checks.
- Track originating tool-call IDs separately from approval display IDs, preserving stdin write provenance and excluding synthetic MCP elicitation IDs from tool ordering.

## Testing

Add regression coverage for delayed preparation, capacity admission, out-of-order completion, cancellation, invalid retained output, and history snapshots. Exercise pending approval ordering in both `snapshot` and `conversation` modes, and verify linked and unlinked MCP elicitation provenance.

GitOrigin-RevId: 097476ccb3b8718369a69f55c3c39132f7f1a4c1
2026-10-08 10:42:28 +00:00
jif 19b7bffd7b Cover instant interruption in steered-input persistence tests (#52048)
## What changed

Extend `steered_input_checkpoint_controls_next_request` to cover user input with `InstantInterrupt` enabled under both background and synchronous checkpoint policies. Keep the original response gated until the follow-up request arrives to prove that interruption advances the turn while preserving checkpoint ordering.

Explicitly disable `InstantInterrupt` for user-input cases that wait for response completion, and enable it for the tool-output case to verify that tool outputs still wait for completion and synchronous persistence.

GitOrigin-RevId: d39544ce6f5ad83489fd8a80b1e731a64c7a876c
2026-10-08 10:08:15 +00:00
jif b12ac84be9 Add regression coverage for cancelled agent reloads (#52040)
## What changed

Add `cancelled_v2_send_finishes_reload_registration` to verify that cancelling a multi-agent V2 send during an evicted child's reload does not cancel registration. The test checks that the thread-created notification arrives and evicted-environment state is cleared.

Evict and reload the child again with only one child slot available to catch leaked residency pins or reservations, and verify that only the subsequent follow-up message is delivered.

GitOrigin-RevId: ce6ed90d0049245370f26d8dbb35b9f1cd0b3063
2026-10-08 09:48:47 +00:00
jif d2a6dac20b Preserve agent state when unloading idle multi-agent v2 children (#52034)
## What changed

- Route app-server idle unloading of multi-agent v2 children through local eviction that preserves unread mail and environment selections for reload.
- Hold residency pins through input submission so newly reloaded children cannot be evicted before receiving their work.
- Guard listener cleanup against replacement runtimes and subscriptions, and reject local eviction of host-controlled threads.

## Testing

Add coverage for unsubscribe-driven eviction followed by `followup_task`, verifying restored conversation context and exactly-once delivery of queued mail. Extend tests to check that residency pins block eviction and that rejected host eviction preserves the thread and mailbox.

GitOrigin-RevId: e36723730af683d2081e495e637f0e6d23548b8d
2026-10-08 09:39:33 +00:00
iceweasel-oai ea27864f99 Log Windows sandbox availability and backend selection (#51974)
## What changed

Record local MXC availability and the selected Windows sandbox backend at app-server and session startup. Log the backend again when an accepted session settings update changes the Windows sandbox level, using a blocking task for the log write.

Selection entries distinguish `mxc`, `disabled`, `unelevated`, and `elevated` in the sandbox logs under `.sandbox` in Codex home.

## Testing

Update the remote thread persistence assertion to allow the `.sandbox` directory on Windows, since startup logs are not thread persistence artifacts.

GitOrigin-RevId: 4130b59ac7761223775ac9b6afb096abb7fb4615
2026-10-08 06:31:56 +00:00
reia-oai 14c8b7771a Attribute compaction analytics to the correct voice session (#51963)
## Why

Compaction analytics lack a voice session ID. A compaction event can arrive after its voice session has closed or another session has started, so attribution needs to account for when compaction began.

## What changed

Add `voice_session_id` to compaction events. Track realtime session starts, ID updates, and closures, retaining up to 16 recent closed session windows. Resolve the session from the compaction start timestamp, falling back to the turn's voice session ID.

Forward realtime session ID updates from the app server to analytics and update the active turn's attribution.

## Testing

Add coverage for realtime session boundary facts, compaction event serialization, and delayed compaction events across consecutive voice sessions.

GitOrigin-RevId: 981da0ea2c38a87079b6bab33daf2c88fd95160f
2026-10-08 05:29:11 +00:00
tongzhou wang e974aad3b1 Support model-specific function description prefixes (#51930)
## What changed

Add `functions_namespace_functions_description_prefixes` to model tool messages, keyed by unqualified tool name. Prepend this guidance to descriptions in the `functions` namespace across direct declarations, Code Mode documentation, and tool-search results, including custom tools.

Trim prefixes, ignore empty values and unavailable functions, and enforce a combined 256-byte UTF-8 limit including separators for reachable tools. Keep overrides local to each step, preserve search ranking text, and retain runtime caches for unaffected tools.

## Testing

Extend coverage for direct and indirect descriptions, clearing prefixes when switching models, namespace scoping for deferred dynamic tools, and tool-search cache reuse and reset.

GitOrigin-RevId: f434e37cec010764fe3e09fb12c339e933b3c21c
2026-10-08 03:20:54 +00:00
mandal-OAI 82e70121f8 Honor the user input setting for asynchronous questions (#51908)
## Why

Disabling `experimental_request_user_input_enabled` previously left `request_user_input_async` available when the model advertised support for it.

## What changed

Require the user input setting to be enabled before registering `request_user_input_async`, while preserving the root-agent restriction and support for both current and legacy model capability names.

## Testing

Add parameterized tests covering enabled and disabled settings, current and legacy capability names, missing capabilities, and subagents. Also verify that `send_message_to_user_async` remains available to root agents independently of the user input setting.

GitOrigin-RevId: 27156a3fe7da38d10fccb6384f28e755c39abc39
2026-10-08 02:06:58 +00:00
rafael-oai 529cd6b860 Use a dedicated matcher for network domain policies (#51897)
## Why

Network domain rules need explicit wildcard semantics independent of filesystem glob syntax, including matching Unicode hosts with `?`.

## What changed

Replace `globset` in network allowlist and denylist matching with a domain matcher. Make `?` consume one Unicode scalar value, retain ASCII case-insensitive matching and existing host normalization, and preserve the distinction between `*.example.com` and `**.example.com`.

Reject empty patterns, repeated wildcards outside the supported `**.` prefix, character classes, brace expansions, escapes, slashes, and embedded whitespace when loading policies. Continue allowing global wildcards only in allowlists.

## Testing

Add coverage for Unicode wildcard semantics, unsupported syntax, IPv6 normalization, invalid entries in either policy list, and adversarial matching inputs. Compare the matcher against an independent dynamic-programming implementation over exhaustive short inputs.

GitOrigin-RevId: 64f65fcda1a50998d70e046445d22cd2d2dcf27a
2026-10-08 01:12:42 +00:00
alishobeiri-oai dd178bb7ca Preserve native errors in Windows sandbox ACL diagnostics (#51896)
## Why

Windows sandbox setup diagnostics previously displayed only the outer error context, hiding native failure causes needed to diagnose ACL failures.

## What changed

Preserve full error chains in ACL refresh summaries, setup logs, and sandbox binary directory lock failure reports. Include the requested access rights in ACL update open errors, and retain recorded ACL failures even when writing their log entries fails.

## Testing

Add tests covering error chains for ACL checks, grants, and denies; preservation of accumulated failures when logging fails; and native directory-open errors surviving a structured setup report round trip on Windows.

GitOrigin-RevId: 0a44a56b13d13b52b92ec673aaa2da7bc6cf0753
2026-10-08 01:12:16 +00:00
pakrym-oai fac5d0ba91 Report specific reasons for WebSocket continuation failures (#51895)
## Why

Full WebSocket requests previously used the generic `other` reason when continuation failed because request properties or input changed, obscuring why incremental reuse was unavailable.

## What changed

- Report specific reasons for changed request properties, shortened or mismatched input, and missing response state or response IDs.
- Add `previous_item_type` and `current_item_type` labels to continuation metrics and failure traces. Diagnostics use bounded labels without request contents or identifiers.
- Centralize response item type names in `ResponseItem::item_type()` and reuse them for output logging.

## Testing

Add coverage for unavailable response state and empty response IDs. Expand WebSocket tests to check fallback reasons and item types for rewritten or shortened input, replaced input, changed model, and changed output schema, including precedence when multiple properties change.

GitOrigin-RevId: 3951853dfe87d40b7046af6f6a8efd5d4f5b06d1
2026-10-08 01:02:21 +00:00
Alex Kira 70efa82b09 Record metrics for incremental tool updates (#51893)
## What changed

Record `codex.tools.incremental_updates` through session telemetry with an `action` tag for `added`, `removed`, and `schema_changed`. Definition changes include description edits.

Exclude initial catalogs, unchanged tools, and namespace headers from the counts. Count each removed namespace member even when the removal notice lists only the namespace.

## Testing

Extend the namespace transition snapshot test with in-memory metric assertions covering additions, removals, definition changes, and excluded initial or unchanged catalogs.

GitOrigin-RevId: 0fadb40a3aa7abf5ef1757811ebfb5749505b3d9
2026-10-08 00:56:11 +00:00
ningyi-oai 35a9b70444 Preserve tool call completeness when recorded arguments are truncated (#51892)
## Why

Truncating recorded arguments does not lose the call inventory. Clearing `tool_calls_complete` in that case incorrectly treats retained calls and tool names as incomplete.

## What changed

Define `tool_calls_complete` as completeness of the ordered call inventory, independent of recorded arguments. Preserve it for direct tool outputs and Code Mode cells when argument limits or message budgets truncate arguments, including across later waits. Continue clearing completeness when calls are omitted or tool names are truncated.

## Testing

Update protocol, recorder, and integration tests to verify completeness survives argument truncation and message budgeting. Add coverage confirming that omitted calls and truncated tool names still clear completeness.

GitOrigin-RevId: 1534dbfabbd1291b840dd6fb6738ed51bcd4c0c4
2026-10-08 00:54:27 +00:00
iceweasel-oai c333d755d4 Add the missing mxc-sdk UTF-8 resource patch for Bazel (#51890)
## Why

`MODULE.bazel` already references `mxc-sdk_utf8_resources.patch`, but the patch file and its Bazel export are missing.

## What changed

Add and export the patch to pass `/c65001` to the Windows resource compiler when embedding `mxc-sdk` binary version information, selecting UTF-8 as the resource code page.

GitOrigin-RevId: 80cd64e6a8056c61868b5e20fd8e2fee69c1b96b
2026-10-08 00:47:20 +00:00
liame-oai ec8251c545 Add experimental prediction forks that inherit parent context (#51884)
## Why

Prediction forks need to preserve the parent's effective context and request settings to maximize prompt-cache reuse.

## What changed

- Add `experimentalPredictionMode` to `thread/fork` for ephemeral forks of loaded, persisted parents. Reject configuration overrides, `path`, `lastTurnId`, and `beforeTurnId` in this mode.
- Inherit the parent's effective configuration, tools, environments, collaboration settings, disabled plugins, and persisted history.
- Enable `features.reasoning_effort_override` on the fork while preserving the parent's request-effort baseline, including when overrides were disabled on the parent.
- Report the fork's effective model, service tier, and reasoning effort in the response.

## Testing

Add coverage for matching parent and fork requests and prompt-cache keys across legacy and paginated history, invalid fork parameters, and reasoning-effort inheritance. Add a context snapshot for identical parent and fork continuations.

GitOrigin-RevId: 46b41f2ac331562b441dadff1a0a9f926c94880d
2026-10-08 00:09:03 +00:00
Eric Traut f73a478c87 Keep global app-server config independent of the launch directory (#51872)
## Why

Global requests can inherit project settings from the app-server's launch directory. This can prevent marketplace removal or expose project-only feature settings, and config reloads can fail if that directory is deleted.

## What changed

- Load configuration without project context when no working directory is supplied, using `CODEX_HOME` to materialize `Config.cwd`.
- Use global configuration for marketplace mutations, marketplace upgrade reloads, and MCP requests without thread context.
- Pass the launch directory explicitly during startup to preserve project-aware startup configuration.

## Testing

Update regression tests to verify that marketplace removal ignores launch-project configuration and leaves the project config intact. Extend feature-list coverage to verify that global requests ignore project features, thread requests retain them, and global requests work after the launch directory is deleted on Unix.

GitOrigin-RevId: b77063a7ea0b09fd0a79cfc4040db9f1d02606b3
2026-10-07 23:19:26 +00:00
Alex Kira fbe97c7929 Record tool registration metrics for each sampling request (#51868)
## What changed

Add the `codex.tools.registered` histogram to count finalized tool registrations by `exposure` and `tool_mode`, including zero counts for empty exposure categories. Record it once per sampling request before transport retries, excluding hosted tools. These counts describe the registered inventory, not model visibility or tool reachability.

## Testing

Add an integration test covering a stream retry, direct and deferred namespace tools, a model-only tool, and hosted web search. Verify that registrations are recorded once, hosted tools are excluded, and metric labels contain no tool names or descriptions.

GitOrigin-RevId: 02b450743886e3d487d6c3bcda12eb65f6d1104b
2026-10-07 23:11:18 +00:00
pash-openai eef4719927 Preserve line breaks and links in multiline async questions (#51866)
## Why

Rendering an entire question title as one terminal line removes line endings and misaligns hyperlink source ranges with the visible text.

## What changed

Wrap and annotate each logical line of asynchronous question titles separately, preserving blank lines and handling both LF and CRLF endings while retaining complete hyperlink destinations.

## Testing

Add a rendering regression test and snapshot covering multiline titles with code fences, Unicode text, and a URL. Check LF and CRLF rendering equivalence and hyperlink destinations at narrow and wide widths.

GitOrigin-RevId: ccd7256dbaed91ce98374e52b17d3a1b87645574
2026-10-07 22:55:00 +00:00
canvrno-oai 746103b592 Use readable plugin mentions without suppressing same-name skills (#51865)
## Why

Generated app IDs produce opaque plugin mention labels. A selected `@foo` plugin mention also prevented a separate `$foo` skill mention from being submitted.

## What changed

- Use eligible display names, such as `@Postman`, for plugins named `app-` followed by 32 lowercase hexadecimal characters, while preserving the plugin binding. Accept 1–64 ASCII letters, digits, underscores, or hyphens, excluding common environment variable names; otherwise retain the existing naming fallback.
- Only `$` mention bindings suppress automatic skill selection, allowing `@foo $foo` to submit both the plugin and the skill.

## Testing

Add naming tests for accepted display names and fallback cases, a composer snapshot verifying `@Postman` and its plugin binding, and a submission regression test for a plugin and skill sharing the name `foo`.

GitOrigin-RevId: aa8c98f293d12e62d32d43206e076cbe1fcb2a3b
2026-10-07 22:46:41 +00:00
jif b7a76bce20 Add an app-server prompt prefix compatibility test (#51857)
## Why

Detect changes to the default model-visible prefix relative to a released CLI, requiring those changes to be gated behind a default-off feature key.

## What changed

Add `prompt_prefix_matches_release` to compare instructions, tools, and input preceding the user message using the same client and inputs. Each binary uses its bundled model catalog and feature defaults. The comparison removes response item IDs and transport metadata and normalizes fixture paths and session identifiers while preserving prompt text, whitespace, tool descriptions, schemas, and array ordering.

Use the released binary supplied by `CONTRACT_EXECUTOR_BIN` when available; otherwise, compare two runs of the current binary to check determinism.

GitOrigin-RevId: 1a69fb3abb6fc3df90a095e01bcf0d5de1818fac
2026-10-07 22:21:33 +00:00
Dmitriy Kovalenko 47b195de5c Build Bazel release artifacts alongside Cargo artifacts (#51856)
## What changed

- Add Cargo and Bazel build matrices for Linux, macOS, and Windows, carrying both through signing, packaging, and artifact verification.
- Publish Bazel binaries, packages, and symbols with a `-bazel` suffix while preserving Cargo artifact names. Keep Python runtime wheels and the Windows installer on the Cargo path.
- Use `--config=release` for native voice builds and Windows voice tests, set the macOS voice build minimum to 14.0, and increase the Windows binary build timeout to 120 minutes while both build paths coexist.

GitOrigin-RevId: 77bcdd7b2a573d0ae2a4c3392e0708445b386f23
2026-10-07 22:21:07 +00:00
Dmitriy Kovalenko 41d5adfbe6 Add Bazel support to the Codex package build action (#51855)
## What changed

Add a `build-system` input to `build-codex-packages`, defaulting to `cargo`, and extract binary builds into dedicated Cargo and Bazel actions. The Bazel path stages binaries and symbols for the shared CLI and app-server packaging and smoke-test steps, with support for `release` and `debug` build modes.

Resolve the package source root before invoking nested actions, and use Bash to export the Bazel repository cache path.

GitOrigin-RevId: ebd5e7c84451733419838da5956dc090cd09b19a
2026-10-07 22:20:33 +00:00
Dmitriy Kovalenko 02d78ab053 Add Bazel release staging archives (#51850)
## What changed

- Add `runtime_package` targets for combined, primary, app-server, and Windows helper bundles, plus per-binary release archives.
- Apply release settings automatically and retain unstripped binaries with macOS dSYM or Windows PDB symbols. Require platform-specific symbols and validate that dSYM bundles contain nonempty DWARF data.
- Support a `debug` build mode for faster package smoke builds and configure platform-specific release settings, including native Windows MSVC toolchains.
- Add a composite action that refreshes Cargo workspace metadata, builds the selected archive, and extracts writable files for existing signing and packaging steps.

GitOrigin-RevId: 21109875cde228aaef67b2ba9812b3e4854aee84
2026-10-07 22:11:14 +00:00
Dmitriy Kovalenko 391bf191c2 Fix package smoke tests for Cargo and Bazel debug symbols (#51849)
## Why

Cargo and Bazel embed different PDB filenames in the Windows code-mode host executable. The package smoke test must support both names while verifying that the debug symbols match the packaged executable.

## What changed

- Keep the archived PDB and copy it to `codex_code_mode_host.pdb`, allowing `dumpbin /PDBPATH` to resolve either name. Accept either path in the assertion.
- Set `sandbox_workspace_write.writable_roots = []` explicitly in the smoke-test configuration.

GitOrigin-RevId: fc2610f580dad49e38848582bc63f1f829cb766d
2026-10-07 22:10:49 +00:00