Commit Graph
3189 Commits
Author SHA1 Message Date
rhan-oai daa59ebd29 Keep authorization evidence local to agent forks (#62314)
## Why

A prepared agent fork needs its ancestor's conversation for context.
Treating that conversation as the child's own authorization evidence
can attribute the ancestor's messages and approvals to the child.

## What changed

Allow host-started prepared forks that reference stored history to
inherit the root session ID. Keep ancestor messages as conversation
context and exclude ancestor authorization evidence when starting or
resuming the fork and when reconstructing sender evidence from storage.
Preserve the inherited disabled-plugin settings and the child's own
authorization evidence.

## Testing

Cover prepared forks across startup and resume, including inherited
context, plugin settings, and child-local authorization. Verify that
live and stored sender evidence both contain only the child's messages.

GitOrigin-RevId: 5c5a6547d31fe78dfad3742efb8a41df539173c6
2026-11-18 16:37:03 +00:00
jif 5a6fb36a4d Route local MCP board notifications through response item injection (#62302)
## What changed

In opt-in local MCP mode, deliver board notifications through
`inject_response_items` when the recipient uses Multi-Agent V2 with native
tools enabled. Other deliveries continue to use `Op::InterAgentCommunication`.

## Testing

Extend the HTTP board scenario to check that the parent receives exactly one
`CHANNEL_POST` agent message with the worker as author, the parent as
recipient, and the expected post preview text.

GitOrigin-RevId: deaa1451619a94d9c70c771327892069325c5e60
2026-11-18 15:38:06 +00:00
Zahan Malkani bd00a8a42e Preserve pending realtime speech when a call ends (#62299)
## Why

A realtime call can end with completed speech that has yet to reach a
Codex turn. The next turn needs that context even if the call's transport
has already disconnected.

## What changed

- For V3 calls with realtime frame history enabled, save pending speech
  as context for the next turn. Restore it on thread reload and exclude
  it from the turn count used by rollback.
- Drain already received transcript events and settle pending handoffs
  before saving the call's closing marker. Report recovery required if
  shutdown cannot confirm that history was saved.
- Keep transport detach separate from ending a call. Reattaching restores
  saved pending speech, and an open call can be ended from persisted
  history after a reload. Use the call ID for TUI attachments so successive
  calls on one thread have distinct history.

## Testing

Add coverage for queued speech at hangup, reconnect and stop after
reload, retries after an uncertain write, and rollback across saved
session-end context.

GitOrigin-RevId: 657491f1d7e446a1a48e22189758810c8bdd82cb
2026-11-18 15:24:29 +00:00
jif bd3eaf7829 Route injected plaintext agent mail through the native mailbox (#62292)
## Why

Raw response injection bypasses the native mailbox wake policy, so
injected agent messages cannot wake a sleeping thread through that
policy.

## What changed

In native Multi-Agent v2, route batches consisting entirely of
single-text agent messages with valid agent paths through the mailbox
as queue-only mail. Hold a residency pin across the batch so capacity
eviction cannot interrupt delivery between submissions. Mixed batches,
multipart or encrypted messages, and configurations with native tools
disabled continue to use raw response injection.

Only preempt model sampling for pending mail when the matching turn
still accepts mailbox delivery.

## Testing

Extend coverage for waking live and reloaded sleeping threads,
delivering older queued mail before a new task, and retaining mail in
order when a batch exceeds the submission channel capacity and
eviction is attempted.

GitOrigin-RevId: 3df60d2a4a9e7b193ef298e01f31c565ad8a2785
2026-11-18 14:53:00 +00:00
jif df975851bf Use the system clock for in-memory MCP message boards (#62284)
## Why

The in-memory MCP backend depended on the runner's clock, so a runner
clock failure could prevent posting. The standalone SQLite backend
already uses the system clock.

## What changed

Read UTC time from the MCP backend's system clock after validating
caller membership. Apply this to both tree and agent-specific bindings.

## Testing

Update the HTTP integration scenario to make the runner clock fail and
verify that a child agent's post timestamp falls within the posting
window.

GitOrigin-RevId: bad5dec5a9be7246cf627b017897fbfe2c960cd1
2026-11-18 14:11:08 +00:00
ioanbudea-OAI a05444bbeb Refresh managed Guardian policy independently of MCP (#62276)
## Why

Managed approval requirements can change while an MCP runtime is still in use.
Later turns need to honor those changes without restarting MCP, while in-flight
MCP actions need to retain the mandatory review requirements of their issuing
turn.

## What changed

- Add `CodexThread::refresh_guardian_policy` to apply managed policy updates to
  an existing thread. MCP configuration refreshes preserve the active Guardian
  policy, including when a policy update lands while MCP configuration is loading.
- Resolve MCP tool and elicitation reviewers against the issuing turn's policy.
  Live requirements can still require Guardian review, and a live policy change
  cannot waive mandatory review captured by the turn.

## Testing

Extend coverage for overlapping Guardian and MCP refreshes and for an existing
MCP runtime that must prompt the user on the next turn after a policy update
allows only the `user` reviewer.

GitOrigin-RevId: 5a1649f917313f6fb152a206bc89986fe6345481
2026-11-18 13:08:51 +00:00
Zahan Malkani 29cb67623c Gate local realtime frame history on paginated storage (#62271)
## Why

Legacy rollout migration rewrites rolled-back history and can disrupt
the realtime stream. Enroll local threads once they use paginated history
so the stream stays intact.

## What changed

- Add the off-by-default `features.realtime_frames_local` flag for
  paginated local threads with a state database. Accept runtime updates
  through the app server and keep threads enrolled once they have a
  persisted canonical session start.
- Add thread-store APIs to recover a realtime session and look up the
  latest session ID from durable history. Route frame completion through
  a store seal so completion acknowledges durable writes.
- Add a local seal for accepted model input that writes source frames
  before the input and lets callers retry an uncertain flush without
  appending the input twice.

## Testing

Cover enrollment for legacy and paginated threads, continued enrollment
after disabling the flag, and retrying a local input seal after a failed
directory sync.

GitOrigin-RevId: 2012feeca3857da90f9b026f077b31a26d15191b
2026-11-18 12:55:14 +00:00
cazhang-oai ca21fe65d1 Tag Guardian review counts with turn origin (#62225)
## Why

Guardian review counts need a way to distinguish automation-triggered
turns from other turns, including when a subagent requests the review.

## What changed

Add a `turn_origin` tag to the `codex.guardian.review` counter based on
the trigger recorded when the turn started. Recognized automation
triggers map to `automation`, missing or empty triggers map to
`unknown`, and all other values map to `other`. This keeps the set of
metric labels bounded.

## Testing

Cover trigger classification for both allow and deny verdicts and
verify that a later user turn on the same thread is counted separately
from an automation turn in both main and subagent threads.

GitOrigin-RevId: 6a5808798df7d184203cea18e60a94a82d71f036
2026-11-18 08:20:26 +00:00
viyatb-oai bcff988bd1 Resolve Linux sandbox mode once before launching the helper (#62215)
## Why

Managed proxy routes require bubblewrap's network namespace even when
`features.use_legacy_landlock` is enabled. WSL1 compatibility checks and
helper arguments need to agree on the effective mode.

## What changed

Resolve bubblewrap or legacy Landlock once and use that mode for both the
WSL1 check and the `codex-linux-sandbox` arguments. Use Linux sandbox
naming for the shared launcher and CLI code, and preserve the published
analytics category for a missing helper executable.

## Testing

Unit tests exercise the production argument builder, including managed
network context serialization when legacy Landlock is requested. They
also cover which sandbox configurations WSL1 accepts and rejects.

GitOrigin-RevId: 619ab9d3eef965de6bc6cb13ff8a33132018abcf
2026-11-18 07:23:25 +00:00
Ruslan Nigmatullin 86d0e458e3 Prevent duplicate initial context when injection races the first turn (#62206)
## Why

A first user turn and a concurrent raw response-item injection can both
observe that the session has no reference context. Both can then append
the initial prompt prefix and persist a full world-state snapshot.

## What changed

Allow context preparation to run concurrently, then serialize publication
of the initial prefix and its checkpoints. If injection publishes first,
the user turn computes its context updates against the published baseline.
If the user turn publishes first, injection appends only the
caller-provided items.

## Testing

Add an integration test that forces the overlap in both preparation
orders. It checks the first request's world-state updates, verifies that
the follow-up request contains the initial instructions and injected
content once each, and checks that history contains one full snapshot.

GitOrigin-RevId: b66f9c6ccc5d42a2be0e852b4d83b78adbc9e5b2
2026-11-18 06:35:41 +00:00
viyatb-oai a4495dd5c9 Keep sandbox preparation with the command through launch (#62205)
## What changed

- Keep the prepared `SandboxExecRequest` intact in core and let
  `command/exec` borrow the prepared command for streaming. Windows
  restricted-token commands continue through the dedicated sandbox launcher.
- Move runtime read-path selection for exec-server commands and filesystem
  helpers into `SandboxManager`. It derives the paths from the executor's
  binaries and, for managed process launches, finds the generated proxy CA
  bundle in the command environment.

GitOrigin-RevId: 8c9d278496d84589bc4a7b7d0ed08cb1b8e6ba21
2026-11-18 06:22:36 +00:00
Dylan Hurd 3aaa23a437 Reduce overhead in CLI integration tests (#62153)
## Why

SSE-only mocks return 404 on WebSocket upgrades by default, causing
retries before the tests reach the HTTP stream. In parallel runs, each
CLI subprocess can also start a Tokio worker per host CPU.

## What changed

- Share an SSE mock that returns HTTP 426 on WebSocket upgrades to
  trigger immediate HTTP fallback. Reuse it in the fallback test.
- Set `TOKIO_WORKER_THREADS=2` for CLI subprocesses launched by the
  affected test helpers. Run streaming and resume cases that don't need
  the repository checkout in temporary working directories.
- Test promptless `codex exec fork` option validation without creating a
  source thread. In the successful promptless fork case, keep stdin
  open and rely on the test runner's timeout to catch a blocked read.

GitOrigin-RevId: 94c20d4b2fd7cc65bc0f2a1cd0318ac188f59f22
2026-11-18 01:48:42 +00:00
Owen Lin 06789c7618 Preserve web search provider ownership across thread resumes (#62144)
## Why

Search MCP and native web search produce provider-specific references.
Switching providers after a thread resumes can mix those references and
break follow-up calls that use them.

## What changed

Persist whether a thread has used Search MCP, native web search, or
neither. Restore that state from response history, including compacted
history, and use legacy attribution and fallback markers for older
threads. When resumed history lacks a search state or legacy attribution
checkpoint, withhold native fallback unless a legacy marker identifies
native search.

Require every Search MCP call to claim the thread's search provider
before execution, including calls retained by Code Mode.

## Testing

Cover resuming a thread with Search MCP references after discovery
becomes unavailable, both with a saved search state and with imported
history that lacks search checkpoints.

GitOrigin-RevId: 100d21c92b0bdbf737ec36c3474f0bc020df8efc
2026-11-18 00:45:07 +00:00
felixxia-oai c2595ad343 Add live evidence retrieval for Guardian v3 reviewers (#62133)
## Why

A captured board view limits evidence searches to the review's cutoff. A
verdict reviewer needs to be able to check for later evidence, including
restrictions or revocations, before deciding on an action.

## What changed

Add a live `guardian_board` binding that lets reviewers search and read
any Guardian evidence channel, including channels they do not follow.
Search also matches text inside JSON-encoded tool arguments.

Reviewers can list their own subscriptions with `subscribed_channels`
and subscribe or unsubscribe by channel. Subscriptions control delivery
of future evidence. Earlier posts are available through search and read
tools.

Let review setup and prewarming select guidance for the installed
retrieval tools. The live board guidance explains how to find original
user messages and assess their authority. Share the provider-scoped
reviewer header setup through the core Guardian review API.

## Testing

Cover searches beyond the captured cutoff and in unsubscribed channels,
paginated listing of the reviewer's own subscriptions, and channel-only
subscription changes in both live and captured views.

GitOrigin-RevId: c2e1c6c849346cd3d6e316bcf17e44260fcd4c8e
2026-11-17 23:47:24 +00:00
jif e73da8bd1b Preserve base and developer instructions in host child preparation (#62128)
## Why

Hosts preparing a child thread lacked the parent's effective base
instructions and the developer instructions a native subagent would inherit.
Hosts also need the base instruction provenance to preserve custom text
while letting model-owned instructions resolve for the child's model.

## What changed

Include effective base instruction text and provenance in
`PreparedChildContext`. Share developer instruction selection with native
subagent creation so host preparation uses the configured V2 subagent
override when present and falls back to the parent turn's developer
instructions otherwise.

## Testing

Add integration coverage that starts a child on a different model and
checks that custom base instructions persist, model-owned instructions
resolve for the child model, and the V2 override takes precedence over
the parent developer instructions.

GitOrigin-RevId: 0e151e343e58d995c8901a9ba819cb7f60d248f5
2026-11-17 23:31:58 +00:00
andrewgu-oai 4e51bfbacc Refresh tool hashes in core scenario snapshots (#62124)
## What changed

Update the expected hashes for tool lists and incremental tool declarations
across seven core scenario snapshots. The fixtures cover Code Mode, dynamic
tools, and MCP discovery and sharing.

GitOrigin-RevId: 8d69870b488dffc5a24afe0e1c8f522335b25105
2026-11-17 22:58:38 +00:00
Shuo 8dcd56d0cb Add external header auth for existing realtime calls (#62114)
## What changed

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

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

## Testing

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

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

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

## What changed

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

## Testing

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

GitOrigin-RevId: edc0e8ffa955227328345f46afecc2a868c0be49
2026-11-17 21:40:36 +00:00
andrewgu-oai 6c0cee502d Add GPT-6.2 Sol and Astra to model catalogs (#62106)
## What changed

- Add `gpt-6.2-sol` and `gpt-6.2-astra` to the bundled, Amazon Bedrock, and Vertex catalogs, including Bedrock Runtime global and US cross-region variants.
- Make GPT-6.2 Sol the default catalog selection and refresh model ordering, descriptions, and bundled instructions.
- Increase the GPT-6.1 Sol context window to 500,000 tokens.
- Advertise the `ultrafast` service tier for GPT-6.2 Astra on Bedrock.
- Supply the same current model catalog to both executors in the prompt-prefix compatibility test so catalog updates do not cause prefix mismatches.

## Testing

Extend provider, app-server, and TUI coverage for catalog ordering, model fallback, Vertex requests, and GPT-6.2 Astra's Bedrock `ultrafast` selection and clearing behavior. Refresh model-picker and request snapshots.

GitOrigin-RevId: f28940e4a255fcdd88f7114873259bd1f3399812
2026-11-17 20:04:36 +00:00
Tom 7457b7268f Preserve trace context during WebSocket startup prewarm (#62103)
## What changed

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

## Testing

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

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

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

## Testing

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

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

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

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

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

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

## What changed

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

## Testing

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

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

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

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

GitOrigin-RevId: 9eab3ae7264e6ddf3db6ae40a34cc895d0954621
2026-11-17 18:44:30 +00:00
jif bc2c328483 Append transcript provenance to Guardian JSON instructions (#62090)
## What changed

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

## Testing

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

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

GitOrigin-RevId: 17a17941c933e44c0be9d70479741d4c814c3f8b
2026-11-17 18:23:40 +00:00
swastik-oai ce5a565ba0 Simplify Guardian history review preambles (#62074)
## What changed

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

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

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

## What changed

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

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

## Testing

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

GitOrigin-RevId: 8c378c49239ccfac03deb2b793fc69aba1d41644
2026-11-17 16:15:55 +00:00
jif b271854568 Allow the expanded agent model shortlist in prompt-prefix tests (#62070)
## Why

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

## What changed

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

GitOrigin-RevId: 22cfd81215734d9f3aba84eda2102c25d75fce96
2026-11-17 16:12:36 +00:00
rhan-oai 5a4aff8431 Expand the spawn_agent model listing cap to 16 (#62051)
## What changed

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

## Testing

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

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

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

## What changed

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

## Testing

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

GitOrigin-RevId: e2f3b543680c9184b6557b81de02a61f0a977e32
2026-11-17 13:52:56 +00:00
Sean Huang db9778b73c Distinguish image and tool audio attachment uploads (#62047)
## What changed

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

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

## Testing

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

GitOrigin-RevId: 7dbd69922b377aead2dc28d1e5b3938cce6343b7
2026-11-17 13:38:34 +00:00
Joe Savona e20ccdfa80 Add custom status line authoring to /statusline (#62037)
## What changed

- Add “Create a custom status line” when `tui_extensions_statusline` is enabled outside cloud mode. Open a new conversation with an editable draft bound to the bundled `create-statusline` skill when available, falling back to a plain request otherwise.
- Preserve the previous thread’s draft and queued input, including input restored by a late interrupt, while switching conversations.
- Guard against stale create actions and held Enter submitting the new draft. Rename the provider action to “Choose a status line provider”.

## Testing

Add regression coverage for draft editing, bundled skill binding, input preservation, activation-key handling, dismissed setup actions, and hiding the create action in cloud mode.

GitOrigin-RevId: d40dd12914cf38968e605987f67d1ddee5ba7dd1
2026-11-17 12:24:05 +00:00
Joe Savona b47df356af Add a bundled skill for authoring MCP statuslines (#62036)
## What changed

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

## Testing

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

GitOrigin-RevId: e48fd5064ad93bf37b50b5643028d4153a3b4f59
2026-11-17 12:22:55 +00:00
Benjamin Carlsson 39b5903898 Set explicit image detail in the restored-history prewarm test (#61969)
Construct the injected image as a `ResponseInputItem::Message` with
`ImageDetail::High` in the restored-history prewarm scenario.

GitOrigin-RevId: 6a414d2c52cb4d2195e6721365c97677c49c956e
2026-11-17 05:17:42 +00:00
Adam Perry @ OpenAI d8d840d32a Capture local attachments before queuing turn input (#61962)
## Why

Queued input can outlive its local attachment files. Reading those files only when rendering a model message can lose media submitted while turn admission is pending.

## What changed

- Introduce `ResolvedUserInput` to carry captured image bytes, audio data URLs, or read errors through session queues and agent input.
- Resolve client attachments on the submitting host before queuing, using a blocking task for local file reads.
- Render messages from captured payloads while preserving original paths and text spans for display, along with image position mappings.

## Testing

Add coverage for rendering and serialization after source files are removed, steered audio retained during pending admission, and local audio errors and display content.

GitOrigin-RevId: 4bbb6bda44167439a8cfdae15d3c476a7b1d336b
2026-11-17 04:08:00 +00:00
bkotsopoulos 65a4450886 Prewarm restored file images on cold resume (#61959)
## Why

Cold resumes warm only base instructions, leaving historical file images out of the WebSocket warm-up.

## What changed

- Add the disabled-by-default `restored_history_prewarm` feature flag.
- Start the WebSocket handshake while history loads, then build the warm-up from restored settings and history when it contains file images.
- Retain the socket and normalized-image cache but discard the image warm-up response ID, so generation resends the full current history and subsequent turns continue from the real response.
- Keep base warm-up for history without file images and defer image preparation to generation when the handshake falls back to HTTP.

## Testing

Add request-history tests and snapshots covering text-only history, interrupted and injected images, resuming with a vision model after image omission, and HTTP fallback without duplicate image resolution.

GitOrigin-RevId: 9a828f44ef0952f7335b5a8c0f7844a069f90d80
2026-11-17 03:48:25 +00:00
rhan-oai 44834c58fa Support turn-scoped exhaustion in host usage accounting (#61958)
## What changed

- Add `UsageAccountingDecision::ExhaustedForTurn` so hosts can fail the current response with `SessionBudgetExceeded` while leaving later turns and peer threads eligible.
- Preserve completed response output and token usage before reporting exhaustion, and track posted charges to avoid accounting twice.
- When steering or mailbox preemption stops a stream, wait for accounting of any completion already observed before starting a follow-up request, and propagate budget errors.

## Testing

Add coverage for preserving output and usage on turn exhaustion, successfully starting a later turn, and reporting turn exhaustion during steering.

GitOrigin-RevId: e673bf30775f27a057fdc39d8429b74ff22121db
2026-11-17 03:28:51 +00:00
Adam Perry @ OpenAI 5b3d2c7fce Extract user input preparation into codex-user-input (#61949)
## What changed

Move local attachment snapshotting and conversion from `UserInput` to model request content out of `codex-protocol` into a dedicated `codex-user-input` crate. Update core, the TUI, and the queue extension to use the new crate, replacing the `ResponseInputItem` conversion methods with `from_user_input`.

Move the associated attachment and message conversion tests alongside the implementation, preserving coverage for image positions, media labels, serialization, and error placeholders.

GitOrigin-RevId: 77d0f94a4cd4c2edc008b9e2e63a989995aab058
2026-11-17 02:43:52 +00:00
Ankush Gupta 0637230e89 Include enclosing tool context in nested Guardian approvals (#61946)
## Why

A nested MCP approval can arrive while its enclosing tool invocation is still running. Follow-up Guardian reviews may use a transcript delta that no longer includes that invocation, leaving out the context in which the nested action was requested.

## What changed

- Add the disabled-by-default `guardian_nested_approval_context` feature to include the host-verified enclosing tool name and arguments in synchronous nested approval requests, while preserving the nested action as the action under review.
- Match the enclosing invocation by call ID and omit ambiguous or unavailable evidence. Exclude Node REPL JavaScript preflight requests.
- Admit enclosing-call context only when it fits the remaining fixed or elastic budget, without displacing ordinary transcript evidence or screenshots.

## Testing

Add MCP elicitation coverage and a request-history snapshot for independent nested reviews and transcript deltas. Add tests for call-ID matching, budget-based omission, and screenshot priority.

GitOrigin-RevId: 9c44a0e8f29f84f84a5322b8362f910f2c91ac55
2026-11-17 02:31:45 +00:00
rhan-oai 34c7cbb454 Allow host-started forks to inherit the root session ID (#61945)
## Why

Host-started forks rejected `InheritedSessionId`, preventing hosts from assigning the root session ID to forked children as they already could for fresh children.

## What changed

Accept `InheritedSessionId` for new or forked threads started directly by the host. Resumed threads continue to use persisted session IDs, and native children continue to use their controller's session ID.

## Testing

Extend hosted-child tests to cover prepared forks, verify that inherited session IDs persist across resume while thread IDs remain distinct, and check that explicit session inheritance is rejected for resumed threads and native children.

GitOrigin-RevId: 90fd24a25e4e927c48395dfae7186bb7fd0e537e
2026-11-17 02:15:09 +00:00
viyatb-oai c656014177 Centralize exec-server launches in WrappedSandboxCommand (#61942)
## What changed

- Move process spawning and Windows token session preparation into `codex-sandboxing`. Keep filesystem overrides, proxy enforcement, and the restricting SID with the prepared command, and reject conversion to a plain command request when a Windows session launcher is required.
- Route shell snapshot capture and replay through the prepared command. Limit script replacement to the submitted shell invocation while preserving its sandbox, environment, and proxy.
- Pass borrowed launch facts to sandbox integrity checks, and distinguish explicitly supplied runtime readable paths from automatic proxy CA bundle discovery.

## Testing

Extend coverage for Windows TEMP permissions and managed proxy routing with empty workspace roots, native launch and prewarm input validation, and proxy availability after the process leader exits while a descendant holds stdout open.

GitOrigin-RevId: fe2bdb9e44f4fb273295fbde66b44bf01f0b7fbc
2026-11-17 02:02:21 +00:00
ningyi-oai cc356fd384 Preserve partial Git metadata when worktree status is slow (#61939)
## Why

Memory requests have a one-second Git metadata deadline. Waiting for all Git lookups together discards an already observed HEAD or remote URL when the worktree scan exceeds that deadline. Shared status scans can also describe a different HEAD from the independent lookup.

## What changed

- Publish HEAD, verified remote URLs, and worktree status incrementally, retaining available metadata at the memory request deadline.
- Read HEAD and change status together using Git porcelain v2, and reject status observations that conflict with an independently observed HEAD.
- Run a positive-only change probe over up to four recently modified root directories during memory extraction preparation. Use a completed probe only when full status is unknown and its HEAD matches the request metadata, without waiting for it before sending the request.

## Testing

Add coverage for partial metadata at the deadline, delayed lookups, stale and unborn HEAD observations, positive-only probes, shared scans, and porcelain parsing. Extend remote credential redaction coverage to partial clones.

GitOrigin-RevId: e7b7c250bfc0e23fb8962fcd5cd5febd7c69e2bd
2026-11-17 01:59:51 +00:00
jif f8e58064fc Preserve remote compaction summaries when interrupting child agents (#61916)
## Why

Child agents configured to interrupt at item boundaries should retain the summary when interrupted during remote compaction. An interrupt during post-turn compaction should also preserve the answer already completed.

## What changed

- Keep sampling interrupt registration active through summary installation, then honor the pending interrupt without running post-compaction hooks.
- Deliver an already completed answer when post-turn compaction is interrupted.
- Keep queued follow-ups for a new turn instead of continuing the interrupted turn.

## Testing

Add a streaming scenario test and context snapshot covering interrupts during mid-turn and post-turn remote compaction. Verify that resumed requests retain the summaries, the completed answer is delivered, and each queued follow-up starts a separate turn.

GitOrigin-RevId: 939eb8b3ed24dbdbff10c9f62226e38a0198fd6f
2026-11-16 23:58:12 +00:00
jif cff061fca9 Add opt-in item-boundary interrupts for subagents (#61909)
## What changed

Add the multi-agent v2 setting `interrupt_at_item_boundary`, disabled by default. When enabled, `interrupt_agent` lets a subagent finish and retain its current output item while cancelling tools immediately. Later output items are discarded, and retained tool calls that have not run receive an aborted result.

Wait for the interrupted turn's terminal event before starting follow-up input, and prevent idle contributors from restarting the interrupted child.

## Testing

Add streaming tests for retaining an assistant message or tool call, discarding later output, and preserving history and follow-up input when the child resumes. Update configuration and interrupt-routing tests.

GitOrigin-RevId: 8b2b9b1383bfb4eefea7369a40012bebc5fff07b
2026-11-16 23:26:07 +00:00
sayan-oai ce7079b506 Add opt-in UTC dates to environment context (#61897)
## What changed

Add the disabled-by-default `utc_environment_date` feature to compute the model-visible environment date in UTC and render it as `<current_date_utc>`. Preserve local dates when the feature is disabled.

Track the date's time basis in environment snapshots so switching to UTC emits an update even when the date is unchanged. Use the matching date tag when reporting an unavailable clock.

## Testing

Extend coverage for UTC midnight rollover, unchanged dates within a day, legacy snapshot refresh, and date removal and recovery. Update local and remote compaction snapshots to exercise the UTC date tag.

GitOrigin-RevId: 6e983d05ca2914629c9f8575e2efe3ed274a2f77
2026-11-16 22:27:05 +00:00
RJ c0d47262f3 Acknowledge agent messages and clarify how to wake idle recipients (#61894)
## What changed

Return `Message accepted.` from the v2 `send_message` tool. For non-root recipients, also advise using `followup_task` when an idle agent should act immediately. Messages to the root agent receive only the acknowledgment.

## Testing

Assert the acknowledgment when a child messages the root agent, and update the idle-eviction follow-up snapshot to include the guidance for non-root recipients.

GitOrigin-RevId: bb0cf6039d9b693052a1747daa2e75fa25c13522
2026-11-16 22:07:07 +00:00
jif 3257e1b3eb Allow model metadata to control multi-agent tools in code mode (#61854)
## What changed

Add optional `multi_agent_tools_in_code_mode` model metadata to control whether native multi-agent tools follow the model's `tool_mode`. When `true`, expose them according to `Direct`, `CodeMode`, or `CodeModeOnly`; when `false`, keep them direct-only. When omitted, preserve the `multi_agent_v2.non_code_mode_only` runtime setting.

## Testing

Add coverage for metadata overrides and runtime fallback across all three tool modes, plus serialization and deserialization of absent, null, and boolean metadata values. Update the namespace-prefix integration scenario to enable code-mode tools through model metadata.

GitOrigin-RevId: be90f436066226bf9971cbd17f28c396341bb83a
2026-11-16 18:54:05 +00:00
jif e5839cbc59 Preserve aggregate turn diffs across steering (#61820)
## Why

A steer can restart sampling within the same turn. Recreating the diff tracker loses earlier edits, and changing the working directory can change the meaning of relative diff paths.

## What changed

Keep the diff tracker for the lifetime of the turn and retain each environment's first display root. Refresh cached diff headers when new environments are added. Emit the final aggregate `TurnDiff` before `TurnComplete` instead of at sampling completion.

## Testing

Extend regression coverage for steering during the final flush, with and without additional patches and with a changed working directory. Check final diff ordering across continued sampling and header updates when adding an environment.

GitOrigin-RevId: fbd1ebef072d8486a324190c9125fc1446510802
2026-11-16 14:18:24 +00:00
zm-oai 5a6bbd29a4 Clarify shell-specific login guidance for exec_command (#61744)
## Why

The `login` description claimed a fixed default and described Unix shell flags for every shell. In PowerShell, disabling login startup skips profiles, which can make profile-defined commands unavailable.

## What changed

Describe omitted `login` values as inheriting the setting. When a turn environment reports PowerShell, explain that `login: false` skips profiles and advise keeping profiles enabled for commands that depend on them, including unattended commands.

## Testing

Add coverage for shell-specific descriptions, remote environment readiness, and exact normalization of PowerShell wording in portable tool snapshots. Update prompt-prefix compatibility checks and affected snapshots.

GitOrigin-RevId: f6cb29c6c32921241cbd1be0c31f985c5ae274f9
2026-11-16 04:54:23 +00:00