Commit Graph
2833 Commits
Author SHA1 Message Date
felixxia-oai d800b00e88 Restart Guardian v3 shadow intake when Auto Review resumes (#63988)
## Why

Switching an enrolled thread to user approvals stops Guardian v3 shadow
intake. Previously, switching the same thread back to Auto Review left
intake stopped for subsequent turns.

## What changed

Restart intake in the background with a fresh evidence board after
checking that the thread still routes approvals to Auto Review. Start
at the end of persisted history so the new board only receives new
evidence. Existing child threads can attach to the new board on their
next turn.

## Testing

Add app-server coverage for routing later turns after Auto Review
resumes without replaying earlier turns. Extend the host test to cover
stale settings notifications, cancellation of a queued restart, and
creation of a fresh board and reviewer.

GitOrigin-RevId: 5201d7f7a7e3f2c045c69b9584b036467a5767d7
2026-11-25 22:39:08 +00:00
jif c6bbf8a413 Extract shared network policy types from the proxy crate (#63986)
## Why

The protocol and feature configuration crates depend on the network proxy
crate for data types. Give them a smaller dependency that contains the
shared definitions.

## What changed

Move environment network policies, domain and Unix socket permissions,
policy decisions and their sources, and credential provider definitions
into `codex-network-policy-types`. Use the new crate directly from
`codex-protocol` and `codex-features`.

Re-export the moved types from `codex-network-proxy` and keep environment
policy conversion and application, along with credential provider
validation, in the proxy crate.

GitOrigin-RevId: 8af684da746830bce45ac00135aed8052dba3824
2026-11-25 16:09:51 +00:00
felixxia-oai 06f334aa4b Add opt-in shadow intake for Guardian V3 (#63949)
## What changed

Add the default-off `features.guardianv3_shadow` flag and ignore it in
project config. When Guardian V2 handles Auto Review and Guardian V3
is disabled, enroll eligible new threads in background evidence intake
while Guardian V2 keeps making approval decisions.

Share an in-memory evidence board between the root and its child agents.
Keep shadow reviewer sessions ephemeral and suppress their events in
the parent thread. Retry failed intake startup on a later turn, and
stop shadow work when the root leaves Auto Review or shuts down.

## Testing

Cover enrollment for opted-in new threads, startup retry, child
attachment and cancellation, and the absence of an on-disk board.
Verify that project config cannot set the flag.

GitOrigin-RevId: 7c31c1d831498ba012193579123ac87779b76b85
2026-11-25 16:07:45 +00:00
felixxia-oai d1e982d7eb Let Guardian V3 review actions while evidence routing is pending (#63941)
## Why

Guardian V3 approval reviews waited for the housekeeper to catch up on
conversation history before they could start. Slow evidence routing could
delay an action review, and a routing failure could prevent a verdict.

## What changed

Each review attempt, including retries, drains the reviewer's available
inbox when it reserves the reviewer. The housekeeper flushes and routes
history independently in response to thread activity.

## Testing

Cover reviews that start with an empty board or while evidence routing
resumes after a root thread reload. Verify that a revocation published
during an in-flight verdict is available to a subsequent review.

GitOrigin-RevId: f84f424b57538fa9562d8f4d47e38ce7a0a84dcd
2026-11-25 15:37:35 +00:00
felixxia-oai 34fcbc8caf Keep Guardian V3 verdicts valid across unrelated context updates (#63940)
## Why

An unrelated thread goal update could invalidate a pending Guardian V3
approval and trigger a second assessment even though the update never
reached the attached reviewer.

## What changed

Let attached Guardian V3 reviewers finish with the evidence admitted for
the current attempt. Later evidence can inform subsequent reviews. Keep
the cancellation, deadline, and root history checks for attached verdicts.

## Testing

Update the app-server regression test to change the thread goal while
an MCP approval is pending and verify that the original approval stands
after a single assessment.

GitOrigin-RevId: 6e7ffad243c7c59f0f97bdbe555886ff58531835
2026-11-25 15:36:14 +00:00
Dylan Hurd e8fb104cd6 Make the context spill threshold configurable for MCP hooks (#63922)
## Why

MCP hooks could only use the default spill threshold. Hooks that return
larger context, such as a session-start memory hook, need a way to keep
more of that context inline.

## What changed

Allow `mcp_tool` hooks to set `additionalContextLimit` for events that
can emit `additionalContext`. Plaintext context spills to disk above
approximately 2,500 tokens by default. MCP hooks can set a threshold
from 1 to 10,000 tokens. A value of 0 or above 10,000 warns and uses
10,000. Hook trust hashes use the effective threshold.

Expose the setting in app-server configuration requirements and hook
list responses.

## Testing

Cover limit normalization, warnings, trust hashes, and app-server
reporting. Verify that a bundled memory hook with a higher threshold
injects its full context at startup and after compaction.

GitOrigin-RevId: 318704ac1532267b3eb2f138f130b6799863a5c0
2026-11-25 14:03:11 +00:00
Eddie Chen 1ed2a3f22d Record root turn IDs in Guardian review analytics (#63837)
## Why

The review's `turn_id` alone can't identify the root turn of the action
being reviewed. For example, a background terminal can request network
access during a later turn.

## What changed

Add an optional `root_turn_id` to `codex_guardian_review` events. When
a verified execution tag ties a network request to a registered tool
call, use the root turn ID captured when the call started. Leave the
field unset when the reviewed action's root turn is unknown.

## Testing

Extend the MCP approval test to check the reported root turn ID. Cover
untagged network requests and verify that a cross-turn network review
reports the active turn's `turn_id` alongside the issuing turn's
`root_turn_id`.

GitOrigin-RevId: f0ae40ec4fc441891b4d843912f823a2385fa36f
2026-11-25 06:19:21 +00:00
Jackson Moody e2c31f625a Use ChatGPT account preferences for Codex voice chat (#63810)
## Why

Codex stored voice selections in `realtime.voice` and supplied voice overrides when starting realtime sessions. Reading and saving the ChatGPT account preference lets Codex use the same voice selection as ChatGPT.

## What changed

- Add experimental `account/voiceSettings/read` and `account/voiceSettings/write` methods. The terminal voice picker shows the selected voice and available display names, then saves the chosen voice ID to the connected app server's ChatGPT account, including when the server is remote.
- Require ChatGPT sign-in for terminal voice chat and create its WebRTC calls through the ChatGPT backend.
- Remove voice overrides from realtime session startup. Existing `realtime.voice` entries still parse but are ignored.

## Testing

Cover voice picker loading and saving, remote catalog failures, the ChatGPT sign-in requirement for local calls, and omission of voice overrides from realtime call payloads.

GitOrigin-RevId: 9e6f30b8020c47701d3c1604075063924f191685
2026-11-25 02:31:54 +00:00
jamy-OAI 986a6b3b11 Preserve the saved Daybreak choice across live goal continuations (#63809)
## Why

Automatic goal continuations could lose the thread's saved Daybreak
choice, even when the thread was enrolled in Daybreak propagation.

## What changed

Capture the saved choice when an externally created live goal first
becomes active. For goals created by a tool, carry forward the
originating turn's choice and preserve explicit access program
overrides.

Keep the captured choice in memory for the life of the goal and check
it against the current account and model on continuation. Changing
the thread's Daybreak setting takes effect for new goals.

## Testing

Add coverage for enrolled and opted-out threads, including blocking
a goal when the model lacks Daybreak support and starting a new goal
after turning Daybreak off. Also cover account changes and isolation
from foreground turns.

GitOrigin-RevId: 0baf08f06baf267595cb5a2b3b1fe033db52ad06
2026-11-25 02:31:14 +00:00
smurching-oai 07963a34f2 Discover model catalogs from HTTPS gateways (#63807)
## Why

A custom gateway can serve a Codex model catalog at its existing
`/models` route. Requiring a separate `model_catalog_url` leaves that
catalog undiscovered when only `base_url` is configured.

## What changed

Probe `/models` automatically for custom providers with a query-free
HTTPS base URL and no explicit catalog URL. Use a valid Codex catalog
as the model picker inventory. If discovery fails, keep the picker
usable with an available catalog or the bundled models. Gateway login
and token refresh errors still propagate.

## Testing

Add HTTPS app-server tests that verify the authenticated
`/v1/models` request, picker population from a Codex catalog, and
fallback to bundled models for a generic OpenAI model list or a
`403` response.

GitOrigin-RevId: 654095be1c221d79d932acde8b7289bc4cad0437
2026-11-25 02:29:04 +00:00
arnavpatidar-OAI b8e2d0cdef Reuse configuration server OAuth discovery across startup reads (#63781)
## Why

The one-shot startup flow uses separate invocations to check requirements,
sign in, and reload policy. Each invocation can repeat OAuth discovery.

## What changed

Accept `configRequirements/read` in `codex app-server --startup-oauth`
with the same validation and errors as `--print-startup-config`. Successful
responses include `appServerVersion`.

When the read reports `configServerLogin`, clients can sign in and retry
the read over the same stdio connection. The retry reloads policy with the
saved credentials and reuses OAuth discovery while the configuration server
and proxy settings still match.

GitOrigin-RevId: b5342cead5ebb9f2e0692061bf4b6ef933dc8cdd
2026-11-25 00:44:23 +00:00
eagle-oai 5505daf388 Preserve Daybreak selection across automatic goal continuations (#63774)
## What changed

For enrolled threads with Daybreak propagation enabled, carry the
creating turn's explicit access program into automatic continuations
of the same model-created goal. Reuse it only while the account, model,
and provider still match. Editing the objective preserves the selection,
and clearing the goal discards it.

## Testing

App-server regression tests check that automatic continuations honor
enrollment even after an objective edit, that explicit requests retain
their selection regardless of enrollment, and that a replacement goal
created after clearing starts without the previous goal's selection.

GitOrigin-RevId: 346742f6587f14867b1acc9c570383d1fa405d17
2026-11-25 00:11:12 +00:00
Dmitriy Kovalenko 17b00277cc Make Bazel Rust tests portable across Linux environments (#63773)
## Why

Some test fixtures depend on `python3` being on the host's `PATH` or
on reading Rust's process arguments from a constructor. Bazel workers
need a declared Python runtime, and musl does not provide those
arguments to constructors.

## What changed

- Put Bazel's Python 3.12 runtime on `PATH` for Linux test suites that
  invoke `python3`, including their Wine launchers.
- Use standalone helper binaries for exec-server and sandbox fixtures on
  musl, and read `/proc/self/cmdline` for the MCP hook fixture.
- Add launcher options for test execution tags and for routing selected
  Linux cases to a local companion target that shares the test binary.
- Adjust test fixtures for platform differences in file creation
  timestamps and shell script execution. Keep cloud-config error tests
  pointed at their mock server after startup falls back to defaults.

## Testing

Exercise marketplace upgrade negotiation at Git 2.20 and check whether
the installed Git supports limiting the refs advertised by the clone.

GitOrigin-RevId: 3a83cde954d52ca29d346d67488c9a25c0790614
2026-11-24 23:57:49 +00:00
RJ e1492bd86d Include parent evidence in recorded Guardian reviews (#63770)
## Why

An archived worker's transcript can omit the original user instructions and
assistant context that Guardian needs to assess a recorded tool call.

## What changed

Let clients supply optional `rootEvidence` to experimental
`thread/guardianReview` on an idle, ephemeral non-subagent thread. Guardian
reviews the ordered parent messages and omission flags alongside the worker
history loaded through `thread/inject_items`. The parent evidence stays out
of the worker history, and `usedRootEvidence: true` confirms that the review
used it.

Guardian can reuse reviewer history when the evidence is unchanged. Changing
or omitting the evidence resets that history.

## Testing

Add an app-server integration test covering rejection on persisted threads,
reviewer history reuse and reset, and review without executing the tool call.

GitOrigin-RevId: a4e78d770af5ad29864cb745b2e31f0fc921f213
2026-11-24 23:56:17 +00:00
Brandon Zhang ff146c344d Support structured dynamic tool results in Code Mode (#63766)
## Why

Dynamic tool clients could return JSON as text in `contentItems`, so Code Mode scripts had to parse that text to access fields in the result.

## What changed

App server dynamic tool requests advertise `supportedResultFormat: "structuredContent"`. Clients can reply with `structuredContent` and a `success` flag, report a failure with `errorMessage` and `success: false`, or continue using `contentItems`.

Code Mode exposes structured replies as MCP-style tool results, with the original JSON under `structuredContent` and failure status in `isError`. Completed tool items include a text representation of the reply. Matching post-tool-use hooks can receive the structured result for successful calls.

## Testing

Add protocol tests for the wire formats and rejection of ambiguous replies, plus an app server integration test that exercises structured results, content items, and errors through Code Mode.

GitOrigin-RevId: d63152633b43bd5bd236f6e0dcb41ee7e98e7947
2026-11-24 23:38:37 +00:00
Brent Traut 9202c7916b Search inline link labels in user messages (#63758)
## Why

Searching raw user messages can return hits from Markdown link destinations
that readers never see in the link label.

## What changed

Use inline Markdown link labels for user-message matches and snippets while
preserving surrounding whitespace and code blocks. Keep literal text for
messages with byte-ranged inline elements.

Reject cursors that counted raw-text matches because hidden URL hits could
shift the index and cause pagination to skip a visible match.

## Testing

Extend the thread search integration test to check match offsets, snippet
formatting, pagination, and rejection of a raw-text cursor.

GitOrigin-RevId: 19af5ab4aa16933e83b4eb2cb15e57cc92597b6b
2026-11-24 22:46:22 +00:00
Adam Perry @ OpenAI 9a3c131eb4 Deduplicate model catalog strings in memory (#63735)
## Why

Identical instructions and tool descriptions can appear in multiple
model catalog records. Each decode or clone previously allocated its own
copy of that text.

## What changed

Use `CodexCachedStr` for catalog instructions, messages, and tool
overrides. It stores short strings inline and interns longer strings so
independent decodes and clones can share storage. Resolved incremental
tool messages also reuse cached text from overrides and bundled defaults.
JSON and generated TypeScript still represent these values as strings.

## Testing

Add tests for shared storage across catalog fields, independent decodes,
clones, and incremental tool defaults. Cover plain JSON string round
trips and borrowed access to short inline UTF-8 strings.

GitOrigin-RevId: 6f53b4e19f01f6ed52a8fd364279b924cf794be2
2026-11-24 20:21:47 +00:00
ioanbudea-OAI 77acaa207f Keep rejected audio file IDs out of protocol events (#63667)
## Why

Codex needs rejected audio file IDs when reconstructing a session so
later model requests can omit those attachments. Clients only need the
turn error.

## What changed

Store rejected audio file IDs as rollout metadata and restore them from
that metadata when replaying history. Keep the existing JSONL layout
under `error.rejected_audio_file_ids` so older versions can still read
newly written rollouts.

## Testing

Add a regression test that round-trips a legacy rollout entry and
verifies that serializing the protocol event omits the rejected IDs.

GitOrigin-RevId: 982dd85d0037cebee056caf61d70988762e42767
2026-11-24 16:14:00 +00:00
Charlie Marsh 3e6daebb48 Avoid model lookups for thread metadata and goal updates (#63655)
## Why

A slow model lookup can delay thread metadata reads and goal updates even
though both operations have the settings and data they need locally.

## What changed

Use locally configured settings for app-server thread reads, enrichment,
and direct-input checks. The effective configuration snapshot still
validates the service tier against the selected model.

Record goal updates and emit their raw response events using an internal
submission ID without constructing a turn context.

## Testing

Add a regression test that gates model lookup and checks that the local
snapshot and goal recording complete without requesting model info. It
also checks that the goal event matches the history item and that the
effective snapshot filters out an unsupported service tier.

GitOrigin-RevId: 7d008edd775ae459a1fd1e3db79f38f2d9b5ca30
2026-11-24 14:52:00 +00:00
swastik-oai 53fe98bdc2 Accept an explicit tool call in Guardian review requests (#63654)
## Why

Selecting the final item in an idle thread's history ties Guardian review
to what was recorded. For example, a client may record an `exec` script
and need an assessment of an individual `exec_command` from that script.

## What changed

Require `toolCall` in the experimental `thread/guardianReview` request.
Guardian assesses the supplied `function_call` or `custom_tool_call`
against the idle thread's full history without appending or executing it.

## Testing

Cover rejection of requests missing `toolCall` and verify that Guardian
sees the recorded script alongside each command submitted for review.
Check that only the original script call is persisted in the thread.

GitOrigin-RevId: a1ce61e10e98107b38db60071dd63f189ef33ad1
2026-11-24 14:35:46 +00:00
jif 75df5098a6 Route in-memory message board notifications through app-server (#63641)
## Why

The SQLite message board can queue native agent mail through app-server.
In-memory boards previously relied on the host's notification callback
for delivery.

## What changed

Add `launch_in_memory_with_app_server` so runners can opt into the same
bounded, queue-only delivery as SQLite via `thread/inject_items`. The
host still resolves agent membership, and the shared notification client
queues post previews without starting a turn.

## Testing

Extend the app-server integration test to check that, after an
app-server restart, a post from each backend reaches an idle worker
exactly once on its next turn. The test also checks that app-server
delivery bypasses the in-memory host's notification callback.

GitOrigin-RevId: fc01b5e3f43dcfca5f43366f0b184c41dc07f9eb
2026-11-24 13:50:12 +00:00
jif a0d5b0a661 Let idle child threads unload while the message board is connected (#63621)
## Why

The message board connects to the app server to inject messages. Automatically subscribing it to new threads keeps idle child threads loaded after their last other subscriber leaves.

## What changed

Skip automatic subscriptions to newly created threads for clients that initialize with the shared `codex_message_board` client name.

## Testing

Add a WebSocket regression test that unsubscribes the parent thread's client from a completed child thread, checks for `thread/closed`, and confirms through the original message board connection that only the parent remains loaded.

GitOrigin-RevId: 73af9e370b90c59f984c4bc804140febb0308d9b
2026-11-24 11:57:55 +00:00
JonLuca De Caro abc92e6bd4 Report per-server MCP startup durations (#63613)
## Why

Required MCP servers can finish at different times even when their startup
notifications arrive together. Notification arrival times cannot show how long
each server took to start.

## What changed

Measure each startup attempt and expose its elapsed milliseconds as
`durationMs` on `ready` and `failed` updates from
`mcpServer/startupStatus/updated`. Successful Codex Apps reconnects report
their own duration. Reused connections, `starting`, and `cancelled` updates
carry `null`. The protocol accepts notifications from older servers that omit
the field.

## Testing

Cover distinct durations for fast and slow required servers, timing through
lease registration for newly opened shared connections, and a fresh duration
after Codex Apps recovery.

GitOrigin-RevId: 39c0c418149dd2b220828be04d998085f57acf2d
2026-11-24 11:05:19 +00:00
jif c3186b5d95 Test thread previews through the app-server rollout path (#63603)
## Why

The existing preview test exercised a summary extractor used only in
tests, leaving the app-server rollout preview path without that check.

## What changed

Remove the test-only summary extractor and test
`preview_from_rollout_items` directly. Verify that the preview skips
`AGENTS.md` instructions and strips the preceding context to return
`Count to 5`.

GitOrigin-RevId: 123f0db2807cd2d95d85b3f99da9152f24cd50ff
2026-11-24 10:33:10 +00:00
verma-oai 37aeac06b3 Add opt-in deferred image generation in code mode (#63594)
## What changed

Add `features.defer_image_generation` so code mode can discover the image
generation tool through `ALL_TOOLS` without including its definition in
the initial model request. Direct exposure remains the default and
applies when `image_gen` is excluded from code mode.

## Testing

Update the app-server GIF edit test to discover and invoke the deferred
tool through code mode. Verify that the initial request omits the tool
definition, the discovered definition includes the GIF option, and the
edit preserves animation and API defaults.

GitOrigin-RevId: 899f689bae0b86099a0ca3736d1cd2576bc3a7a9
2026-11-24 09:52:16 +00:00
jif d4b84f9bb0 Remove legacy thread summary test helpers from the app server (#63593)
## What changed

Delete the test-only helpers for converting state database metadata into
a `Thread`, along with the unit test that checked whether those helpers
preserved subagent nicknames and roles.

GitOrigin-RevId: 0218372fd82f9efd4d79a1a44f662d781bc5df5a
2026-11-24 09:49:12 +00:00
Dylan Hurd 74f208237b Avoid exec-server port races in selected capability tests (#63588)
## Why

Releasing the fixture's loopback port before starting `exec-server`
lets another process claim it before the server binds.

## What changed

Keep the configured endpoint bound without serving WebSocket handshakes,
so it stays unavailable even across app-server restarts. Let each live
`exec-server` bind an ephemeral port and use the URL it prints to update
the same environment ID via `environment/add`.

GitOrigin-RevId: eedfecee40b410b32b2d62774b0a46d1ef5575f6
2026-11-24 09:34:21 +00:00
marksteinbrick-oai baf9b39b16 Report workspace kind on TUI composer turns (#63545)
## Why

A TUI composer prompt does not supply `workspace_kind`. The app server
can derive it from the thread's current project assignment.

## What changed

Use the staged assignment until the thread is saved, then read the
persisted assignment on each new composer turn. Use `project` or
`projectless` as a fallback for model request metadata and turn analytics.
Explicit client metadata takes precedence, and the inferred value stays
with the originating turn.

## Testing

Cover the model request header and analytics event on the first turn,
on a follow-up, and after removing the project assignment. Unit tests
cover explicit metadata precedence and verify that MCP requests,
extensions, and child agents do not inherit the inferred value.

GitOrigin-RevId: 62b88484dd4028a6b72584999e0fa9b84e6e3b03
2026-11-24 05:33:38 +00:00
Brent Traut 6aaf2a86b1 Connect Codex Desktop MCP over Unix sockets (#63497)
## Why

An SSH forward can replace its Unix socket listener while the old
keep-alive connection remains open. Reusing that connection can leave
MCP requests waiting on the old listener.

## What changed

Route `codex-desktop://<uuid>` endpoints to the corresponding Unix socket
for local `codex_app` servers with explicit HTTP authorization. Allow
`http_headers_helper` to supply supplemental headers while preserving the
configured authorization. Socket requests bypass proxies, strip
`Proxy-Authorization`, and disable redirects.

Reuse pooled connections while the socket is unchanged and discard them
when the listener is replaced or the socket disappears.

## Testing

Add coverage for authenticated Desktop startup, rejection of helper-only
authorization and other server names, and reconnection after socket
replacement while the previous connection remains open.

GitOrigin-RevId: a38e55d8cd726299506b487d1223fe64bd856e80
2026-11-24 02:20:22 +00:00
Alex Ionescu e173e7b9b2 Verify signed remote plugin archives before extraction (#63489)
## Why

Remote plugin downloads need to check that the archive matches the digest
and signature supplied by the release before using its contents.

## What changed

Use the shared archive verifier for remote installs, installed-plugin
updates, shared plugin checkouts, and measurement reference downloads.
Fetch signing keys through the authenticated plugin service transport.
Reject malformed signing metadata and failed verification before extraction,
and continue accepting releases that omit signing metadata.

## Testing

Extend runtime authentication coverage to check that signing-key requests
include the product SKU header and that a prepared request fails after its
network policy is revoked.

GitOrigin-RevId: 27322921cd2778a3f06d1dee124dd8a5037c2f00
2026-11-24 01:28:15 +00:00
arnavpatidar-OAI 8bb8ed6bab Add gateway enrollment to local managed requirements (#63476)
## Why

Administrators who use one gateway for managed configuration and model
requests need to configure the gateway URL and OAuth settings in two
places. A single enrollment keeps those settings together.

## What changed

Accept `[gateway]` with a base URL and `[gateway.auth]` in system
`requirements.toml` or MDM. Use the same OAuth settings for the config
server at the gateway root and the required Responses API provider at
`/v1`, with model discovery at `/v1/models`.

MDM enrollment replaces system enrollment as a unit. Requirements
composition rejects remote enrollment, conflicting config server or
provider settings, and empty or reserved provider names.

## Testing

Add composition tests for MDM precedence, remote enrollment and
rerouting attempts, and invalid or conflicting enrollment settings.

GitOrigin-RevId: 35f04481dc2b592e25afa4ac9235481cd90cf915
2026-11-24 00:14:14 +00:00
vishnu-oai 83077214a4 Reuse config server discovery when loading managed policy (#63473)
## Why

CLI login and interactive TUI startup could look up the same config server's
OAuth metadata again when loading managed policy, even after resolving it
for sign-in.

## What changed

- Carry the resolved config server settings in memory from sign-in to policy
  loading and through TUI startup and worktree setup. Reuse them only when
  the configured server, outbound proxy policy, and system proxy fallback
  setting match.
- Rediscover anonymous servers after onboarding so the TUI can pick up a
  newly enabled OAuth requirement.
- Use discovered OAuth settings to classify app-server startup errors as
  config server errors when applicable.

## Testing

Add a regression test that blocks discovery requests and checks reuse for
matching OAuth and anonymous resolutions, as well as cache misses when the
server or either proxy setting changes.

GitOrigin-RevId: 28b5c8ffdb80db09dd8bbae3c1e187189ea393bf
2026-11-24 00:11:35 +00:00
Matthew Zeng d4af2452f7 Honor explicit plugin disablement without a global default (#63468)
## Why

Without `plugins._default`, the activation policy ignored a plugin's explicit `enabled = false`. The CLI also reported remote plugin enablement directly from the marketplace, so its output could disagree with the effective state.

## What changed

Apply per-plugin enablement before falling back to `plugins._default.enabled`. The `codex plugin list` command now applies that policy to remote plugins, so an installed plugin can appear as disabled while retaining its installation and account settings. Plugins disabled at their source stay disabled.

## Testing

Cover explicit disablement without a global default in config and remote plugin loading tests, and check that the CLI reports the plugin as installed and disabled in both JSON and table output.

GitOrigin-RevId: ab9f5a5b36150d7350c2d11a8421f9e14524a1ad
2026-11-23 23:39:54 +00:00
jif aae9db9f5f Test subagent metadata on stored thread conversions (#63422)
Remove the app server's test-only rollout summary reader and cover
subagent nicknames and roles through the conversions from `StoredThread`
to a thread and a summary. Keep the summary assertions for millisecond
timestamp precision.

GitOrigin-RevId: f7481fd3c2d4d332ee094a62ec7cad8997903cdb
2026-11-23 20:06:57 +00:00
jif 964fdd565e Remove the empty-preview rollout summary test (#63414)
## What changed

Delete the app-server unit test that reads a rollout containing only
session metadata and expects an empty preview when there is no user
message.

GitOrigin-RevId: fd033dec4e938b0352620ca76c448ae9e650493f
2026-11-23 19:13:12 +00:00
jif 9c7103216f Remove the app-server's test-only thread summary helper (#63408)
Delete `summary_from_thread_metadata` and the unit test that checks its
second-precision timestamp formatting.

GitOrigin-RevId: 917c0d28bb486c69baba8142ac84cc9057c6d5ee
2026-11-23 18:57:13 +00:00
ioanbudea-OAI 74efed3bf3 Apply current approvals reviewer policy after thread revert (#63390)
## Why

If Guardian policy changes while `thread/revert` is in progress, restoring
the saved effective reviewer can carry an outdated policy decision into
the replacement runtime.

## What changed

Resolve the saved reviewer request against the current Guardian policy
when the replacement runtime starts. Use the previous effective reviewer
as the request if no explicit request was saved.

## Testing

Extend the revert regression test to switch the reviewer allowlist from
`auto_review` to `user` after the settings snapshot and verify that the
replacement honors the original `user` request.

GitOrigin-RevId: a66fceb19e201b921d111f7a299c2be2c8a451ad
2026-11-23 18:00:50 +00:00
Charlie Marsh af81d2770f Avoid cloning turn history in thread/fork (#63382)
Move the turns into the fork response and clone only the thread metadata.
The `thread/started` notification already omits turns.

GitOrigin-RevId: 8ffcefa3b6ed0908b511a58b53d034674ee8b668
2026-11-23 17:13:13 +00:00
chess 113e0c6d5e Allow per-subagent service tiers in spawn_agent (#63376)
## Why

Subagents can inherit the root session's service tier or get one from their
role. A per-spawn override lets a caller choose a tier for an individual
child without changing those defaults.

## What changed

Enable the optional `service_tier` argument for v1 and v2 `spawn_agent`
with `multi_agent_v2.expose_spawn_agent_service_tier`. The setting is off by
default, and tool schemas expose the argument alongside model selection.

Omit the argument to use normal inheritance, pass `default` to request
the default tier, or specify a tier available for the child's model and
provider. Unavailable explicit tiers return a spawn error.

Persist the child's choice across eviction and reload. Parent, sibling,
and descendant agents continue to use their usual tier selection.

## Testing

Extend coverage for tier selection in model requests, rejection of
unadvertised Flex on Bedrock, and restoration after eviction without
passing the override to grandchildren.

GitOrigin-RevId: 2e9b92af44232b6a5682fe2cd97980f17cbb5d97
2026-11-23 16:52:47 +00:00
felixxia-oai 223b61a9a8 Refresh Guardian v3 evidence before retrying an approval review (#63363)
## Why

A user's authorization can change while Guardian is reviewing a tool call.
A retry could reuse the original evidence cutoff and miss a revocation
that arrived during the first attempt.

## What changed

Capture the root thread's history position when the action is bound and
defer evidence routing until Guardian prepares the review. Capture a fresh
position on retries or if authorization changed before the first attempt.
Use bounded history reads to catch up through the selected position and
wait for routing to reach it before submitting the assessment.

## Testing

Extend the app-server test to revoke authorization through a paused user
goal while an MCP tool call's approval is pending. Verify that Guardian
discards the stale allow, sees the revocation on retry, and denies the
tool call. Cover bounded history reads and shared routing progress in
unit tests.

GitOrigin-RevId: d7cf6f03412c4aa5399700427f40710da3123e52
2026-11-23 15:57:15 +00:00
jif c983e8d171 Deliver detached message board notices to native agents (#63354)
## Why

The detached SQLite message board could store posts but could not notify
the agents named in `agents_to_notify`.

## What changed

Add an optional `--app-server ws://127.0.0.1:PORT` flag to
`codex-message-board-mcp`. When configured, the board uses
`thread/inject_items` to queue notices in native agent mailboxes without
starting a turn. The board and app-server must share the same Codex
registry.

Delivery is best-effort. Posts stay stored if a notice fails, and the
next notice can reconnect without replaying the failed one.

## Testing

Cover concurrent requests, notice size limits, and reconnect after a
timeout without replay. Exercise the detached executable against a
restarted app-server and verify that a native child receives the queued
notice once when it resumes.

GitOrigin-RevId: 8b890b30df94590686d91921d814887eda5d9c9b
2026-11-23 15:13:44 +00:00
jif 790ecc338a Log probe results when Guardian V3 prepares a review (#63327)
## What changed

Carry the serving probe result from the tool step into the review context.
Include `tool_call_id` and `probe_review` in the Guardian V3 preparation
log so the result can be correlated with the tool call. Record the probe
as `required`, `not_required`, or `not_reported`. Approval decisions
continue to follow the review verdict.

## Testing

Extend the pending MCP action integration test to check the logged tool
call ID and probe status for all three cases while exercising the same
revocation and reapproval flow.

GitOrigin-RevId: 43cd3691ae20af29f690ee2697d3d46bcc3bd8ce
2026-11-23 12:36:40 +00:00
jif ca891cecdc Wake idle root threads on persisted agent messages (#63312)
## Why

Plaintext agent messages injected through `thread/inject_items` could
be saved to root-thread history without waking the thread, even when
agent-message wakes were enabled.

## What changed

After persisting a batch of plaintext agent messages with unspecified
retention, let the native multi-agent v2 root thread's mailbox scheduler
apply its usual wake and turn-admission rules. Use the recorded history
sequence to skip a wake if another turn already read the messages and
to deliver the mail directly from history without re-enqueueing it.

## Testing

Cover app-server injection with wakes enabled and disabled, wake a
reloaded sleeping root with its previous turn context, and verify that
a paused turn-admission gate defers the wake and the eventual model
request contains the message once.

GitOrigin-RevId: 5fde8062a179fd7a7919d240373592f2dbb4a389
2026-11-23 11:16:31 +00:00
Eric Traut a1604a8c05 Tag goal creation metrics with reasoning effort (#63281)
## Why

The `codex.goal.created` counter cannot distinguish goals created at
different reasoning efforts. A tool call can also run at a different
effort from the thread's default after a turn settings update.

## What changed

Add a `reasoning_effort` attribute to `codex.goal.created`. For goals
created by `create_goal`, read the effort from the invoking step's
metadata. For goals created outside a turn, use the thread's configured
effort or fall back to the model default. Label custom values `custom`
and unavailable values `unknown`.

## Testing

Extend the thread resume integration test to check that the exported
metric records `medium` for a goal set before the first turn and `high`
for a goal created by a tool after a turn settings update.

GitOrigin-RevId: 83b3c8c1073551b67453314eb559c5e648af3521
2026-11-23 07:45:08 +00:00
Charlie Marsh ae6c0c8ac1 Exclude per-item usage attribution by default (#63219)
## What changed

Add `usage.attribution` to the `x-codex-exclude` header for Responses HTTP
requests and WebSocket handshakes by default. Threads started with
`experimentalRawEvents` keep receiving per-item attribution in raw responses.
Subagents inherit the policy, and the app server restores it when a thread
resumes with an existing raw-event subscription.

## Testing

Cover the default exclusion, raw completion events with upstream usage,
subagent inheritance, and resuming a closed subagent after both its runtime
and its parent's runtime have unloaded.

GitOrigin-RevId: 0dad92f97606300907f1294f09dd7845d1e6476f
2026-11-23 01:06:41 +00:00
Won Park 8653ca9e99 Add an async user messaging opt-in for spawned subagents (#63069)
## Why

Async user messaging was limited to root agents. Spawned subagents need
their own opt-in so they can send messages without requiring the root
feature flag.

## What changed

Add independent `root_agent` and `subagents` settings under
`features.send_message_to_user_async`. For example, this opts spawned
subagents in and turns off the root feature flag:

```toml
[features.send_message_to_user_async]
root_agent = false
subagents = true
```

The existing boolean shorthand still sets the root feature flag, and the
model catalog can still enable the tool for the root agent. Config layer
merges, CLI overrides, and feature toggle edits preserve the separate
`subagents` setting when changing the root flag.

## Testing

Extend coverage for tool availability across root agents, spawned
subagents, and compaction helpers, and for preserving the subagent
setting when applying boolean overrides.

GitOrigin-RevId: 5f34f182bc107d32797143a58f0d79395767ed49
2026-11-22 01:25:05 +00:00
Eric Traut 58952e0c39 Enable concurrent reasoning summaries by default (#62903)
## What changed

Mark `concurrent_reasoning_summaries` as stable and enable it by default.
When requesting reasoning summaries from OpenAI, Codex now sets
`stream_options.reasoning_summary_delivery` to `sequential_cutoff` by
default.

## Testing

Exercise summary rendering with the default configuration and update
request assertions and snapshots to expect `sequential_cutoff`. Explicitly
disable the feature in tests that exercise legacy reasoning events.

GitOrigin-RevId: 04310fd271ced11c3a22e8ff6275a387c9c22fc2
2026-11-21 05:42:40 +00:00
Winston Howes 4739e94260 Add an opt-in indexed web search default (#62894)
## What changed

Add `features.web_search_indexed_default` to let restricted turns use
`indexed` search in place of the implicit `cached` default when the
provider and managed requirements allow it. Full-access turns still
prefer `live` search when allowed, and an explicit `indexed` selection
retains its existing precedence.

Forward the flag through the TUI and keep the default implicit when
launch overrides disable legacy search flags.

## Testing

Cover mode selection across permission profiles, explicit settings, and
managed requirements. Verify that the first model request advertises
indexed search and that permission changes take effect on the next turn.

GitOrigin-RevId: 08a6279c447c517c50b9e6a544ecdf681b81bf50
2026-11-21 04:05:41 +00:00
Alex Kira 619d36f810 Tag user reports with the latest reasoning removal status (#62883)
## What changed

Set the `cot_removed` tag from the latest completed sampling
request on the live thread. Use `true` for reported reasoning removals
and `false` for an explicitly empty report. Omit the tag when no report
is available and discard any caller-supplied value.

Clear the stored result when thread history is replaced. A resumed
session starts without a stored result.

## Testing

Cover tag values in saved reports across tool calls, compaction, and
session resume. Verify that failed compaction preserves the last
sampling result.

GitOrigin-RevId: f1568567a6b4a62685569478fc7194f4357cb605
2026-11-21 01:30:29 +00:00
viyatb-oai bb1037ba04 Compose managed domain rules across network config layers (#62882)
## Why

Managed requirements from different sources could not be combined when one
used `[permissions.network]` and another used `[network_proxy]` or
`[experimental_network]`.

## What changed

Allow these tables to compose across sources. The highest-priority list of
each kind replaces lower lists of that kind, while keyed `domains` entries
update individual selectors by source priority. A deny wins when a selector
appears in both surviving lists. A surviving `allowed_domains = []` clears
lower-priority grants, while an empty `domains` map contributes no updates.

Require mirrored domain declarations to agree on how they compose with other
domain sources. Unix socket path rules still require a single network table
spelling across sources.

Carry equivalent denied selector spellings into the effective proxy policy.
When local binding is disabled, an attached executor's explicit local grant
must also satisfy the controller's allowlist constraints. The standalone
proxy can still narrow a wildcard to an explicit local grant.

## Testing

Cover mixed table spellings, list replacement and clearing, conflicting
mirrors, equivalent IPv6 spellings, and local grants in standalone and
attached proxy modes.

GitOrigin-RevId: b3d550d9f462564c89663ea4b15e723f0ea76881
2026-11-21 01:28:12 +00:00