Commit Graph
12813 Commits
Author SHA1 Message Date
Felipe Coury a0436d69ff Make Command Center easier to navigate in the TUI workspace (#62990)
## Why

The docked Command Center has a fixed width, and mouse clicks can
focus the pane but cannot open a task. Moving between the task list
and the conversation should work with the workspace shortcuts.

## What changed

- Open or focus Command Center with `leader a` by default. Use the
  workspace pane shortcuts to move between Command Center and the
  conversation, with matching Agents bindings taking precedence in
  Command Center.
- Drag the divider to resize Command Center. Show each docked task's
  status and Git branch, when available, on a second line. Click either
  line to open the task, or click **Show more** to load older tasks.
- Animate the dock opening and closing.

## Testing

Extend the TUI tests to cover mouse activation and workspace keyboard
navigation, including preservation of the conversation draft and
reading position.

GitOrigin-RevId: e78aa4afb68e9971de51859221ce996b13750e13
2026-11-21 15:29:34 +00:00
Felipe Coury 1731314b3b Dock the Agent Command Center beside the conversation (#62986)
## Why

Opening the Agent Command Center in a modal interrupts the conversation
view. Docking it keeps the transcript and draft visible while browsing
tasks when the terminal has room for both panes.

## What changed

With `features.tui_workspace` enabled in owned transcript mode, the
Command Center opens to the left of the conversation on wide terminals.
On narrow terminals, the focused pane fills the screen. Opening a task
returns focus to the conversation and keeps the dock open. Other
transcript modes continue to use the modal Command Center.

## Testing

Add coverage for draft and reading-position preservation, wide and narrow
layouts, queued results arriving after a focus change, and selecting a
new session when its task appears in the dock.

GitOrigin-RevId: d07c9cad3bb8685167b5995e550c406948d7a6e3
2026-11-21 15:14:53 +00:00
rhan-oai 1145028ae4 Skip empty permissions messages in the initial context (#62933)
## Why

When the resolved permission and approval guidance is blank, the initial
context still includes a developer message containing only the permissions
wrapper.

## What changed

Omit that message when the guidance is empty or whitespace-only. Keep a
permissions checkpoint so later turns can report newly saved command
prefixes. Continue sending bundled approval guidance when it applies.

## Testing

Cover blank and bundled approval guidance and later command-prefix updates
with and without per-environment context. Update Guardian request snapshots
to reflect the omitted empty message.

GitOrigin-RevId: b1e2b6377733ec34b875b51d800922e15c267571
2026-11-21 08:39:16 +00:00
Adam Perry @ OpenAI 43d8b78241 Fix reasoning summary config lookup and request snapshot (#62932)
## What changed

Pass `None` for the resumed working directory when the TUI reads
effective reasoning summary settings, so the call matches the
`startup_config_cwd` signature.

Update the indexed search rollout snapshot to expect
`stream_options.reasoning_summary_delivery` set to `sequential_cutoff`.

GitOrigin-RevId: 66225aa15dcfe5da43b397a96a7da4b4712f0b55
2026-11-21 08:38:44 +00:00
Eric Traut 556901ba72 Forward TUI clipboard copies to Rex clients (#62931)
## Why

A client can attach to a Rex session after Codex starts. A successful
native clipboard write can update the host clipboard without reaching
the attached client.

## What changed

Use shared terminal detection to select OSC 52 forwarding in Rex, even
when native copying succeeds. Keep environment-based routing for tmux,
Herdr, and SSH. Use the same terminal detector to recognize VS Code for
keyboard handling, with the existing Windows probe as a fallback.

## Testing

Cover OSC 52 selection for Rex without SSH or tmux and verify that
forwarding runs after a successful native copy.

GitOrigin-RevId: 47db5868d87aaf2aeee9cdd59307aa1be532c11e
2026-11-21 08:37:40 +00:00
Eric Traut ddfaef91b2 Report HTTP MCP startup problems clearly in codex exec (#62906)
## Why

Low-level transport errors can clutter stderr and include endpoint
URLs with credentials. An optional HTTP MCP server can also still be
starting when its tools are omitted from a turn.

## What changed

- Warn once per Streamable HTTP connection when startup fails or the
  server is omitted from the turn because startup is still pending.
  Include the server name and a short reason without the raw transport
  error.
- Filter redundant MCP worker errors from default `codex exec` stderr
  and preserve caller control through `RUST_LOG`.
- Add server context to errors when startup blocks a tool call or
  resource operation, when a tool call finds a disconnected server,
  or when HTTP session recovery fails.

## Testing

Add regression coverage for startup warnings, credential omission,
explicit `RUST_LOG` diagnostics, and an optional server that becomes
ready in time to be included in the turn.

GitOrigin-RevId: 1fd012a5e73f205c3d8735adde395c36672c205c
2026-11-21 05:57:16 +00:00
Eric Traut f63f8b9bc6 Add a reasoning summary picker to /config (#62905)
## What changed

Choose Auto, Concise, Detailed, or None under Sessions in `/config`.
The picker saves `model_reasoning_summary` through the connected app server
for new chats. The panel shows the effective value and reports when a config
or launch setting overrides the saved choice.

## Testing

Add coverage for the picker and for saving Auto explicitly when the setting
was previously unset. Verify that the active chat keeps its setting and
that the panel reflects a profile override.

GitOrigin-RevId: cd027a6b16879a656b8d8b21488f0588c98f9077
2026-11-21 05:56:42 +00:00
Eric Traut 553c7f8ea6 Use automatic reasoning summaries by default in the TUI (#62904)
## Why

The TUI left the reasoning summary unset on turn submission, so OpenAI
requests could use `concise` even when the user had chosen no summary
setting. Embedded WebSocket prewarming and the first turn need to use
the same summary setting to reuse the warmup response.

## What changed

- Send the configured `model_reasoning_summary` with TUI turns, defaulting
  to `auto` for OpenAI providers. Use the same fallback when prewarming
  through the in-process app server.
- Read reasoning summary settings and custom provider definitions from
  the app server's effective config while honoring explicit launch
  settings. When resuming a remote session, use its working directory
  for the config lookup unless a remote directory override is set.

## Testing

Cover summary defaults and explicit settings in Responses requests,
and verify that the first embedded WebSocket turn uses `auto` and
reuses the warmup response.

GitOrigin-RevId: 1a2edfa44abdd031691a0d421eba077b0796ebe1
2026-11-21 05:55:23 +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
cassirer-openai db72403243 Distinguish conversation item IDs from Responses IDs in traces (#62898)
## Why

The rollout trace reducer assigns ordinal IDs to reduced transcript nodes
and uses Responses item IDs to match wire items to those nodes. Using
strings for both lets callers mix up the two kinds of IDs.

## What changed

Make `ConversationItemId` a Rust newtype for transcript nodes and use
`ResponseItemId` for receipt and agent delivery lookups. Carry the typed
transcript IDs through snapshot reconciliation, compaction, and links to
tool calls, code cells, and agent interactions. Continue serializing
transcript IDs as strings such as `conversation_item:9`.

GitOrigin-RevId: 28a36266bc88e1cbc036d99a90b3f88e6966d328
2026-11-21 04:35:37 +00:00
Dylan Hurd e3a398d3e4 Allow model catalogs to set initial collaboration guidance (#62896)
## Why

Model catalogs could provide guidance for Plan and for Default after Plan,
but had no field for the turns before the first Plan turn.

## What changed

Add optional `collaboration_modes.initial` guidance. Codex uses it in
Default before the first Plan turn when the field is nonempty and no
caller-supplied instructions take precedence.

## Testing

Add a request snapshot test that covers initial guidance on a new thread,
retains it after resume, and verifies the switch to Plan guidance and then
to Default guidance when leaving Plan.

GitOrigin-RevId: bb9e83aeb60af54fc2ee1bf9ce5acbb8a354ffb8
2026-11-21 04:18:31 +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
thomas bfe3c82570 Broaden legacy fallback for MCP discovery over HTTP (#62893)
## Why

Legacy MCP servers can reject `server/discover` before JSON-RPC dispatch
because they require a session ID or reject the requested protocol version.
Their HTTP 400 response can be empty or lack a matching JSON-RPC request ID,
leaving Codex unable to start the legacy handshake.

## What changed

Retry with a sessionless `initialize` when the initial sessionless
`server/discover` receives HTTP 400 without an authentication challenge or
a JSON-RPC error code that requires validation. Preserve fallback for
recognized legacy rejections and give structured protocol version offers
precedence over error text. Once a server offers a modern version, surface
a rejected follow-up probe as a discovery failure.

## Testing

Extend mock-server coverage to verify that legacy fallback establishes a
fresh session and uses it for `tools/list`. Cover authentication challenges,
malformed and uncorrelated JSON-RPC errors, and failures after a modern
version offer.

GitOrigin-RevId: edc573e38c63b837462f1b8d84e2d8abdf62cb3e
2026-11-21 03:51:15 +00:00
Sebastian Ingino 63a15005de Avoid temporary JSON buffers when sizing executed tool call metadata (#62889)
## Why

The metadata budget check only needs the serialized byte count.
Using `serde_json::to_vec` allocated a buffer for JSON that was
immediately discarded.

## What changed

Use `serialized_json_bytes` to count the JSON bytes for the executed tool
call list and its accompanying metadata fields. Keep the existing wire
size accounting and serialization error fallback.

GitOrigin-RevId: 1767507eeb52677439e7fce1cbaa24dbec913024
2026-11-21 03:27:56 +00:00
cassirer-openai 8a1a476659 Use a shared ToolCallId for dispatched tool invocations (#62888)
## Why

Dispatched invocations, model-visible Responses calls, and Code Mode's
per-cell runtime calls use IDs with different roles. A dedicated Rust type
makes the dispatch identity explicit in APIs that carry it.

## What changed

Add `codex-tool-call-id` and use its `ToolCallId` across core tool dispatch,
nested Code Mode calls, and rollout tracing. The type wraps a string and
continues to serialize as a string.

GitOrigin-RevId: 119de57a9af840c4de72895adc9acdd0ed15b4fd
2026-11-21 03:14:33 +00:00
Winston Howes 7edf91b13c Track explicit web search modes and expose indexed in the SDK (#62884)
## What changed

Record whether an explicit `web_search` setting matches the effective
mode after applying configuration requirements. Mark the thread manager
sample's disabled mode as explicit.

Accept `indexed` in the TypeScript SDK's `WebSearchMode` type.

## Testing

Extend the SDK test to verify that both `cached` and `indexed` are passed
to `codex exec` as `web_search` config overrides.

GitOrigin-RevId: 0cf98c9a32f4da31fecc50da71acb601f6043b47
2026-11-21 01:40:15 +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
Ned Howley 566020b724 Allow new threads to opt out of Daybreak propagation (#62879)
## Why

App-server clients that prepare threads for later use need to be able
to skip Daybreak propagation for an individual thread when the server
configuration enables it.

## What changed

With `experimentalApi`, pass `daybreakProgramPropagationEnrolled: false`
to `thread/start` to opt a new root thread out. Managed requirements
take precedence. Omitting the field or passing `null` or `true` uses the
configured enrollment rule.

The same field on `Thread` reports actual enrollment for the live
session, including in the start response and `thread/started`
notification. Reusing a live session preserves its enrollment. A thread
returned from stored metadata alone reports `null`, and resuming it
from storage in a new session reports `false`.

## Testing

App-server tests cover enrollment under enabled, required, and disabled
configuration, as well as reporting across live reads and resumes,
unload, and resume from storage. A core test checks that opting out
prevents native helpers from inheriting the root's saved Daybreak choice.

GitOrigin-RevId: f9aae9ff76702b1e5a38d45120cd889a26f8ece5
2026-11-21 01:14:17 +00:00
Jay Chen 66618f0512 Prewarm MCP servers during cloud catalog refresh (#62876)
## Why

A slow cloud skill lookup can delay MCP startup even after the plugin
catalog is ready. If the refresh is canceled while waiting for skills,
it can miss the chance to prewarm those servers before the first turn.

## What changed

Queue MCP prewarm as soon as plugin discovery changes or clears the
catalog. Skill discovery alone leaves the MCP server set unchanged.

At the end of the refresh, queue a retry for eligible MCP startup
failures. If discovery is canceled, check for those failures the next
time the catalog lock is acquired. Reuse pending handshakes and leave
authentication failures and Apps-managed reconnects to their existing
recovery paths.

## Testing

Add regression tests for first-turn tool availability after cancellation,
startup recovery with cloud plugins disabled, and a single retry for a
persistent startup failure.

GitOrigin-RevId: f92162d1629358953d8810d20244e55f07416a01
2026-11-21 00:54:05 +00:00
Sidharth Lakshmanan 0bfb8467da Preserve per-image metadata in app-server image generation items (#62871)
## Why

App-server clients lose metadata supplied by the image backend when
Codex turns the response into a completed image generation item.

## What changed

Expose the backend's `image_metadata` as optional `imageMetadata` in
app-server items and preserve nested values through thread persistence,
resume, and legacy history replay and migration. Keep this metadata out
of model tool output.

Omit empty metadata and discard non-object, oversized, or deeply nested
metadata without dropping the generated image.

## Testing

Extend coverage for per-image parsing, metadata limits, and round trips
through app-server completion, persisted history, and thread resume.

GitOrigin-RevId: 7211a9db1149cb05e6176b08b0462ca173ac72d5
2026-11-21 00:23:59 +00:00
cooper-oai e346540867 Use runtime authentication for TUI WebRTC calls (#62870)
## Why

The TUI creates WebRTC calls locally, and that request path did not use
runtime agent authentication even when runtime agent instances were enabled.

## What changed

- Reuse local credential and runtime managers across calls while the login
  configuration stays the same. Reload first-party credentials before
  creating a call and keep network policy under the primary account owner's
  control.
- Use the shared provider request resolver for call authentication and HTTP
  transport. Apply the WebRTC base URL override before resolving credentials
  so runtime authentication is selected for the actual destination.

## Testing

Add mock-server coverage for concurrent calls sharing a runtime with fresh
assertions, credential changes, and both dual-header and assertion-only
modes. Cover the feature toggle, custom call destinations, network policy
permits, and provider credentials when the local login file is malformed.

GitOrigin-RevId: 6503b3375c79d3126911d1d7c1aea898face37b9
2026-11-21 00:20:14 +00:00
arnavpatidar-OAI cf8992e940 Enable configuration server OAuth during app-server startup (#62867)
## Why

When an organization's configuration server requires a new OAuth grant,
clients need a way to sign in before the app server starts so they can
load and validate the required settings.

## What changed

- Have `--print-startup-config` return the `configServerLogin` action
  when browser sign-in is required, and verify that the required server
  settings were applied before returning startup requirements.
- Add `codex app-server --startup-oauth`, a dedicated stdio mode that
  resolves the configuration server from local managed requirements,
  sends the client a browser authorization URL, and handles the callback,
  token exchange, and credential storage. Clients can cancel a pending
  sign-in or rerun `--print-startup-config` after it succeeds.

## Testing

Add a test that checks the browser handoff URL and verifies that
cancellation completes the pending login request with `LoginFailed`.

GitOrigin-RevId: 00f10d28befe33539882f4f3c0d2baf868ceb4a1
2026-11-21 00:03:42 +00:00
chess f342aa7b92 Defer Windows sandbox owner restoration until sign-in (#62865)
## Why

At boot, the recorded Windows session may no longer exist or may not
have a user token yet. The sandbox service can retry restoration when a
session change signals sign-in.

## What changed

Treat missing sessions, missing tokens, and sessions belonging to
another user as owner unavailability. Search the other sessions for the
recorded owner's SID. If no session restores the owner, report the first
restoration error if one occurred, or let the service retry on a later
session change.

GitOrigin-RevId: c40971e70c6eee46068aafe534c0f0147d16bb77
2026-11-20 23:45:24 +00:00
rhan-oai 663358f98d Keep agent concurrency guidance when native tools are disabled (#62864)
## Why

Disabling native multi-agent tools also dropped the default guidance about
how many agents can be active in a session. That limit still matters for
agents running on a host that handles turn admission.

## What changed

When `multi_agent_v2.disable_native_tools` is set, root agents and
subagents receive only the configured
`multi_agent_v2.max_concurrent_threads_per_session` in their default role
guidance. Explicit role overrides retain precedence, and empty role text
still suppresses the guidance.

## Testing

Cover both roles with bundled and catalog-provided role text. Update the
request snapshots for explicit and proactive delegation to show the
concurrency hint with native tools hidden.

GitOrigin-RevId: e940e7a7886b69888002307c021607b19bb87cd0
2026-11-20 23:44:47 +00:00
Charlie Marsh 8ecb4c9d0f Ask the Responses API to omit the echoed tool catalog (#62863)
Set `x-codex-exclude: tools` in the shared Responses API request headers.

GitOrigin-RevId: 6d46bf95fd1b88a4e01e7d0d3b3d995b4a3f6545
2026-11-20 23:43:31 +00:00
arnavpatidar-OAI b392250f48 Define the startup OAuth protocol for config servers (#62859)
## What changed

Add the optional `target` field to `account/gatewayOAuth/login`.
The startup protocol defines `{"kind":"configServer"}` as a target
for `--startup-oauth`, mutually exclusive with `modelProvider`.
The regular app-server login handler rejects explicit targets.

Define `StartupGatewayOAuthChangedNotification` with the target,
status, and authorization URL for the browser handoff. Export the
new types in the JSON schemas, TypeScript bindings, and Python SDK.

## Testing

Update the TUI device login regression test to expect `target: null`
when signing in to a resumed thread's saved gateway.

GitOrigin-RevId: fb3ce66a143cad9ad56c93f3ac37f8b6f1abdb0e
2026-11-20 23:24:10 +00:00
Benjamin Carlsson beac2ef8fc Keep Cloud threads current in the Agents overview (#62858)
## Why

The Agents overview can go stale when Cloud threads change from another
client, especially when the TUI has no conversation stream attached.

## What changed

- Use Cloud stream notifications to update thread status and refresh the
  thread list. Poll every 10 seconds while the overview is visible and
  no stream is attached.
- Refresh the history already shown while preserving the `Show more`
  cursor. Use fresh list metadata for thread names, recency, and unread
  state, and restore rows when a refresh catches a missed unarchive.

## Testing

Cover Cloud inventory notifications, polling while detached, pagination
across refreshes, and recovery from a missed unarchive.

GitOrigin-RevId: 63c98438b6ddd2e47dd2d1f419c2a676508c6d91
2026-11-20 23:23:32 +00:00
Dylan Hurd 941e1dcade Defer built-in Default mode instructions until after Plan mode (#62857)
## Why

Threads that stay in Default mode carry a collaboration-mode prompt even
though they have no Plan mode instructions to supersede.

## What changed

Omit bundled and model-catalog Default mode instructions until a thread
uses Plan mode. Emit Plan mode instructions on entry and Default mode
instructions when switching back. Preserve eligible caller-provided
instructions and carry the active mode through compaction and resume.

## Testing

Cover prompt contents before, during, and after Plan mode in core and
app-server tests, including compaction and resume in the core tests.

GitOrigin-RevId: b734767da15be53c4eccae71994e46eba63a9ecc
2026-11-20 23:12:16 +00:00
Charlie Marsh 548dd628df Specialize OpenTelemetry providers for HTTP traces and metrics (#62854)
## Why

The code-mode host exports traces over OTLP/HTTP, and the elevated Windows
Filtering Platform setup helper exports Statsig metrics. Both used the
general-purpose provider, which made exporter builders for unused signals
and transports reachable from those binaries.

## What changed

Add `OtelProvider::try_new_http_traces` for the code-mode host and
`OtelProvider::try_new_http_metrics` for the Windows setup helper. Select
exporter builders at compile time so each constructor reaches only the
builders it needs. Both constructors reject unsupported signals and gRPC
configuration. The metrics constructor also accepts Statsig.

## Testing

Add unit tests for unsupported signals and gRPC configuration. Exercise
the specialized constructors in the HTTP loopback tests for trace delivery
on a current-thread Tokio runtime and cumulative metrics export.

GitOrigin-RevId: 875916791f0176839764c51b5ab289d5dc45a4d2
2026-11-20 22:39:52 +00:00
Charlie Marsh 63598243af Limit guardian response resampling to one retry (#62852)
## Why

When the retried response also meets the guardian's resampling criteria,
it can trigger another model request and keep the turn from finishing.

## What changed

Consume the original prompt when scheduling the retry. The second
verdict stays buffered until completion and is replayed after usage
accounting, even if it also meets the resampling criteria. Usage from
the discarded first response still counts toward spending.

GitOrigin-RevId: f8ded8f31bd7d9e440c0c92a92a80480acec61d2
2026-11-20 22:24:30 +00:00
Dmitriy Kovalenko 4c153c26c0 Reduce allocations when preparing tool schemas and catalogs (#62849)
## Why

Tool schema budget checks cloned the schema and allocated a JSON buffer
just to measure its size. Building a Responses Lite catalog also cloned
tool definitions before serializing them.

## What changed

- Deserialize schemas from borrowed JSON during compaction, count
  serialized bytes without allocating a buffer, and reuse the parsed
  schema when it fits the budget.
- Serialize borrowed tool specs and namespace members directly, and pass
  filtered specs as an iterator. Preserve the serialized namespace field
  order because the bytes contribute to the `additional_tools` item ID.

## Testing

- Compare the exact serialized Responses Lite catalog against the
  expected namespace layout.
- Add a `tool_catalog` benchmark for connector schema preparation and
  Responses Lite catalog encoding with 1 and 64 tool specs.

GitOrigin-RevId: 6bd03a12fcedd4abfa8c3a03f298243483e98c63
2026-11-20 22:10:45 +00:00
swastik-oai 9735367e18 Return an assessment for explicit Guardian reviews (#62846)
## Why

An explicit `thread/guardianReview` request could return a null assessment when live execution would skip approval, leaving callers without a verdict on the recorded action.

## What changed

Require `assessment` on every successful `thread/guardianReview` response. Review eligible recorded calls even when a command is allowlisted, an MCP tool is configured for automatic approval or has a remembered approval, or the policy disables permission requests. The review runs without executing the call or granting permissions.

Include the MCP server's owning environment permissions in the review context, matching live review.

## Testing

Cover allowlisted commands, permission requests with prompting disabled, and automatically approved MCP tools. Compare live and recorded MCP review input for a server whose owning environment has denied paths.

GitOrigin-RevId: 54689dc043d77f940e10d29842308340f6937980
2026-11-20 21:58:11 +00:00
rhan-oai 2b5111917c Tag all multi-agent role instructions consistently (#62842)
## Why

Only catalog role instructions carried the `<multi_agent_role>` tag,
so the same guidance appeared in different formats depending on its source.

## What changed

Render bundled, catalog, and configured root and subagent guidance as
`multi_agent.role_instructions` developer messages. Wrap the guidance in
`<multi_agent_role>` tags and preserve configured text that's already tagged.
Match untagged parent guidance by its body when filtering forked history.

## Testing

Update prompt and session assertions for tagged role instructions, and keep
the cold-resume test exercising a rollout with legacy untagged guidance.

GitOrigin-RevId: 60c55b5d7227811b92bd1bf125f1cd3a965720fd
2026-11-20 21:42:17 +00:00
Charlie Marsh 5bee962f5e Reuse one syntax highlighter when building TUI Markdown styles (#62840)
## Why

Building Markdown styles clones the active syntax theme and constructs a new
highlighter for each foreground lookup.

## What changed

Borrow the active theme and use one highlighter for all foreground lookups
in `MarkdownStyles`. Preserve the readability adjustment for text styles
and the accent-color fallback for inline code.

GitOrigin-RevId: 8ddfad7e61e2dc7968398ff3bdecd3b389c1bb07
2026-11-20 21:29:06 +00:00
mpc-oai df6064096a Load managed cloud config for plugin add and list (#62837)
## Why

`codex plugin add` and `codex plugin list` loaded configuration without
the managed cloud configuration layer, so plugin discovery and
installation could miss settings supplied by that layer.

## What changed

Use the shared cloud-aware configuration builder for add and list,
passing through CLI overrides. Keep `codex plugin remove` on the local
configuration loader and use the loaded configuration's Codex home
for all three commands.

GitOrigin-RevId: 5ebe94de30e553c57ae6296a2ddb91792260a61f
2026-11-20 21:08:57 +00:00
tigrantsat-openai 1c0c806028 Record MCP tool call outcomes in traces (#62833)
## Why

A successful JSON-RPC exchange can still return a failed tool result.
MCP error metrics count that failure, but the trace span can lack an
error status. Dropped calls can also leave spans without an outcome.

## What changed

Record `codex.mcp.call.outcome` on `mcp.tools.call` spans and mark
failures with OpenTelemetry error status using the same classification
as the metrics. Record `interrupted` when the call future is dropped
before completion, including before its first poll.

Capture the numeric JSON-RPC error code in `rpc.jsonrpc.error_code`
when available, leaving server error messages and data out of the span.

## Testing

Extend in-memory telemetry tests to check that spans and metrics agree
on error classification and that span attributes omit sensitive test
values. Cover success and cancellation before the first poll and while
the call is pending.

GitOrigin-RevId: 57fcdc36f19cfc2f227c1ec964a932f3cf7eaa04
2026-11-20 20:38:01 +00:00
Ryan Taylor a1afa12273 Let required hooks block continuation on failure (#62831)
## Why

A required hook check can fail to run or return a usable result. Continuing
after that failure can let an action proceed without a completed check.

## What changed

Add per-handler `onFailure` for command and MCP tool hooks. The default
`continue` preserves existing behavior. On supported synchronous hooks,
`block` applies the event's blocking behavior and reports the reason while
preserving failure diagnostics. For example, a failed `PreToolUse` check
prevents the tool from running, while a failed `PostToolUse` check withholds
the result of a tool that already ran.

Expose the policy in the app-server's `configRequirements/read` response.

## Testing

Add tests for command and MCP failures under both policies, and scenario
coverage for blocked tool execution, withheld results, and completion after
a `Stop` hook recovers.

GitOrigin-RevId: 20d6ebda0094382fe052bbf34338edb994cc7bd3
2026-11-20 20:24:34 +00:00
ioanbudea-OAI 0a0b1021f0 Apply elastic Guardian budgets to retained user and sender evidence (#62829)
## Why

Fixed retention limits could discard long user instructions or leave
older sender messages out of Guardian review even when the configured
elastic budget had room for them.

## What changed

- Apply the configured retained-instruction entry limit when capturing
  and restoring user messages. Fixed-budget reviewers use the fixed
  retention window for both user and assistant messages.
- Build elastic sender snapshots at delivery using the receiver's sender
  evidence budget. Give recent user messages first claim on space, then
  include preceding assistant context where it fits. Mark omitted
  evidence and save the snapshot for review and rollback.

## Testing

Add coverage for cross-host delivery after compaction, large sender
snapshots through checkpoint restore and rollback, and how synchronous
and asynchronous reviewers read saved or empty sender snapshots.

GitOrigin-RevId: f0b01a2d558e3286335efac85a4f8645dd9b954b
2026-11-20 20:11:57 +00:00
ioanbudea-OAI ab7a93771e Honor Guardian retention settings for assistant messages (#62828)
## Why

The fixed retention window can discard assistant messages before elastic
Guardian reviews can use them as context for a user's reply.

## What changed

Apply the thread's Guardian retention policy when recording assistant messages,
including confirmed messages sent through the user messaging tool. Keep full
text within the configured record limit and the overall assistant history byte
budget. Preserve an incomplete marker when a confirmed delivery exceeds the
record limit.

Recover the thread's retention settings from saved history and compaction
checkpoints. Fixed-budget reviews continue to use the fixed retention window.

## Testing

Add coverage for record limits during capture and restore, thread-owned
settings recovery, and replay of oversized confirmed deliveries.

GitOrigin-RevId: e828f06824ce6712910a9cc5ef42a438d1ddf27e
2026-11-20 20:10:51 +00:00
ioanbudea-OAI 7fcb825b46 Persist Guardian retention limits in thread settings (#62827)
## What changed

At session startup, derive `assistant_record_bytes` from the Sync Elastic
per-entry token limit for retained user instructions. Use the default
section limit when the configuration omits that section.

Store the resolved byte limit in the optional `guardian_retention` field
of `ThreadSettingsSnapshot` and update the app-server schema. Fixed-mode
snapshots omit the field, and older snapshots can still be read.

GitOrigin-RevId: a8de88c5bd0e35c4a114577e70fb0c858acb13c9
2026-11-20 20:08:33 +00:00
vishnu-oai 60fc55bb69 Enable OAuth discovery by default for config servers (#62824)
## Why

Config servers that publish OAuth metadata still required administrators
to configure OAuth endpoints explicitly for Codex to use them.

## What changed

- Discover OAuth metadata when `config_server.oauth` is omitted. Use
  explicit settings when provided, and fetch managed configuration
  anonymously when discovery finds no metadata.
- Have the Git credential helper resolve the config server before
  fetching managed configuration. It refuses explicit or discovered
  OAuth so it can apply workspace policy without opening the OS keyring.
- Apply local network policy to discovery during `codex logout`.

## Testing

Cover app-server recovery after a discovery failure, Git credential
helper rejection of explicit OAuth without a network request, and
logout discovery blocked by local network policy.

GitOrigin-RevId: 1ad84effef48fd9b56371ee177bd53c54f3e87b8
2026-11-20 19:16:07 +00:00
jfoo-oai 51f4b8af01 Include native USD in ChatGPT turn cost telemetry (#62810)
## Why

When a turn incurs usage priced directly in USD, reporting only the
credit-converted estimate understates its cost.

## What changed

Sum `estimated_usage_usd_micros` and `native_usage_usd_micros` for
settled turns. Default an omitted native USD field to zero for legacy
responses. Suppress the total when either component is unavailable
(including explicit null), either is negative, or their sum overflows.

## Testing

Cover omitted and null native USD values, zero costs, negative amounts,
and overflow in backend client tests. Verify that the combined amount
reaches the OTLP exporter in the app-server integration test.

GitOrigin-RevId: 8709e48329db813cd66baf270ee3f1bcfd87cb03
2026-11-20 17:59:03 +00:00
yitaoh-oai 4360c5f813 Remove model-selected Search MCP routing (#62808)
## What changed

Use the turn's effective `web_search` mode for standalone and hosted
web search. Remove model-selected Search MCP discovery, fallback, and
provider tracking across thread resumes.

Remove `web_search_provider` from model metadata, the
`tools.client_search_provider` hint from configuration, and the
`hosted_search_policy` feature flag. Update the app-server schemas and
generated SDK types to match.

GitOrigin-RevId: 59e3371f4a43d532a484db52d5998f6770292028
2026-11-20 17:46:32 +00:00
Felipe Coury d402acbeba Reset TUI thread-switch state on reconnect (#62807)
## Why

Reconnect replaces the app event queue, so queued thread-switch events can be
discarded while their resets are still counted as pending.

## What changed

- Clear the pending thread-switch reset count when replacing the event queue
  and use a shared accessor for the displayed thread during reconnect.
- Box the app event dispatch future and extract helpers for choosing the side
  conversation target and rendering the composer pane.

GitOrigin-RevId: 6bb14443952262b6a0df7fdf05db053038c7ce2d
2026-11-20 17:45:15 +00:00
Charlie Marsh bb5b9c6240 Read Responses WebSocket messages during blocked uploads (#62771)
## Why

When a server stops reading a request, the client's WebSocket write can
stall. If the server sends a Ping or rejects the request while the write
is blocked, the client can leave that message unread until the write
fails or times out.

## What changed

Poll for incoming messages before each outgoing frame and while a write
is pending. On subsequent polls, give the pending write first use of
Tokio's cooperative budget and cap read-ahead across the entire upload.

## Testing

Add regression tests for Pong delivery before upload completion, early
size-limit closes, and bounded read-ahead without write starvation.
Cover error precedence for buffered peer replies, local send failures,
and network policy revocation, plus token usage when a close arrives
before an interrupt can be sent.

GitOrigin-RevId: c018c25dcdc70b64835b07935caede5e34dfa8f2
2026-11-20 14:26:42 +00:00
Charlie Marsh 9f2b87495b Recover server replies after Responses WebSocket write failures (#62749)
## Why

A server can reject an oversized request after reading just the first
frame header. If the upload then fails with a broken pipe, the write
error can hide the server's message-too-large close.

## What changed

After a write fails partway through an upload, drain immediately
readable replies within the send deadline and a bounded read budget.
Use those replies to surface server errors, including
`WebsocketMessageTooLarge`. Treat a close seen before the first frame
as belonging to the idle connection, and retire the socket after a
failed send.

## Testing

Add regression tests for size-limit closes on an idle socket, just
before the first frame, and after a partial first-frame write fails
with pings and pongs ahead of the close.

GitOrigin-RevId: 2feeb1961992b425dbec06129015dbe4c44ff3f2
2026-11-20 12:22:56 +00:00
Charlie Marsh 1c297f8997 Flush idle Responses WebSocket pongs under backpressure (#62742)
## Why

An idle Responses WebSocket still needs to answer server pings when the
write buffer is full. The pong must finish flushing once the peer drains
the socket, even if no further messages or requests arrive.

## What changed

Have the WebSocket pump flush automatically queued pongs and retry pending
flushes as the socket becomes writable. Bound incoming polling and the
number of pongs tracked while a flush is pending.

## Testing

Add an in-memory WebSocket test that forces a partial pong write and
checks that the peer receives the full heartbeat reply without further
traffic.

GitOrigin-RevId: 12865842c80a8a25a5e107be690f9c3962ce9775
2026-11-20 12:06:32 +00:00
cassirer-openai 076ac7856b Link agent tool calls to delivered messages in rollout traces (#62709)
## Why

Matching messages by text can link a tool call to an earlier message
with the same content. A recipient can also accept a message without
ever including it in a model request.

## What changed

Record the originating tool call ID when the recipient adds a spawn,
task assignment, or message to its history. On replay, use that ID to
link the accepted message to its sender even if the recipient records
it before the sender tool finishes.

Keep the interaction edge pointed at the recipient thread until the
message appears in a model request. Track distinct conversation items
across history resets and count repeated prompt prefixes only once.

## Testing

Replay tests cover identical message text, receipt before tool
completion, and messages observed again after compaction.

GitOrigin-RevId: ccab7c33993ba5fce7fceb733dc90c9d428ec78f
2026-11-20 08:49:07 +00:00
Eric Traut 0e8c7683c4 Match TUI task mentions by displayed title (#62691)
## What changed

Use state database-backed `thread/list` requests for task mentions without
searching conversation contents. Merge title-filtered results with recent
threads by thread ID so a full filtered page cannot crowd out recent
candidates. Native Cloud uses the recent list because it lacks a title filter.

Fuzzy-match the displayed title in the picker. Keep the working directory
visible as a description and exclude it from matching.

## Testing

Cover remote listing, retention of recent candidates when the filtered page
is full, and fallback when the filtered request times out. Check that a
directory-only match stays out of the picker.

GitOrigin-RevId: ec2a5ae9f046e533104251fd82f6683343854ee0
2026-11-20 07:15:35 +00:00