Commit Graph
13824 Commits
Author SHA1 Message Date
jif df975851bf Use the system clock for in-memory MCP message boards (#62284)
## Why

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

## What changed

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

## Testing

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

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

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

## What changed

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

## Testing

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

GitOrigin-RevId: 5a1649f917313f6fb152a206bc89986fe6345481
2026-11-18 13:08:51 +00:00
ioanbudea-OAI 17e79ae616 Support independent refreshes of managed Guardian policy (#62274)
## Why

Refreshing Guardian policy should preserve session configuration and
allow policy updates even when unrelated managed settings are invalid.

## What changed

Add a revisioned snapshot that loads and applies Guardian reviewer
restrictions, required models, and policy text together. Preserve the
cloud bundle binding and allow the active policy to carry forward when
another refresh rebuilds the configuration stack. Merge refreshed
`auto_review.policy` fallbacks with retained layers in precedence order
before validating the result.

## Testing

Add a regression test covering an invalid unrelated managed setting,
fallback validation after merging a session override, and removal of
stale policy text when its managed bundle disappears.

GitOrigin-RevId: ac42925eb916355d9972c3e2a0dd91041b06e47a
2026-11-18 13:07:45 +00:00
Zahan Malkani 29cb67623c Gate local realtime frame history on paginated storage (#62271)
## Why

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

## What changed

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

## Testing

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

GitOrigin-RevId: 2012feeca3857da90f9b026f077b31a26d15191b
2026-11-18 12:55:14 +00:00
Zahan Malkani 4389a526d5 Derive realtime input receipts from thread history (#62251)
## Why

Accepted handoffs and saved transcript chunks need to appear in realtime
history. Their text can come from the same user message that model history
uses, avoiding a second persisted copy for the receipt.

## What changed

- Reconstruct `turnInputAccepted` and transcript chunk receipts from user
  messages annotated with realtime provenance. Use the stored observation
  time when restoring the realtime clock.
- Replace `sessionEndInputSaved` in the app-server protocol with
  `sessionInputSaved` and a `reason` of `chunk` or `sessionEnd`. Update the
  generated schemas and bindings.

## Testing

Add coverage for reconstructing both receipt types, preserving rollout
order in paginated realtime history, and restoring observation time
across a restart after wall-clock rollback.

GitOrigin-RevId: fcb4e0e539f4e4066726e83fa1e945fb659a2ca8
2026-11-18 11:01:02 +00:00
Zahan Malkani 6d9f0199ed Refactor realtime handoff and history access (#62245)
## What changed

Move realtime text routing into `realtime_handoff` and keep it on the shared start-or-steer path. Extract UTF-8-safe range selection for realtime delegation truncation.

Use `RolloutItem` accessors for realtime timestamps and items in recording, clock restoration, and thread history reads. Pass annotated response items to turn-boundary checks in core and migration rollback so callers can work directly with history envelopes.

GitOrigin-RevId: 3dd37cf91ee5abdca84e87b7d7e304749d9baf04
2026-11-18 09:55:30 +00:00
cazhang-oai ca21fe65d1 Tag Guardian review counts with turn origin (#62225)
## Why

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

## What changed

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

## Testing

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

GitOrigin-RevId: 6a5808798df7d184203cea18e60a94a82d71f036
2026-11-18 08:20:26 +00:00
alexsong-oai 24e236514b Allow Bedrock Runtime selection during setup and login (#62222)
## Why

The app server's Bedrock setup and login flows always selected Mantle.
Clients using Bedrock Runtime had to configure that provider separately.

## What changed

Accept an optional `providerId` in `account/bedrock/setup` for AWS profiles
and environment credentials, and in `account/login/start` for Bedrock API
keys and AWS access keys. Pass `"amazon-bedrock-runtime"` to select
Runtime. Omit the field or pass `null` to keep the Mantle default.

Save configuration for the selected provider and check that provider for
an existing `aws.credential_export` before changing credential sources.

## Testing

Extend app-server tests to cover Runtime setup with profiles and
environment credentials, Runtime login with both key types, and Mantle
fallback. Verify that environment setup selects the Runtime default
model for a new thread and that a configured Runtime credential exporter
blocks profile setup.

GitOrigin-RevId: 6396b638208ab9b12f50f13f13bd517a919d0848
2026-11-18 07:43:45 +00:00
viyatb-oai bcff988bd1 Resolve Linux sandbox mode once before launching the helper (#62215)
## Why

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

## What changed

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

## Testing

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

GitOrigin-RevId: 619ab9d3eef965de6bc6cb13ff8a33132018abcf
2026-11-18 07:23:25 +00:00
Benjamin Carlsson ba8ab2d050 Allow paging through long choices in async questions (#62209)
## Why

A choice taller than the TUI's answer area could never be displayed in
full at that terminal size, so users could neither read it to the end
nor submit it.

## What changed

Let `PageUp` and `PageDown` scroll through the wrapped lines of an
oversized choice while keeping it selected. Allow submission once every
line of the choice has been displayed in order and at full width.

## Testing

Add regression coverage for paging without changing the selection,
rejecting submission when repeated page keys skip lines before redraw,
and rejecting choices clipped horizontally.

GitOrigin-RevId: c296323494bd387581c2bb046272a8ccd773ad75
2026-11-18 06:50:26 +00:00
Ruslan Nigmatullin 86d0e458e3 Prevent duplicate initial context when injection races the first turn (#62206)
## Why

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

## What changed

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

## Testing

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

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

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

GitOrigin-RevId: 8c9d278496d84589bc4a7b7d0ed08cb1b8e6ba21
2026-11-18 06:22:36 +00:00
Benjamin Carlsson a734a13ad7 Omit unknown server versions from /status (#62202)
## Why

`/status` appends `(unknown)` to the server label when a cloud or remote
server does not report a version.

## What changed

Show the cloud label or remote address on its own when the version is
unavailable. When a version is reported, use the same `v` prefix for cloud
and remote servers. The daemon menu still displays `unknown` for a running
local daemon whose version is unavailable.

## Testing

Add `/status` snapshots for cloud connections with and without a reported
version and for a remote WebSocket connection without a reported version.

GitOrigin-RevId: 113d2502fc7de6af37da3b3029ee28923af29e6f
2026-11-18 06:06:46 +00:00
Benjamin Carlsson e58677f0cb Add task group navigation to the agent command center (#62200)
## Why

Row and page navigation make users step through tasks to reach another group.

## What changed

Use `Shift+Down` or `Shift+J` to jump to the first task in the next
visible group, and `Shift+Up` or `Shift+K` to jump to the first task
in the previous group. Navigation stops at the ends of the list.

Expose `agents.next_group` and `agents.previous_group` in the keymap
picker and show the active shortcuts in Task shortcuts.

## Testing

Add coverage for jumps in both directions, list boundaries, and key
handling during search and rename. Update snapshots for shortcut help
and the keymap picker.

GitOrigin-RevId: 2542a75e7fdd7a3326c0914e19a9f5c191de082b
2026-11-18 05:49:12 +00:00
viyatb-oai 89feadf3cc Preserve saved sandbox permissions when resuming codex exec (#62194)
## Why

`codex exec resume` sends the current process's sandbox defaults as
overrides. A session started with `:read-only` can therefore resume with
workspace write access when the configured default is `:workspace`.

## What changed

- Restore the saved permission selection, working directory, and workspace
  roots by default. Honor explicit overrides and append directories requested
  with `--add-dir` to the resumed workspace roots.
- Recover built-in read-only permissions from older history without widening
  current read access. Require an explicit permission selection when a saved
  named profile cannot be loaded or saved read-only access cannot be restored.
- Report sandbox permissions and writable roots from the running thread.

## Testing

Add regression coverage for a denied write on the first resumed shell call,
legacy read-only history, explicit permission overrides, and workspace root
preservation with and without `--add-dir`.

GitOrigin-RevId: ed2cf3132f9ce34570661f801c9534a55696e3a5
2026-11-18 05:13:56 +00:00
zm-oai b78fa4af86 Distinguish Windows sandbox provisioning timeouts and pipe closures (#62192)
## Why

When a registered Core provisioning request timed out or its pipe closed
before a reply, setup reported only that the service was unavailable. That
made the two failures indistinguishable in setup metrics.

## What changed

Preserve the underlying I/O error and attach distinct setup error codes for
timeouts and pipe closures. Registered Core still reports the service as
unavailable and refuses helper fallback. `codex doctor` advises checking
that the sandbox service is running and letting pending setup finish before
retrying.

## Testing

Add a unit test that checks error classification for timeouts, unexpected
EOF, and broken pipes. It also checks that a non-registered request still
returns an unavailable response on timeout and that permission errors
receive neither new code.

GitOrigin-RevId: fa6653fe5f9cafd10fc1562eb0763857a1bd628f
2026-11-18 04:52:38 +00:00
Adam Perry @ OpenAI 8e1fc8e059 Route turn and response checkpoints through the rollout budget policy (#62190)
## What changed

Move rollout work admission into `RolloutWorkGate` and route compaction
deferral through `ThreadBudgetPolicy`. Use `TurnWork` to check the budget
when accepting a sampling response and to handle checkpoints after stop
hooks, compaction, and sampling errors. Pass sampling charges and response
completion through `ResponseWork`.

The existing budget check still rejects responses after exhaustion. The
new checkpoints leave retry, completion, compaction, and charge handling
behavior unchanged.

GitOrigin-RevId: 7526416b8ce24ca84035494aeb2a23abd8ca3ddc
2026-11-18 04:41:01 +00:00
richardopenai 1b84166252 Flush HTTP/2 tunnel data to the local TCP writer (#62186)
## Why

An interactive tunnel can stall when a buffered local writer holds data
that the client needs before it can reply.

## What changed

Flush the local TCP writer after each HTTP/2 data chunk, before releasing
receive flow-control capacity.

## Testing

Extend the relay test to verify that the client receives the server's
initial bytes through a buffered writer before sending its upload.

GitOrigin-RevId: 7c6c37a707319ce77f2abb627924337b0c944c32
2026-11-18 04:16:11 +00:00
viyatb-oai 6ee9bc1ba7 Select process sandboxes during launch preparation (#62183)
## Why

Workspace-relative permission rules need to resolve against the execution
host's workspace roots so a grant applies to the intended directory.
Restricted launches also need to check that the host can provide the
required sandbox.

## What changed

- Select the platform sandbox while preparing a launch, using the permission
  profile, network requirements, and Windows sandbox settings.
- Pass workspace roots into policy resolution for local commands and shell
  snapshots. Already-bound command profiles validate their concrete paths
  without resolving Windows launcher hints on hosts that do not use them.
- Share local launch preparation between tool commands and shell snapshots,
  and require a platform sandbox for exec-server launches that request one.

## Testing

Cover network-only restrictions and verify that a
`:workspace_roots` write grant allows writes to the configured subdirectory
under the command's working directory while denying writes to a sibling file
and the corresponding subdirectory under the parent. Exercise the path grant
through both app-server command execution and WebSocket exec-server execution.

GitOrigin-RevId: 492fe7ab8deddf30cfd2e2bdabf28d02d67e00c5
2026-11-18 03:59:37 +00:00
Owen Lin 9f80bb5957 Expose bioPolicy errors in app-server v2 (#62176)
## Why

App-server clients received the generic `other` error code for biology
policy errors, so they couldn't distinguish them by code.

## What changed

Map the core `BioPolicy` error to `bioPolicy` in app-server v2 and include
the new value in the generated JSON schemas, TypeScript types, and Python
SDK enum.

## Testing

Update the error conversion test to assert that `BioPolicy` serializes as
`"bioPolicy"`.

GitOrigin-RevId: 77fa969a3d8cbd4c12fe6f7aa5d4833f6adaa99b
2026-11-18 03:37:23 +00:00
Eric Traut fc25d8f120 Fix stale terminal dimensions in immediate TUI redraws (#62175)
## Why

An immediate redraw can happen before the TUI receives a resize event.
For example, submitting a turn just after shrinking the terminal can
render the frame using the previous dimensions.

## What changed

Resolve the screen size and run resize handling before immediate paints
for turn submission, session lifecycle actions, startup modals, Cloud
switching, and shutdown. Consume the reserved size when drawing the frame
and preserve the scheduled recheck for settled terminal dimensions.

## Testing

Add regression coverage for fullscreen turn submission and archive
progress after a terminal shrink, plus checks that a draw consumes its
reserved size and an early paint preserves the scheduled size recheck.

GitOrigin-RevId: 494c746cb02712350cc600ea4aea64460c608639
2026-11-18 03:36:14 +00:00
Eric Traut 3dbc6f8657 Keep the TUI composer caret anchored while typing (#62174)
## Why

When the composer footer gains or loses a hint row, typing the first
character or deleting the last one can move the caret vertically.

## What changed

Reserve a row for passive footer hints when the status line is visible
and there is room after laying out the input, slash-command suggestions,
and previews. The row can stay blank until a hint appears.

## Testing

Add a regression test that checks the caret row before typing, after
typing one character, and after pressing Backspace. Extend coverage to
check that slash-command suggestions and a short status line fit together
when space is tight.

GitOrigin-RevId: 25df697826cebc4b7cb4aab4460c432b7454d5ea
2026-11-18 03:08:53 +00:00
Sean Huang f09fb197f5 Remove Python from MCP permission request hook tests (#62172)
The MCP permission request hook tests depend on a Python interpreter to
run their fixture, so running them requires Python on the host or in
Bazel's test inputs.

Run the Rust test binary as the hook subprocess. It reads the hook
payload from stdin, appends it to the JSON Lines log, and writes the
configured response to stdout. Drop the Python runtime and files from
the core Bazel test dependencies.

GitOrigin-RevId: b9e26384c6b455b0f0936c7009a445d3eabfe2c6
2026-11-18 02:56:01 +00:00
Benjamin Carlsson 409973e0e2 Extract TUI thread resume finalization (#62171)
## What changed

Move subscription state updates, history hydration, and resumed session
setup into `finish_thread_resume`. Let callers supply a
`HistoryHydrationScope` and keep using `HistoryHydrationScope::Initial`
for the existing resume path.

GitOrigin-RevId: ebb8b422827a2374d8dce194e8d59afe57327f29
2026-11-18 02:54:51 +00:00
Dylan Hurd 345f166d01 Wait for the search connector in hosted web search tests (#62165)
## Why

MCP tool catalogs can change during startup, so a search binding
captured during startup may go uncached. That makes the test's
per-turn discovery request count depend on startup timing.

## What changed

When hosted search is allowed, wait for the thread's connector to
report `ready` before starting the first turn. This lets the test
check discovery reuse with a stable binding.

GitOrigin-RevId: 50d77eca6bfa7a6bfd5657e4c1ed3aad52beb8c5
2026-11-18 02:31:46 +00:00
Michael Bolin bb6b4b63b9 Move the app-server socket relay into the Codex CLI (#62163)
## What changed

Move the stdio-to-Unix-socket relay used by `codex app-server proxy`
into the CLI crate. Remove the standalone `codex-stdio-to-uds` crate
and binary and the hidden `codex stdio-to-uds` subcommand.

## Testing

Replace the standalone binary test with a CLI integration test that
runs `codex app-server proxy --sock` and checks that the socket receives
the bytes from stdin and the reply appears on stdout.

GitOrigin-RevId: e630f8f70e93ce90b0005e4992a3d0b257b208db
2026-11-18 02:18:36 +00:00
Dylan Hurd b65d9a3b2d Stabilize app-server app/list integration tests (#62162)
## Why

Fixed delays make notification-order assertions sensitive to when the mock
directory and tool requests finish. Model discovery can also make network
requests while these tests exercise app listing.

## What changed

- Pause mock directory responses until the tests receive the expected tool
  update. During forced refetch, assert that the next notification includes
  the fresh directory so an intermediate inaccessible-only update fails the
  test.
- Use the bundled model catalog through `model_catalog_json` and preserve
  that setting when the thread feature flag test rewrites `config.toml`.

GitOrigin-RevId: 0356d757391f15cdcee99a6ac3311dc78b8df00b
2026-11-18 02:17:25 +00:00
Benjamin Carlsson 29091c7234 Wait for the system bwrap probe with a pidfd (#62160)
## Why

The system `bwrap` user namespace probe checks for child exit at fixed
intervals. A pidfd signals exit as soon as the child terminates, even
when a descendant still holds its stderr pipe open.

## What changed

Poll the probe child's pidfd for the time remaining before the deadline.
Keep the bounded `try_wait` loop to collect the exit status and handle
systems where `pidfd_open` fails.

GitOrigin-RevId: f69f10aa49404a7760c33bbcbfde456513ebdaa0
2026-11-18 02:05:25 +00:00
Felipe Coury bedafe7156 Open subagent transcripts from activity links in the TUI (#62159)
## Why

When a transcript mentions a subagent, readers have to find it in the
sidebar chooser to inspect its work.

## What changed

Underline subagent labels in transcript activity when the sidebar is
available. Clicking a label opens that agent's transcript beside the
parent conversation, including when the link is in an unfocused pane.

Use backend ancestry to confirm that the linked agent belongs to the
current conversation. If a click arrives while agent discovery is in
progress after resume, resolve it when discovery finishes.

## Testing

Cover clicks from the parent transcript and a nested-agent link in an
unfocused pane, along with clicks during discovery and inherited
activity from a fork. Snapshot the underline across a wrapped label.

GitOrigin-RevId: 75b343c56eac4a009d644f0cfc135b6d9bfbe3a0
2026-11-18 02:04:55 +00:00
Felipe Coury cc3757a99d Open subagent transcripts in the TUI sidebar (#62157)
## Why

Selecting a subagent from the sidebar switched the active conversation
to that agent. Keeping the parent conversation visible makes it easier
to review the agent's work in context.

## What changed

- Open the selected subagent in a sidebar tab alongside its parent
  conversation. Switch focus between the two panes as needed.
- Show parent-owned subagents in a watch-only reader with transcript
  navigation, search, and selection.
- Press `Esc` from the reader to return to the subagent list with the
  same agent selected. The tab also supports the sidebar's close button
  and close shortcut.

## Testing

Add a TUI integration test that opens a saved subagent through the
sidebar, snapshots the watch-only view, and covers transcript
navigation, search, resizing, and tab dismissal.

GitOrigin-RevId: 60da0759b7c046c33b665abdbb063153c5beafa4
2026-11-18 02:03:29 +00:00
Dylan Hurd 3aaa23a437 Reduce overhead in CLI integration tests (#62153)
## Why

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

## What changed

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

GitOrigin-RevId: 94c20d4b2fd7cc65bc0f2a1cd0318ac188f59f22
2026-11-18 01:48:42 +00:00
Benjamin Carlsson 1c2e4cd45f Limit recovery after repeated cloud reply stream disconnects (#62151)
## Why

A cloud reply stream can drop again shortly after reconnecting, leaving
users in a cycle of disconnects and recovery.

## What changed

Delay recovery by 500 ms for each replacement stream already installed
in the current recovery sequence. After three replacements, return an
error that tells users their transcript and draft are still available.

Clear the count when recovery state is reset or when a stream disconnects
after staying connected for at least 15 seconds.

GitOrigin-RevId: 6ae2e88023464fc41d8e26d47dd94af624660d5f
2026-11-18 01:36:57 +00:00
Benjamin Carlsson 2f7c5a8588 Cancel Cloud overview refreshes that block TUI navigation (#62150)
## Why

An in-flight Cloud task list from the agents overview can keep the Cloud
worker busy while the TUI waits for a session request, such as listing
tasks in the resume picker or unsubscribing from a discarded blank task.

## What changed

Cancel the affected backend's Cloud overview refresh when dismissing the
overview or before session operations that need the same worker. Wait for
the aborted task to drop its request before proceeding. When opening the
resume picker, clear queued Cloud refreshes first so canceling the active
refresh cannot start another page ahead of the picker's requests.

## Testing

Add regression tests that hold Cloud list requests open while returning to
the current chat, opening the resume picker, or switching backends.
Cover canceling a refresh before starting a fresh plan implementation
session and preserving another backend's in-flight page during archive.

GitOrigin-RevId: 94993aa0014ac895a30f454e3ff5f4cbc45bb429
2026-11-18 01:35:51 +00:00
Felipe Coury 18352dc4e8 Show subagents and their status in the TUI sidebar chooser (#62149)
## Why

The sidebar chooser lists side chats and files. Adding subagents lets
users check their progress and switch to their conversations from the
same menu.

## What changed

- Add a `Subagents` section for the main conversation's spawn tree.
  Show each agent's name and status, and let users select an agent to
  switch to its conversation.
- Keep explicit outcomes such as `Completed`, `Stopped`, and `Failed`
  visible through idle or unloaded updates. Restore outcomes from saved
  activity and give live updates precedence over in-flight discovery.

## Testing

Add wide and narrow chooser snapshots and regression tests for outcome
retention and discovery updates that race with live notifications.

GitOrigin-RevId: 93092e6bd5c59724f69f52785e3c22aa2c1313d8
2026-11-18 01:11:31 +00:00
Benjamin Carlsson 2f5c413e19 Batch mouse wheel scrolling in the TUI (#62146)
## Why

Rapid wheel input can trigger a synchronous transcript redraw for each tick, even when the current layout can still be used.

## What changed

Accumulate wheel movement in the main transcript and side panes until the next frame when the rendered layout is safe to reuse. Refresh first when the transcript has changed, cached content can change height, or the side pane has buffered reply text. Refresh immediately when toggling side-pane zoom so subsequent mouse events use the new layout.

Start composer scrolling from the caret-adjusted viewport after an edit so wheel ticks can accumulate before the next frame.

## Testing

Cover wheel bursts while the plan menu is open, composer scrolling after edits, refresh requirements for mutable history and buffered side replies, and immediate layout updates when toggling side-pane zoom.

GitOrigin-RevId: 342d4d4c014d8a41b2e690b91622197ee97fc059
2026-11-18 00:58:27 +00:00
JonLuca De Caro 67d8266e06 Signal workspace routing readiness in account updates (#62145)
## Why

App-server clients receive `account/updated` both when routing is ready
for a saved ChatGPT workspace and when a user logs in, logs out, or
switches workspaces. The notification payload gives clients no explicit
way to identify the initial routing update.

## What changed

Add a nullable `reason` to `account/updated`. Set it to
`workspaceRoutingReady` on the initial saved-workspace routing
notification when the authenticated owner is unchanged, including when
routing is ready before the connection initializes. Login, logout, and
workspace-switch updates send `null`. Update the protocol schemas,
TypeScript types, and Python SDK models.

## Testing

Extend the app-server integration tests to check the reason in the JSON
payloads for saved-workspace discovery, login, workspace switching, and
logout.

GitOrigin-RevId: 96758519985a6bdb07474e48307ed53b125823ee
2026-11-18 00:46:17 +00:00
Owen Lin 06789c7618 Preserve web search provider ownership across thread resumes (#62144)
## Why

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

## What changed

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

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

## Testing

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

GitOrigin-RevId: 100d21c92b0bdbf737ec36c3474f0bc020df8efc
2026-11-18 00:45:07 +00:00
Ax 83c46d0a58 Add audio transcription to the backend client (#62142)
## What changed

Add `Client::transcribe_audio` to send a single audio clip to the
`/transcribe` dictation endpoint as an authenticated multipart upload
and return the transcript text. Accept WAV, MP3, M4A, WebM, and Ogg,
and cap the response body at 64 KiB.

## Testing

Add a mock-server test that checks the bearer token, the exact multipart
body for an M4A clip, and the returned transcript text.

GitOrigin-RevId: 50ab00d932aefda942c730a8b037b53d4f5003c2
2026-11-18 00:33:23 +00:00
zm-oai 2ae806bdf7 Repair missing or stale Windows sandbox Core registration (#62141)
## Why

When protected Core is requested, valid cached sandbox credentials can let
command startup skip setup even if Core registration is missing or stale.

## What changed

Run automatic setup when the requested registration is unready, even if
cached credentials are valid. Require registration readiness after setup
before returning sandbox credentials.

## Testing

Extend credential setup coverage to verify that valid cached credentials
trigger one setup attempt when registration is unready. Verify that setup
reloads credentials when registration becomes ready and returns an error
when it remains unready.

GitOrigin-RevId: 2822e8f294d98ea3df4f3bd7cf3f1e83ef5a2e7b
2026-11-18 00:32:46 +00:00
Benjamin Carlsson f39fcc1bfb Hold Cloud reply streams until history can be refreshed (#62140)
## Why

A Cloud conversation can miss an entire turn while disconnected. A
successful reattach, even with an idle thread, cannot establish that the
client's history is complete.

## What changed

Add an app-server client operation that reattaches a disconnected,
loaded Cloud thread and returns its cached settings. The worker holds
the replacement stream so the caller can refresh turn and item history
before explicitly installing the stream and receiving buffered events.

Reattachment, recovery history reads, and stream installation share a
deadline and use the original Cloud sign-in and network permit. Dropping
the release handle cancels the replacement. Personal access token
sessions still reconnect by reopening the conversation.

## Testing

Extend Cloud connection tests to cover quiet and busy reattachments,
buffered event delivery, cancellation and retry, slow history reads,
and sign-in changes during recovery.

GitOrigin-RevId: a4e5cb967e097021596bc83aac2f8d1a95373712
2026-11-18 00:32:11 +00:00
Benjamin Carlsson 1283c91ad7 Update crossterm to fix stray input when scrolling (#62139)
## Why

On Unix, a mouse scroll report split across terminal reads can be
misread as keystrokes and insert stray characters into the composer.

## What changed

Advance the `crossterm` pin in Cargo and Bazel to a revision that lets
both Unix input backends wait briefly for the rest of an escape sequence
before interpreting the initial byte as an Escape keypress.

GitOrigin-RevId: 3866299999ce0f61e331f848b821e07e113c454e
2026-11-18 00:30:46 +00:00
Charlie Marsh 3e5f072ca1 Use the state database first for TUI analytics thread lists (#62138)
## Why

Listing root threads for chat and task analytics can trigger filesystem
scans and metadata repair. The state database can serve these lists
without that work.

## What changed

Start root thread pagination with `thread/list` and `useStateDbOnly`
enabled. If the server returns JSON-RPC error `-32603`, discard the
partial results and restart from the first page with filesystem repair
enabled. SQLite cursors may identify different pages in the filesystem
listing.

## Testing

The chat analytics regression test simulates an error on the second
indexed page and checks that the fallback restarts pagination, excludes
discarded results, and preserves the usage estimate budget. The task
analytics test checks that only root listings use the database-only mode.

GitOrigin-RevId: 9de78a9eca4662df06d22a86cffb6e7bcba428cb
2026-11-18 00:18:42 +00:00
felixxia-oai 44de9d99ef Remove fixed message-board views and bulk subscriptions (#62137)
## Why

Guardian v3 reviewers can retrieve evidence from the live board, including
posts that arrive after a review begins. Fixed board views and bulk
subscription updates have no remaining callers outside tests.
https://github.com/openai/codex/commit/c2595ad3438311ce3070b1a7eef05cd0da8ad631

## What changed

Remove `BoardReadView`, its snapshot-specific tool bindings, and the
captured catalog and post cutoff from local board queries. Remove
`set_subscriptions` and keep individual subscription changes through
`set_subscription`.

Update the Guardian housekeeping test to check channel descriptions
through `list_channels`, and store captured Guardian evidence in an
owned vector.

GitOrigin-RevId: ede9e48abf4d009a2b4a82a437851657e41cf009
2026-11-18 00:03:53 +00:00
felixxia-oai 9e3681977b Deliver subscribed evidence to idle Guardian reviewers (#62136)
## Why

Guardian queued newly committed evidence for subscribed actors, but the
retained reviewer conversation did not consume that queue. A reviewer
could stay idle without receiving originals routed to it.

## What changed

Drain each actor's inbox when its reviewer becomes idle and before
reserving the conversation for a verdict. Read the queued posts by ID and
inject whole originals in source order within the reviewer's model budget,
without starting a model turn. Track delivery per conversation so a reused
reviewer receives each queued original once and a replacement can replay
the inbox.

## Testing

Cover delivery after the reviewer becomes idle, retention of queued
evidence after unsubscribe, and replay in a replacement conversation.

GitOrigin-RevId: ce83b98dc3eb2bae13ba0b7b5a82831a98b8aec4
2026-11-18 00:03:18 +00:00
felixxia-oai 5916098d02 Use live evidence retrieval and subscriber inboxes in Guardian (#62135)
## Why

A fixed evidence view hides posts routed after the review cutoff. Live
retrieval lets reviewers find those posts as they arrive while still
allowing intake to confirm that evidence through a requested history
position has been routed.

## What changed

Guardian retrieval tools search the live message board, including channels
the reviewer does not subscribe to. Subscription tools update only the
acting reviewer's subscriptions.

The housekeeper uses the subscribers present at each post's insertion to
queue one committed post per original in each recipient's inbox, even when
multiple subscribed channels match. It acknowledges catch-up requests
after routing and queuing evidence through the requested history position.

## Testing

Cover catch-up ordering, delivery based on subscription state at insertion,
live search across unsubscribed channels, and caller-scoped subscription
changes.

GitOrigin-RevId: 28b447d936f19ea68bd3c3adb297d473d65173c0
2026-11-18 00:02:00 +00:00
felixxia-oai 18d82cf7eb Add reusable per-agent reviewer conversations to Guardian v3 (#62134)
## What changed

Give the root agent and subagents with a board identity their own Guardian
reviewer reservation. Each new reviewer thread starts with empty history
and uses the acting agent's live message-board retrieval tools.

Keep one reservation active per agent and retain the conversation only
when the caller marks it reusable. Reuse requires matching reviewer settings
and history-reset version. Dropping a reservation retires its thread.

## Testing

Add an integration test that checks thread reuse after a reusable
disposition, replacement after an unfinished reservation is dropped, and
exclusion of legacy subagents without a board identity.

GitOrigin-RevId: c7bccf4651ad4e04c42d9aee1d9e8de24b5b48df
2026-11-17 23:48:01 +00:00
felixxia-oai c2595ad343 Add live evidence retrieval for Guardian v3 reviewers (#62133)
## Why

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

## What changed

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

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

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

## Testing

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

GitOrigin-RevId: c2e1c6c849346cd3d6e316bcf17e44260fcd4c8e
2026-11-17 23:47:24 +00:00
matthewdavis-oai 3bf4e138fe Stream partial thread search results and support cancellation (#62132)
## Why

Clients using `thread/search` have to wait for the search to finish before
they can show any matches. A search can also outlive the query that triggered
it, such as when a user changes their task mention query.

## What changed

- Add experimental `thread/search/stream` with best-effort
  `thread/search/partial` notifications. Each notification carries the original
  `requestId` and a batch of verified matches. Clients replace provisional
  matches with the final page, which determines results, ordering, and cursors.
- Support connection-scoped cancellation through `thread/search/stream/cancel`
  and `thread/search/cancel` for their respective search methods. Disconnecting
  also stops active searches and reaps their search subprocesses.
- Cancel superseded or timed-out TUI task mention searches without delaying
  available title matches.

## Testing

Add coverage for incremental results and final-page parity, slow clients,
connection-scoped cancellation and subprocess cleanup, and TUI task search
cancellation.

GitOrigin-RevId: b58abf7a1df424f191c8ede806d1d5266d299548
2026-11-17 23:46:48 +00:00
Dylan Hurd c90234de95 Isolate auth storage attribution tests from account switches (#62131)
## Why

Switching accounts revokes in-flight metric exports, which can interrupt
the auth storage events these app-server tests use to verify client
attribution.

## What changed

- Add a device-code login test that blocks the credential save by making
  `auth.json` a directory. Verify that login reports the failure and that
  the storage metric carries the `codex_vscode` originator. Keep the
  successful login and notification checks in their own test.
- Seed the concurrent-client test with the API key all three clients use
  so their writes keep the same account. Point the turn-cost probe at a
  local mock server and disable online model discovery.

GitOrigin-RevId: e735c2e0f81c6e58fd545943b47ff7bbd11339d7
2026-11-17 23:45:23 +00:00
Nick Steele 7066a55a7b Support enterprise MCP sign-in without refresh tokens (#62129)
## Why

An enterprise identity provider can return an OpenID Connect ID token
without issuing a refresh token, even when Codex requests
`offline_access`. The refresh-token requirement blocked those sign-ins.

## What changed

For `ema_auth`, keep requesting `offline_access` and prefer a refresh
token when available. Otherwise, use the stored ID token for the ID-JAG
exchange after checking its issuer, audience, and expiry. Require
reauthentication when the ID token is expired or invalid and no refresh
token is available.

Update `rmcp` to 3.6.0 for ID token exchange support.

## Testing

Add regression coverage for sign-in with and without a refresh token,
ID token expiry and issuer binding, and the subject token type sent to
the identity provider.

GitOrigin-RevId: ee7e253627c8274f9b3096e3b87e92e2f99885ea
2026-11-17 23:33:09 +00:00