Commit Graph
12836 Commits
Author SHA1 Message Date
cooper-oai 7085656b5e Reuse runtime-authenticated Responses WebSockets (#63175)
## Why

Reconnecting for every runtime-authenticated request adds a WebSocket
handshake and forces Codex to resend the full input instead of continuing
from the previous response.

## What changed

Allow requests to reuse an open WebSocket when the request headers,
connection key, runtime ID, and parent routing affinity still match.

## Testing

Cover reuse within and across turns, including incremental input through
`previous_response_id`, and verify that credential replacement and account
switches open new connections. Verify that a paused runtime is rejected on
reconnect after the server closes its WebSocket.

GitOrigin-RevId: cb89b9712f43027482147077a60d5c78fbdfd753
2026-11-22 19:12:31 +00:00
Eric Traut 1c8774ff1d Update url to 2.5.9 and form_urlencoded to 1.2.3 (#63174)
Update the resolved versions in `codex-rs/Cargo.lock` and add the
corresponding crate metadata to `MODULE.bazel.lock`.

GitOrigin-RevId: e270b2d070c09c80e848ae2d14c55fe40fc7d5ee
2026-11-22 19:10:48 +00:00
Benjamin Carlsson a0995c2b2b Fix account refresh for new cloud sessions (#63171)
## Why

When a provider change triggers an account refresh for a new cloud session,
the TUI tries to read configuration that the cloud backend does not expose.
The cloud account belongs to the authenticated connection and is independent
of the thread's model provider.

## What changed

Use the cloud backend's `account/read` response directly and skip
`config/read` during the refresh.

## Testing

Add a regression test covering both a pending provider change and a different
provider returned by the new thread. It checks that the TUI sends only
`account/read`, attaches the thread, and applies the returned authentication
and plan details.

GitOrigin-RevId: a195fc6735227ff65e0347d6dd9588b64dbb6ada
2026-11-22 18:24:22 +00:00
Benjamin Carlsson 2ef0f66901 Increase Linux voice callback periods at 48 kHz (#63169)
## Why

At 48 kHz, the two-period ALSA capture ring can overrun on PipeWire
graphs with 4,096- or 4,800-frame cycles, dropping microphone samples.

## What changed

Raise the Linux capture and playback target from 50 ms to 80 ms at
48 kHz, within device and queue limits. Give playback room for two
periods plus block-boundary headroom, and allow up to 160 ms for a
blocked write.

## Testing

Extend the PipeWire cycle simulation to check for capture overruns
across cycle-size changes and verify that playback can render a
two-period burst from 20 ms packets.

GitOrigin-RevId: ee5e70497bee6f8a00dd3f2f2ab5827bafc36b65
2026-11-22 18:09:39 +00:00
Eric Traut 104d256418 Preserve the host terminal's cursor shape in default TUI sessions (#63152)
## Why

Sending the terminal's default cursor shape can overwrite a shape
already set by the host, even when Codex never requested a custom shape.

## What changed

Leave the cursor shape alone during draws that use the default shape
until Codex applies an override. Track whether an override was applied
so cleanup resets the shape only when needed and still makes the
cursor visible.

## Testing

Check that default sessions and sessions using terminal scrollback emit
no cursor-shape reset. Keep exercising cursor repair with an explicit
shape override.

GitOrigin-RevId: 1f6f1cad0bfc04307896cea1d75b9535fc21031d
2026-11-22 16:32:37 +00:00
Eric Traut b46c087c7e Count wide-character wraps when inserting TUI history (#63151)
## Why

A double-width character moves to the next row when only one column
remains. Dividing the line's display width by the terminal width misses
that unused column and can undercount the rows occupied by a long URL.

## What changed

Use the same row count to reserve space for history and clear rows before
writing. Include the unused column when a wide character wraps, while
allowing clusters that start with a narrow character to cross the edge.

## Testing

The VT100 snapshot checks that a three-row URL with wide characters
appears directly below the preceding prompt. A unit test checks that
clusters starting with narrow characters can straddle the right edge.

GitOrigin-RevId: 15e76b00f280b0d9e82f5d81fbfa54c1ed8462ca
2026-11-22 16:22:42 +00:00
Felipe Coury 227fa4e805 Show task loading progress in the docked agent command center (#63146)
## Why

The current task can already be visible while initial discovery is still
running. Opening a different task can also involve several backend requests,
leaving the user waiting without an indication that their selection took effect.

## What changed

- Show “Loading additional tasks…” in the footer during initial discovery,
  with “Loading tasks…” in narrower layouts.
- Mark the selected row “Opening…” and show “Opening task…” in the footer
  during resume, including across backends. Keep the outgoing frame visible
  until the destination is ready to draw.
- Draw the replayed transcript before scanning for loaded subagents, then
  replay their pending requests. Suppress repeats of the selection key so a
  held key cannot act on an approval dialog opened during replay.

## Testing

Add regression coverage for the discovery footer, cross-backend opening
progress and held-key suppression, and replay of a pending subagent request
after discovery.

GitOrigin-RevId: 7c5088edd620a76c5157919c63566b95ad456664
2026-11-22 15:50:07 +00:00
Felipe Coury 69ee78825e Keep task status visible and fix paging in the agent command center (#63145)
## Why

Narrow task lists can hide status, and paging by a fixed number of rows
can skip tasks when group headings and detail rows take up viewport space.

## What changed

Show status and any branch beneath the task title in narrow lists when
there is room for a second row. In wider lists, size the Status and
Updated columns to their contents within their existing limits, leaving
more room for titles when the metadata is short.

Base Page Up and Page Down on how many selectable entries fit in the
current viewport. Keep the selected task's detail row in view when
space allows, and update the scroll position even when another page key
arrives before the next render.

## Testing

Cover paging through dense and single-task groups in wide and narrow
layouts, consecutive page keys before redraw, and restoration of the
first group heading when paging back to the top.

GitOrigin-RevId: 9e1be32338b5131d3be6b352c9ce2afbbbc227cc
2026-11-22 15:48:47 +00:00
Eric Traut cf3ff1530d Show a loading indicator while the resume picker starts (#63102)
## Why

`codex resume` can wait for the app server connection and login status
before the session picker opens, leaving the terminal blank while they wait.

## What changed

Display “Loading sessions…” during startup using the same styling as the
picker. Clear the inline indicator after the login status check or when
startup fails or is canceled.

## Testing

Add a terminal test that holds open a Unix socket to stall the connection,
checks that `codex resume --no-alt-screen` displays the loading indicator,
then closes the socket and verifies that the error replaces the indicator.

GitOrigin-RevId: 04b1a40343be284e2c56fd9519bb57a2b2fa6ecd
2026-11-22 08:27:26 +00:00
Eric Traut 1476a08f1b Prevent TUI startup hangs when a launcher restores blocking input (#63089)
## Why

A launcher that shares stdin with Codex can clear `O_NONBLOCK` on the
terminal probe's duplicated descriptor. After reading a partial reply,
the probe can then block waiting for more input past its deadline.

## What changed

Poll for readable input with a zero timeout before every probe read.
When no bytes are ready, return to the probe's deadline-aware wait.

## Testing

Add a pseudoterminal regression test that clears `O_NONBLOCK`, answers
only the cursor position query, and checks that the startup screen
appears without another keystroke.

GitOrigin-RevId: 7b6e11db6ac3634f77147ab1251f5321be4355cb
2026-11-22 07:02:39 +00:00
Eric Traut e1ecb5c8fc Fix linked worktree hook loading when the root .codex is a file (#63088)
## Why

When `.codex` in the root checkout is a regular file, reading
`.codex/config.toml` returns `NotADirectory`. That error aborts project
configuration loading for the linked worktree.

## What changed

Treat `NotADirectory` like a missing config when reading project hook
configuration from the root checkout.

## Testing

Cover a linked worktree that keeps its local project settings and inherits
hooks from the matching subdirectory in the root checkout even when the
root checkout's top-level `.codex` is a file.

GitOrigin-RevId: 2cb7fcb340ce85253641c016dace5177096ba205
2026-11-22 07:01:32 +00:00
Eric Traut 618d501ea0 Preserve fenced code source in TUI transcript copy mode (#63085)
## Why

An indented code block or a bare table displayed as code can match the
normalized text of a later fenced block. Copy mode could assign the fenced
block's original text to the earlier target, leaving the fenced block without
its original line endings or trailing whitespace.

## What changed

Track fenced code in both raw and rendered transcript layouts. Only match
original fenced code against copy targets that came from a fence.

## Testing

Extend copy-mode regression tests with an indented block and a bare table
that each precede a fenced block with matching normalized text.

GitOrigin-RevId: fbbce8e0feb71a449bb978aca65e1d2202da812e
2026-11-22 06:47:14 +00:00
Adam Perry @ OpenAI 357fe240c9 Share truncation logic for environment startup errors (#63077)
## What changed

Use `ErrorContextBudget` to truncate model-visible startup error details in
environment world state and `wait_for_environment` responses. Keep the
existing 256-byte limit per detail and 512-byte total for world state error
details, with truncation at UTF-8 character boundaries.

## Testing

Extend the world state test to cover a multibyte error that cannot fit in
the remaining budget, followed by an ASCII error that uses the last two bytes.

GitOrigin-RevId: a6296fc854a383186dacaec5576e9f02e179d34c
2026-11-22 02:54:25 +00:00
Dylan Hurd 6fd58416e3 Prevent MCP reply POSTs from resolving pending requests (#63075)
## Why

Codex and an MCP server assign JSON-RPC request IDs independently. If
both use the same ID, a server message returned in response to Codex's
reply POST can incorrectly resolve Codex's own pending request.

## What changed

In the MCP Streamable HTTP client, accept HTTP `202` and `204` as
acknowledgements for outgoing JSON-RPC results and errors. After handling
authentication challenges, reject other statuses for reply POSTs before
decoding their bodies as JSON or server-sent events.

## Testing

Add a regression test that uses the same ID for a request and a reply.
It checks that the request still receives its JSON-RPC error, reply
POSTs reject HTTP `409` JSON and HTTP `200` JSON or SSE, and both
acknowledgement statuses are accepted.

GitOrigin-RevId: 9ab1528b5c1f4af0bd281f9a6942271d7cc9812b
2026-11-22 02:21:17 +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
Benjamin Carlsson d4014cb19d Keep Cloud reply stream recovery retryable after transient failures (#63058)
## Why

Repeated disconnects could exhaust the active recovery attempt limit. A
shared deadline also let time spent in the worker queue or waiting to
reattach cut into the time available to fetch history and install the
replacement stream.

## What changed

- Replace the active recovery attempt limit with exponential backoff
  capped at 30 seconds.
- Give worker dispatch, reattachment, recovery history reads, and stream
  installation separate timeout budgets. Wait for the caller to release
  the held stream before starting the installation timeout.
- Surface transient failures and timeouts as transport errors so callers
  can retry recovery. Continue to enforce sign-in and network policy
  checks during recovery.

## Testing

Cover dispatch delays and expired queued requests, recovery after
repeated transient attach failures, history read timeouts, and rejection
of a replacement stream that closes before installation.

GitOrigin-RevId: aa1757e01b5cd32b1c4bd38bad97c2650904edd8
2026-11-21 23:39:23 +00:00
Eric Traut f12fa0fbc5 Keep the TUI transcript selection cursor visible (#63056)
## Why

Moving the selection cursor below the viewport could jump the transcript so
the cursor landed at the top. Resizing the viewport could also leave the
cursor offscreen.

## What changed

Scroll just enough to reveal the cursor, accounting for the row occupied by
a pinned prompt header. Recheck visibility when the viewport changes size
or text rewraps. When rendering an inactive pane, preserve its saved scroll
position and recheck cursor visibility when it becomes active again.

## Testing

Extend transcript tests to cover scrolling past the bottom edge, shrinking
and narrowing the viewport, reactivating a pane, and moving the cursor
around a pinned prompt header.

GitOrigin-RevId: 8772a79316fb31e758986d1f71a0d776fc5ff2b5
2026-11-21 23:25:56 +00:00
Eric Traut 17cb2e3a7f Suppress TUI completion popups in shell mode (#63054)
## Why

Shell syntax such as PowerShell's `$env:HTTP_PROXY` can trigger Codex
completion menus while the user is typing a shell command.

## What changed

Keep completion popups closed in `!` shell mode and cancel any active
file search. Preserve popup dismissals when entering and leaving shell
mode.

## Testing

Cover literal submission of shell commands containing slash-command,
skill, and file completion tokens. Verify that a dismissed file popup
stays closed when a leading `!` is typed and then removed.

GitOrigin-RevId: 6053c23db8710704d6f8c19cf2c114252a459566
2026-11-21 23:13:11 +00:00
Felipe Coury 9302bb553e Select and copy Markdown blocks in the transcript (#63047)
## What changed

Press `m` in transcript selection mode to mark the Markdown block at the cursor. Move between sibling blocks with `h` and `l`, or extend the selection with `j` and `k`. Use `Tab` to expand to an enclosing block or heading section and `Shift+Tab` to shrink the selection.

Copy with `y` to retain Markdown structure, including list markers, code fence languages, and table formatting. For example, you can copy a fenced code block on its own from inside a blockquote.

## Testing

Add coverage for wrapped blocks, nested lists and sections, table selection, copying from the displayed revision during streaming, and conflicts with customized keybindings.

GitOrigin-RevId: 5d4d873c0e378294128c128f472e4dae122831c6
2026-11-21 21:51:31 +00:00
Alex Kira 704ffed1c5 Refresh the Code Mode exec catalog when helper signatures change (#63046)
## Why

Incremental updates to nested tools can leave the model with a stale
`functions.exec` declaration when a global helper changes. For example,
resuming a session with unified image budgeting can change the advertised
signature of `image`.

## What changed

Track the signatures of global helpers supplied by the description renderer
and redeclare the full `functions.exec` catalog when they change, including
when an override removes those helpers. Send the configured incremental
tools hint once before the first namespace declaration in an update,
including updates that only redeclare `functions.exec`.

## Testing

Cover helper removal and session resume with bundled helpers, an
`{{ image_helper }}` override, and a helper-free override. Verify that a
changed signature triggers one refresh and subsequent turns reuse the
refreshed declaration.

GitOrigin-RevId: a1c216879be8eb5b331485984c86bf872b0b7a17
2026-11-21 21:40:05 +00:00
Benjamin Carlsson 59edd0d512 Complete named settings for TUI slash commands (#63036)
## Why

Slash-command completion only suggested positional arguments, leaving users
to recall named flags and their accepted values.

## What changed

Suggest flags for `/model`, `/permissions`, `/title`, `/statusline`, and
`/mcp login` using the same flag definitions as command parsing. Tab
completes known values in both `--name=value` and `--name value` forms.
For example, `/model --speed=f` completes to `/model --speed=flex`.

Named completion also works in multiline drafts and filters out flags
already present in the command.

## Testing

Add composer tests for both value forms, multiline completion, duplicate
flags, and quoted arguments, plus a snapshot of the `/model` flag popup.

GitOrigin-RevId: f874f67c4601012252775e811ddf496dbc6c4817
2026-11-21 20:41:19 +00:00
Eric Traut 140815f19c Fix clipboard text fallback and guard pending pastes in the TUI (#63022)
## Why

On X11, a clipboard owner can answer an image request with text, causing the image read to fail even though text is available. Submitting or queueing a draft while its clipboard read is pending can also send it without the intended paste.

## What changed

- Enable `Ctrl+V` text fallback on local Linux outside SSH and WSL, and allow `Shift+Insert` text fallback across platforms.
- Try text after eligible Linux image-read failures. Report the original image error if the fallback yields no text.
- Keep pending pastes alive across key releases. While a paste targets the current draft, intercept submit and queue shortcuts and show a reminder to review the draft before sending.

## Testing

Extend clipboard worker coverage to exercise submit during an active read and queue after a read completes but before its text reaches the draft. Snapshot the pending-paste reminder.

GitOrigin-RevId: 21bec5e405e13631a2a72f440482338611307ff3
2026-11-21 19:08:29 +00:00
Eric Traut 586bd4b891 Support the Orca integrated terminal (#63013)
## What changed

Recognize Orca from `TERM_PROGRAM=Orca` and report it in `codex doctor`.

Render Markdown links as clickable labels in Orca and keep destinations
visible under terminal multiplexers. Enable Kitty graphics for pet images
only when Orca advertises `ORCA_IMAGE_PROTOCOL=kitty` and the session
passes the direct-terminal checks.

## Testing

Cover Orca detection, Markdown link rendering and multiplexer fallback,
and pet image capability checks.

GitOrigin-RevId: 978a9cd99a8090bfe9198611e9ae7e0dd2709c3b
2026-11-21 17:25:41 +00:00
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