Commit Graph
13892 Commits
Author SHA1 Message Date
jif 39c29c3bb6 Add Statsig counters for exec_command latency (#62507)
## Why

Dividing total handler time by the call count gives a per-call mean
without averaging histogram export batches.

## What changed

Record `codex.exec_command.duration_total_ms` and
`codex.exec_command.calls` for built-in `exec_command` handler runs,
including failures. Measure from handler entry through command exit or
the first yield, including shell setup and startup. Exclude calls rejected
before the handler runs and retain tags such as `shell_snapshot_mode`,
`success`, and `product_sku` when available.

## Testing

Cover Statsig export of both counters and check that their counts and
duration totals match the tool duration histogram for eligible calls
within each tag set.

GitOrigin-RevId: 4bf6dc628bca5758999bf0ed5f67051f870a61e8
2026-11-19 13:18:44 +00:00
igorrybalka-oai 1826d80eca Expose Daybreak availability in model discovery (#62499)
## Why

Clients need to distinguish a caller who must enroll in Daybreak from a
model that does not support it. The list of accepted access programs
alone cannot express that distinction.

## What changed

Carry the server-resolved status for each caller and model from the
model catalog into `model/list` as `availableAccessPrograms.daybreakAvailability`.
Update the JSON schemas, TypeScript bindings, and Python SDK to expose
the field.

Rust decoders use `default` for missing or unrecognized statuses. The
Python SDK also defaults missing statuses and preserves new strings
from newer hosts.

## Testing

Cover catalog decoding, app-server response serialization, and Python
SDK round trips with known, missing, and future status values.

GitOrigin-RevId: c1e5ddef68fd19b25e583bb6996a93fd78ab9d18
2026-11-19 12:28:34 +00:00
ioanbudea-OAI b0ecad9cf9 Refresh managed Guardian policy across Codex threads (#62496)
## Why

A thread can start while managed Guardian policy is being refreshed. Startup
and refresh need to coordinate so the thread does not register with policy
that the refresh has already superseded.

## What changed

Let hosts provide a `GuardianPolicyLoader` to `ThreadManager` for startup
and on-demand refresh. Pause thread registration while a refresh loads and
publishes policy. If publication overtakes a thread's startup configuration,
reload Guardian policy before registering the thread.

Apply the published policy to live threads concurrently. Once published, the
updates continue even if the refresh caller is canceled. Return an error if
any live thread rejects the update.

## Testing

Add regression coverage for an idle thread receiving the update while
another thread holds its session lock, and for reporting a live thread's
rejection of invalid Guardian configuration.

GitOrigin-RevId: ca0cfa2a30f0d45c4ac5ded3400e0e18177ede1d
2026-11-19 12:07:28 +00:00
felixxia-oai d52a39b307 Honor elastic budgets for attached Guardian reviews (#62489)
## Why

Attached reviews used fixed evidence limits even when elastic budgeting
was configured. This could reject a pending tool call whose exact
arguments would fit within the review request's input budget.

## What changed

Use the configured budgeting policy to prepare the pending action and
permissions for attached reviews. With elastic budgeting enabled, check
whether the exact call fits when enforcing the final request budget.

## Testing

Add a regression test for a tool call that exceeds the fixed evidence
limit. Elastic budgeting rejects it when the request budget is too small
and preserves the original call when it fits.

GitOrigin-RevId: 42cc4a8682a98badfe6be95434703500403e7118
2026-11-19 10:46:39 +00:00
Charlie Marsh 6271f35f52 Box the thread startup future in spawn_thread (#62477)
## Why

Boxing the thread startup future at each call site makes each caller
compile its own copy of the future.

## What changed

Return a `BoxFuture` from `spawn_thread` and move the startup logic into
`spawn_thread_inner`. Thread start, resume, and fork paths now await
`spawn_thread` directly.

GitOrigin-RevId: 5004651423551e173b1cc98b185c6a1dc2bc097e
2026-11-19 09:47:54 +00:00
Channing Conger 336dc645fb Use gRPC for all code-mode host connections (#62476)
## What changed

Remove the legacy framed stdio protocol and its client and server.
Local Codex launches the standalone host with `--listen grpc+stdio://`,
which is also the host's default. The `stdio` and `stdio://` aliases
now select gRPC over stdio. The `features.code_mode_host_grpc` setting
is deprecated and ignored.

Carry execution trace context into gRPC tool callbacks and
notifications. Reject oversized execute requests before sending them
so an encoding failure does not appear as a connection reset.

## Testing

Exercise gRPC callback cancellation, trace context across overlapping
yielded cells, and isolation of tool preload failures between sessions.
Check that both values of the deprecated feature setting are ignored.

GitOrigin-RevId: f5faff3901dc60958627f677f50cfad834291b69
2026-11-19 09:37:29 +00:00
ssetty-oai 083bf59b6b Send authorized connector results over Responses WebSockets (#62474)
## Why

HTTP sampling can attach private connector result bodies, but Responses
WebSocket sampling leaves them out. WebSocket requests need the same
destination and account checks before sending those bodies.

## What changed

Apply the existing HTTP eligibility checks to each WebSocket attempt and
attach only result bodies that belong to the current account and match
the input being sent, including when that input is an incremental update.
Keep prewarm requests free of private result bodies. Update
`tungstenite` and `tokio-tungstenite` to keep sensitive payload bytes
out of frame diagnostics.

## Testing

Add regression coverage for connector results reaching the server while
staying out of request observers and client logs. Cover custom-provider
requests and retries across an account change with results from both
Code Mode `exec` and `wait`.

GitOrigin-RevId: df5ec8608e59bb3a0444fafd5268279e669ccb55
2026-11-19 09:36:18 +00:00
Konstantine Kahadze b9559ff737 Update the openai-docs skill for GPT-6.2 (#62447)
## Why

The existing GPT-6 migration guidance points to the earlier Astra
quickstart. Explicit GPT-6.2 Astra and Sol requests need guidance for
the selected model and its endpoint requirements.

## What changed

Direct both GPT-6.2 targets to the shared migration quickstart and
document that both support Responses and Chat Completions, with tool
calling requiring Responses. Refresh the fallback model guidance and
point onboarding examples to the model selection guide. Specify model
choices for legacy Chat Completions examples, Codex CLI
examples, and configuration shared with the IDE extension.

GitOrigin-RevId: 14000eedac4f2a4169bb76212cb74d8342b5752e
2026-11-19 06:34:53 +00:00
iceweasel-oai 739f934a15 Add Windows MXC sandbox launch diagnostics (#62439)
## Why

Launch errors and timeouts can be hard to diagnose without knowing which
stage the launcher reached or how long each stage took.

## What changed

Log MXC launch phases by process ID in the Windows sandbox runtime log.
Distinguish filesystem helper launches from regular commands and record
filesystem grant counts, preparation, spawn, and wait durations, and
launch outcomes or errors.

Reuse the runtime log's rolling file appender across entries in the same
launcher process.

GitOrigin-RevId: 8d55261fc9efeab8afe4b5be67b5aacb6868f3da
2026-11-19 06:18:44 +00:00
ningyi-oai 83f73a818c Defer Git worktree status until the turn starts (#62437)
## Why

A turn interrupted during setup can be discarded before it runs. Starting
the worktree scan during setup can spend time scanning for a turn that
will never send a model request.

## What changed

Collect `HEAD` and remote URLs in the background after turn setup, and
start the worktree status scan only after the turn is admitted to run.
Model requests use the latest available Git metadata while collection
continues, and later requests can include the worktree status once it
is available.

Use shared background Git root discovery for the memory extraction
change probe and pass the resolved root into the probe.

## Testing

Regression tests cover requests proceeding while status is blocked,
later requests carrying the updated `HEAD`, remote URL, and dirty
status, and an interrupted wake skipping the worktree scan.

GitOrigin-RevId: 00f465a5621d672d8b6d9063c384fb62e493c79f
2026-11-19 06:03:09 +00:00
Oliver Tepman c764c44a05 Let extensions attach metadata to MCP tool requests (#62435)
## What changed

Add `ToolLifecycleContributor::mcp_tool_request_meta` so an extension can
use thread and turn data and the captured tool registration to attach an
entry to the outgoing request's `_meta`. Codex rejects duplicate keys.
Expose the registering plugin's package ID in `McpToolContext` so
contributors can scope metadata to that plugin.

Export `PERSISTED_MCP_RESULT_MAX_BYTES`, the existing 64 KiB limit for
untruncated MCP results in durable history.

## Testing

Extend the multi-environment MCP scenario to check that only the call
for the selected plugin receives the metadata and that the result
callback sees the same plugin context.

GitOrigin-RevId: 25a2afc5402a5c9323de184313d614aede3692fb
2026-11-19 05:37:58 +00:00
ssetty-oai 524e15989b Expand connector result metadata coverage across auth configurations (#62434)
## What changed

Pass the resolved result-body destination into sampling, where its owner
is used to select retained bodies for the turn. Check that the capture
owner is current under the retention lock before converting an MCP
result and again before retaining its body.

## Testing

Extend the request-budget integration test for direct calls and Code Mode
to check when executed calls carry result metadata. Cover ungranted and
custom endpoints, independent model credentials, hosted Apps OAuth and
header overrides, and disabled result-body passthrough. Check that the
shared configuration preserves metadata on a subsequent turn.

GitOrigin-RevId: 8e5ac88ba323d10e0f3e696d4ae356d52bdf22a3
2026-11-19 05:26:15 +00:00
vishnu-oai 14302d5de9 Add opt-in OAuth discovery to config server loaders (#62432)
## What changed

Allow config server bundle and auth loaders to discover authorization and
token endpoints, plus an optional device authorization endpoint, from OAuth
metadata when callers enable discovery and omit `config_server.oauth`.
Discovery uses the bootstrap HTTP policy, times out after five seconds,
and keeps the discovered settings in memory. Existing managed-config
entry points pass `ConfigServerDiscovery::Disabled`.

If bundle loader initialization fails, report the error on the first read
and retry on later reads until a loader and its refresh worker can start.

## Testing

Add tests for endpoint parsing and defaults, the discovery timeout,
explicit OAuth precedence, disabled discovery, and local network policy.

GitOrigin-RevId: 7cb72054147ec34f985d55dfe708fccfafcb4ba3
2026-11-19 05:12:34 +00:00
Henry Levy d64451b049 Support tool-specific JavaScript preloads in Code Mode (#62430)
## What changed

Let in-process sessions and hosts using stdio or gRPC supply trusted
JavaScript helpers. Run each helper before the cell's module in the same V8
context, only when the cell exposes a unique matching binding with the
expected tool name and namespace.

Report ambiguous bindings and preload failures as bounded cell errors.
Suppress V8 diagnostics on stdout so they cannot corrupt stdio protocol frames.

## Testing

Add coverage for per-session helper selection, exact tool matching, ambiguous
bindings, and bounded compile and execution errors. A stdio subprocess test
checks that a failed preload leaves another session on the same connection
usable. Allow more time for existing CLI and MCP integration tests to connect,
start their test server, or shut down.

GitOrigin-RevId: f9f037de7f9d6018ae755b38475c4131ca7ba1f0
2026-11-19 04:48:49 +00:00
ssetty-oai b5d9f7116e Include nested Apps tool results in Code Mode sampling requests (#62423)
## Why

Result body capture covered direct Apps calls, leaving eligible calls made inside Code Mode without their result bodies in follow-up sampling metadata.

## What changed

Capture eligible nested MCP results and bind them to the originating `exec` or `wait` output for the current turn. Send `tool_result` and `tool_result_call_id` together when both fit the request budget. Keep the bodies out of conversation history and reclaim capture capacity when the output binding is lost.

Require analytics to be enabled and the provider to allow request metadata before starting turn-level capture. Check the call's credentials at dispatch and again when recording the result.

## Testing

Add coverage for yielded and finished outputs, late results, retries with replacement output items, capture budget recovery, and the request size boundary for sending the body and call ID together.

GitOrigin-RevId: 0983261ac39021099d14efa5c9a9acac47ac9269
2026-11-19 03:58:29 +00:00
ssetty-oai 770c38d0b1 Reject provider query parameters for connector result passthrough (#62421)
## Why

The Responses client checks the gateway URL and request headers before
allowing connector result bodies to be attached. Provider query parameters
can also change the request while leaving those checks satisfied.

## What changed

Require an empty provider query parameter map, or no map, when selecting
a connector result destination. Check the ChatGPT credential variants
directly and retain the current auth owner for thread grant verification.

## Testing

Extend the client setup test to check that a custom provider URL is
ineligible even with refreshed ChatGPT credentials. Extend the enterprise
MCP lifecycle test to check that the configured provider receives the
account bearer token and executed tool-call metadata. Allow HTTP client
tests to cache a direct system proxy decision as well as a proxied route.

GitOrigin-RevId: 1e7e77ec6e65263eaff658ba39943ec51230d332
2026-11-19 03:58:01 +00:00
Charlie Marsh fc483d4b4d Box the future returned by response item injection (#62420)
## Why

Callers of `CodexThread::inject_response_items` each compile a copy of
its concrete future, duplicating compilation work.

## What changed

Return a `BoxFuture` from `CodexThread::inject_response_items` so the
concrete future stays in the core crate. Raise the core integration
test crate's recursion limit to 256.

GitOrigin-RevId: 2ccb280c7887278fc8011c37df35df84c47b3e35
2026-11-19 03:56:40 +00:00
Keyan Zhang 0bc1e7db9a Allow per-sample model overrides in thread/sample (#62419)
## Why

Clients sampling a thread could only use the source thread's model.

## What changed

Add an optional `model` field to the experimental `thread/sample`
request. Omitting it or passing `null` inherits the source thread's
model. When an override is supplied, the server uses the selected
model's capabilities to decide whether to apply the requested
reasoning effort.

## Testing

Add an app-server integration test that checks model selection and
reasoning effort for the overridden sample, then verifies that a
subsequent sample and a follow-up turn use the source model.

GitOrigin-RevId: f5c54ca3d693d31e1f3e0628a520583330a5d56d
2026-11-19 03:37:31 +00:00
Anthony Tafoya cf881a627d Enable network access in the shell snapshot filesystem test (#62415)
## Why

Remote runners can block bubblewrap from creating a nested network
namespace, preventing the shell from starting and reaching the
filesystem checks.

## What changed

Enable network access in `denied_read_in_second_workspace_root` so the
test can exercise denied reads across both workspace roots without
requiring a nested network namespace.

GitOrigin-RevId: 26eada1e5efde4a31190628f4696c6beb400454d
2026-11-19 03:03:32 +00:00
cassirer-openai 508a429666 Deduplicate large tool output strings in rollout traces (#62407)
## Why

Repeated tool output, such as the same image returned in several results,
can consume the trace bundle budget. When output bytes are unavailable,
the surrounding result can still carry terminal metadata and conversation
links.

## What changed

- Store JSON string values of at least 64 KiB, measured after encoding,
  separately from their tool result or runtime event. Identical encoded
  values share one record per bundle, while each occurrence retains its
  position and complete captures reconstruct the original JSON bytes.
- Keep separate compression shards open for content and surrounding
  records. Budget for the serialized event and fall back to a single
  capped or omitted payload when the split layout or its references
  exceed the applicable limit.
- Track missing values separately from literal `null` so reduction can
  preserve surviving terminal metadata and keep tool output IDs attached
  to their original items.

## Testing

Add regression tests for shared image and text payloads, byte-for-byte
reconstruction, recording completion under tight bundle limits, and
reduction with missing output.

GitOrigin-RevId: a003197ea998639b6c2ae27f408990c0186406bd
2026-11-19 02:41:02 +00:00
Benjamin Carlsson 9274511443 Reconcile unfinished Cloud replies in the TUI transcript (#62403)
## Why

Cloud turn and item pages can reflect different points in time. A reply
restored from history may still be unfinished even when its turn is marked
complete. When the final text arrives, the TUI can leave a stale prefix in
the transcript or put the final reply after intervening tool output.

## What changed

Track Cloud replies by turn and item across history replay, pagination, and
live streaming. Reserve a transcript position even for an unfinished reply
with no visible text. When it completes, replace its fragments in place or
remove them if the final text contains only hidden directives. Keep late
completions from interrupting another reply's stream.

Preserve transcript order when choosing the latest copyable reply. When a
turn completion notification has no response text, fall back to the latest
completed response from that turn.

## Testing

Cover replies restored from older history pages, late completions during
another stream, and directive-only completions that remove a visible prefix.
Check the resulting transcript order, copy text, and notification fallback.

GitOrigin-RevId: a0abb75bf1378524461a519fe9a0656e15bca4bf
2026-11-19 02:26:51 +00:00
Felipe Coury aadb51b2b6 Test saved chat hover highlighting in the sidebar chooser (#62400)
## Testing

Add a regression test that checks that hovering over a saved chat's
preview highlights both its title and preview without moving the
selection. Moving to the title keeps the highlight without requesting
another redraw, and moving to the Side chats heading clears it.

GitOrigin-RevId: d54501f28c00112281389f67bb3671dfa6b18513
2026-11-19 02:08:25 +00:00
ssetty-oai d1d1ba0b83 Pass eligible connector results through to ChatGPT Responses (#62392)
## What changed

Add the off-by-default `features.connector_tool_result_passthrough` flag. For direct ChatGPT Apps calls, capture eligible text and structured content from the original MCP result before tool output processing. Attach the captured body to the matching executed-tool record on follow-up HTTP Responses requests to the ChatGPT Codex endpoint when the request uses the same authenticated account and turn.

Bound captured bodies in memory for the originating turn. Enabling passthrough alone scopes executed-tool metadata to calls with a captured result ID.

## Testing

Add coverage for same-turn HTTP delivery, omission on later turns or after an account change, and omission of shell-call metadata on HTTP and WebSocket requests when only passthrough is enabled.

GitOrigin-RevId: 410c81559bfc15022b896cf006cb631f3fd9454e
2026-11-19 01:27:01 +00:00
Felipe Coury b5e1f3ae9d Highlight clickable links and controls on hover in the fullscreen TUI (#62390)
## Why

The pointer shape can signal that transcript links are clickable, but the
text itself does not change on hover. A foreground change makes the
clickable region visible.

## What changed

Change the foreground color of hovered transcript and status-line
links, transcript disclosure controls, and the warning notice. Use the
rendered link spans so the highlight follows the visible text, including
wide characters. Recompute the highlight on redraw so it follows the
content under a stationary pointer as the transcript scrolls or updates.

## Testing

Add a mouse-motion regression test that checks highlight and restore
behavior for transcript links, including wide characters and Markdown
table links, as well as status-line links, disclosure controls, and the
warning notice. The test also checks that a URL in the editable draft
keeps its original styling.

GitOrigin-RevId: 4c7da58705e2ad4c710ec6c55727d5a064f3cf1f
2026-11-19 01:16:44 +00:00
iceweasel-oai c332754aa3 Pause runtime sandbox integrity checks (#62389)
## Why

The telemetry-only integrity checks duplicate policy preparation already
performed by sandbox enforcement.

## What changed

Disable integrity checks at the shared entry point for exec-server and legacy
local execution. Command launches now skip integrity dependency discovery,
policy preparation, and telemetry.

## Testing

Ignore the command-launch integration cases for checker errors and timeouts
while runtime checks are paused. Keep the isolated checker tests.

GitOrigin-RevId: e29d3538e5c8fc943c1a265d75508ee904bfc166
2026-11-19 01:16:07 +00:00
ssetty-oai f1b6986416 Support optional Apps tool results in Responses requests (#62388)
## What changed

Allow callers to attach eligible Apps tool results as `tool_result` on
selected executed tool calls in Responses HTTP and WebSocket requests.
Keep text content and optional object-valued `structuredContent`, with
a 1 MiB per-result limit and a 15 MiB budget for the enriched message.

Attach results after request observers receive the original JSON. Keep
result IDs local and suppress WebSocket payload tracing for enriched
frames. Preserve the enriched HTTP body on retries to the original
endpoint and retry with the original JSON on HTTP 307 and 308 redirects.
Codex's default request construction supplies no result bodies.

## Testing

Add coverage for result eligibility and size limits, HTTP retry and
redirect behavior, and TLS fallback without forwarding the enriched
body to a redirect destination.

GitOrigin-RevId: c3f2f86f31349e40fcb699d48637c3cbbbe38837
2026-11-19 01:14:54 +00:00
Joe Savona 2d58165651 Expose custom status lines in /experimental (#62387)
## Why

Custom status lines previously depended on a feature flag in the TUI
client's configuration. When the TUI connects to a separate app server,
that flag can differ from the setting in the server's active profile.

## What changed

Add **Custom status line** to `/experimental` as an opt-in feature. Save
the toggle on the connected app server, restart the TUI, then use
`/statusline` to choose a provider.

Read `tui_extensions_statusline` from the app server's effective
configuration at startup. Keep that value when switching conversations
or reloading local status line preferences, so toggling the feature
takes effect on the next TUI launch.

## Testing

Add a menu snapshot and regression coverage for saving the toggle in a
server profile while preserving the active provider across a thread
change.

GitOrigin-RevId: 4025c9771e560d6d7b1e6bd97236bffc44201556
2026-11-19 00:59:23 +00:00
viyatb-oai e1b7558492 Prepare managed proxy settings once per sandbox command (#62386)
## Why

Proxy settings are bound to the command's execution environment. Preparing
them again at launch can overwrite the settings already bound to the
command, including credentials prepared for its shell.

## What changed

Have `SandboxManager` prepare the proxy environment and sandbox network
context together when the caller hasn't supplied a prepared route. Pass
the prepared environment through to the child and use the prepared
context for sandbox policy, including macOS Seatbelt's proxy ports and
Unix socket rules.

## Testing

Add regression coverage for preserving shell-specific credentials and
environment-bound proxy settings, reporting proxy setup errors for the
requested environment, and deriving Seatbelt rules from the prepared
route.

GitOrigin-RevId: 7a9b5822d8d53f6c93e6318a19222bf06abf0da0
2026-11-19 00:17:19 +00:00
Felipe Coury f7dece07d0 Centralize transcript overlay input routing (#62384)
## What changed

Use `Overlay::input_transcript` to determine which overlay handles
transcript interaction keys and which keymap context applies during
search and selection. Apply runtime keymap bindings through `Overlay`
so the app can refresh them without matching the transcript variant
directly.

GitOrigin-RevId: 3592ddb62a6bddb760e2923604faff41a28cd150
2026-11-19 00:06:45 +00:00
richardopenai ab1ad9299b Skip the sandbox denial wait when unified exec output closes (#62382)
## Why

The sandbox denial check can spend 20 ms waiting for more output even
after the stream has closed and all denial context is available.

## What changed

Classify the buffered output immediately if the stream is already closed.
While the stream is open, wait up to 20 ms for new output or closure.
Register for the closure notification before rechecking the stream state
so closure during setup wakes the check.

## Testing

Paused-clock tests cover output closed before or during the check,
preservation of the timeout for open streams, and classification of
sandboxed and unsandboxed failures. The remote process-event suite adds
a direct sandbox denial case with a `process/closed` event.

GitOrigin-RevId: 1f3029055d70ff4cd63939564872fe5d37240a33
2026-11-18 23:42:25 +00:00
Keyan Zhang 8e9746b19d Remove the 4,000-byte prompt limit for thread/sample (#62378)
## What changed

Allow prompts longer than 4,000 bytes to pass `thread/sample` request
validation. Both `expectedTurnId` and `prompt` must still be nonblank.

GitOrigin-RevId: 59b97d351e2a02378b83aa9f2d4e649dd57169af
2026-11-18 22:40:41 +00:00
Eric Traut b967993f35 Preserve workspace roots across client and server platforms (#62377)
## Why

A TUI connected to an app server on another platform can receive workspace
roots that its own filesystem cannot represent. For example, a Windows
drive path from the server cannot be stored as a native absolute path on
a Unix client.

## What changed

Keep `runtimeWorkspaceRoots` as native path strings on the wire for thread
start, resume, and fork. Validate absolute paths on the server and store
the returned roots as `PathUri` values in the TUI. Use the session's roots
for active remote forks, including side chats, and preserve permissions
for those roots in the TUI's permission display.

## Testing

Cover thread startup with workspace and writable roots from another
platform, remote root retention through start, turn, resume, and fork,
and server rejection of relative roots.

GitOrigin-RevId: 1e9e3bff64a6e7ddadb941f16c4952c44724af54
2026-11-18 22:40:03 +00:00
Eric Traut 7d458c8fc5 Preserve sandbox writable roots across client and server platforms (#62376)
## Why

A TUI connected to an app server on a different operating system could
fail to decode a workspace-write policy. For example, a Unix client could
reject a Windows writable root such as `C:\extra` because it is relative
under Unix path rules.

## What changed

Keep `writableRoots` as path strings on the wire. Use path URIs to
preserve server paths when displaying thread permissions, and forward
the original sandbox policy to the first turn of a child thread that
inherits a legacy policy. The app server validates that each writable
root is absolute on its host before enforcing a policy supplied to
`command/exec` or `turn/start`.

## Testing

Cover writable roots from another platform in permission profile
templates, their round trip through thread lifecycle responses, and
rejection of home-relative roots during enforcement conversion.

GitOrigin-RevId: 57365b977bfced6c6ee864a0e54f25e8f9d09981
2026-11-18 22:39:26 +00:00
Eric Traut b82943092c Preserve app-server thread working directories across platforms (#62375)
## Why

A remote app server can report a working directory in a different path
convention from the client. Decoding a Windows drive path as a client-native
absolute path can make a Unix client reject the thread response.

## What changed

Keep thread `cwd` values as server-native strings in summaries, settings,
and start, resume, and fork responses. Preserve the JSON and generated SDK
types. In the TUI, store the session directory as a `PathUri` using the
server's path convention when available. Use that directory to match diff
and skill results and to display the project name in the terminal title.

## Testing

Add regression coverage for foreign-path response round trips, diff results
matched against a remote session directory, and terminal titles derived
from a Windows path. Verify that the server rejects a working directory
that cannot be encoded as UTF-8.

GitOrigin-RevId: 600f0b531939db4cd4ec884de166224082995e00
2026-11-18 22:13:26 +00:00
felixxia-oai fecf5cc672 Reconsider denials in attached Guardian reviews (#62374)
## Why

The denial reconsideration feature only applied to standalone reviews, so
attached Guardian reviews could deny an action after a single verdict even
when the feature was enabled.

## What changed

Move denial reconsideration into the shared verdict runner so attached
reviews can also take one additional sample on a denial. Keep the first
denial and its rationale if the second sample runs past the review deadline.

## Testing

Extend the app-server integration test to verify that attached reviews
sample denials exactly twice with identical input, can approve on the
second sample, and retain the first denial and its rationale on timeout.

GitOrigin-RevId: 06cc730d08dc755863f715362328aa48d15678f0
2026-11-18 21:58:11 +00:00
felixxia-oai d7c289ec25 Add opt-in in-memory message boards for Guardian v3 (#62373)
## What changed

Set `features.guardianv3.message_board_in_memory = true` to give each
new or cleared root thread an in-memory SQLite board. The housekeeper
and reviewer share the board until the last handle closes. The reviewer
can read evidence and update its own subscriptions. On-disk storage
remains the default.

With in-memory storage enabled, the attached reviewer is unavailable
on resumed roots because evidence intake starts at the end of history
and a fresh board has no earlier evidence.

## Testing

Exercise evidence catch-up and later post delivery with both storage
modes. Check that only the on-disk mode creates a database file, the
reviewer cannot update channels, and a cold resume skips evidence intake
in memory mode.

GitOrigin-RevId: 338f44720fca510b2baf40fd4b3a4b30245d4fc2
2026-11-18 21:57:35 +00:00
felixxia-oai 8bbe7c7d66 Make Guardian V3 routing and retrieval guidance configurable (#62372)
## Why

Guardian V3 uses fixed guidance for grouping evidence into board channels
and deciding when to retrieve more evidence. Longer routing instructions
also leave less room for evidence in the model's context window.

## What changed

Under `features.guardianv3`, add `housekeeper.routing_instructions` and
`reviewer.retrieval_instructions` to customize those strategies while
preserving the routing format and the reviewer's board and authorization
rules. Blank or omitted instructions use the built-in guidance.

Add an optional `max_instruction_tokens` cap that validates each custom
prompt separately using an estimated token count. Ignore both prompts and
the cap in project config. The `housekeeper.batch_timeout_ms` setting
controls the per-batch routing timeout and defaults to 90 seconds.

Size routing batches to fit the model's input window after accounting for
the prompt and response schema. Route the largest fitting prefix of whole
evidence records within the tool-output budget and leave the rest pending.

## Testing

Cover prompt validation, project config filtering, feature toggle merging,
and default retrieval guidance. Exercise custom prompts in model requests
and verify that routing reduces a batch under context pressure or stops
without advancing the cursor when even one record cannot fit.

GitOrigin-RevId: 83b3fcd23c680e90d2b2aea82a4a290633729658
2026-11-18 21:56:16 +00:00
Charlie Marsh bc63849ff6 Share config layer entries across snapshots (#62370)
## Why

Cloning a `ConfigLayerStack` copied every layer's TOML data, even when
the new snapshot only needed to replace one layer.

## What changed

Store immutable layer entries in `Arc` so snapshots can share them.
Replacing a user or session layer updates only the new snapshot's list.

GitOrigin-RevId: aa32fa5e3864c60743c0cad6922b274d55abbda3
2026-11-18 21:42:28 +00:00
Charlie Marsh 637c429472 Enable lazy startup for stdio MCP servers by default (#62366)
## What changed

Mark `mcp_lazy_stdio_startup` stable and enable it by default. When a
tool catalog is already cached, Codex can expose tools from an optional
stdio MCP server and defer starting the server until the first tool
call. Required servers still establish a live connection at startup.

## Testing

Exercise lazy startup with the default configuration in the tool-cache
test and explicitly disable the feature for the eager-start control.
Update the code mode and working-directory tests to proceed without
waiting for an optional server when its catalog is cached.

GitOrigin-RevId: a65d83fd1a4c141dba3c10e68b138539aa0a44f0
2026-11-18 21:30:23 +00:00
Felipe Coury 333ea31947 Make sidebar file preview errors easier to act on (#62362)
## Why

When a file preview fails, the generic error can leave users guessing
which file failed, especially when the sidebar truncates the tab label.

## What changed

Show the filename and directory in the failed preview. Give users
specific guidance for missing files and permission errors, and retain
the error details for other failures. If the file link cannot be
resolved, include the original path in the chat error.

Preserve typed filesystem RPC errors so the preview can classify
failures from `fs/readFile`, and strip the server's diagnostic payload
before the errors can reach TUI logs.

## Testing

Cover narrow-pane error rendering, missing-file and permission error
classification, unresolved links, and diagnostic payload removal for
remote file reads.

GitOrigin-RevId: 1db35c831bb112d67e8c0171a85a20d02cc15a08
2026-11-18 20:58:12 +00:00
jameswt-oai 1b80bd9412 Allow per-tool approval reviewers for Codex apps (#62360)
## Why

A connected account or app can choose an approval reviewer, but that
setting applies across its tools. Users may want to review calendar
event creation themselves while keeping automatic review for other tools.

## What changed

Set `approvals_reviewer` on an individual app tool in `config.toml`:

```toml
[apps.calendar.tools.calendar_create_event]
approvals_reviewer = "user"
```

Codex matches the tool by raw name first and falls back to its title.
The tool's reviewer takes precedence over the connected account, app,
app defaults, and session settings, subject to managed requirements.
This applies to tool-call approval prompts and MCP approval requests
that match a verified app tool invocation. The app-server
`config/read` response also exposes the per-tool setting.

## Testing

Extend coverage for reviewer precedence, tool title fallback, managed
review requirements, tool-call approval routing, strict MCP elicitation,
and app-server config reads.

GitOrigin-RevId: c92bd39b9e708dada9d314c19a446b4c580edf91
2026-11-18 20:42:18 +00:00
viyatb-oai 5387162ef0 Reserve credential permission tables in Codex configuration (#62358)
## What changed

Reserve `[permissions.credentials]` in `requirements.toml` for shared
credential policy. The table currently accepts no settings and should be
omitted. Empty tables and legacy profile definitions with profile fields
produce a migration error that tells administrators to rename the managed
profile and update references. Profiles named `credentials` remain valid
in `config.toml`.

Accept an empty `[permissions.<profile>.credentials]` table in named
profiles in both files and expose it in the `config.toml` schema.

## Testing

Add regression coverage for rejecting direct and inherited selection of a
user profile through an empty managed credentials table, preserving MCP
configuration reads, and enforcing network policy inheritance checks for
legacy managed profiles.

GitOrigin-RevId: 33dcca30b37d3f07ce670967342199f5302e1d98
2026-11-18 20:30:33 +00:00
akak-oai ed9becd2fc Report why turn critical path capture is incomplete (#62357)
## Why

The `incomplete` status alone gives no indication of which timing dependency was missing or which operation prevented capture.

## What changed

Emit deduplicated `critical_path_incomplete_reasons` in turn analytics for incomplete captures. Reasons cover unsupported Code Mode and agent operations, unattributed reviews and user waits, missing turn starts, and forced teardown, with an `unclassified` fallback. External tools that share a built-in name can still invalidate capture without being classified as the built-in operation.

During interruption, use the task's join result to distinguish forced teardown from normal completion so a task that already finished can still report a complete path.

## Testing

Add coverage for analytics serialization, concurrent reason deduplication, tool name collisions, and interrupted tasks that finish normally or require forced teardown.

GitOrigin-RevId: fab9aa1ff881997a34dcf75adc5638133cedc7fe
2026-11-18 20:29:59 +00:00
Charlie Marsh 513577302a Surface Responses stream errors as soon as they arrive (#62356)
## Why

If a provider keeps an SSE connection open after reporting a failure, Codex
can hit the idle timeout and lose the original error and its retry advice.

## What changed

End the SSE stream immediately on `response.failed` or a recognized
`error` event. Classify statusless quota, plan usage, invalid prompt, and
misalignment errors consistently across both event forms. Preserve
`Retry-After` for overload and capacity errors, preferring error-level
headers over event-level headers when both provide valid advice.

## Testing

Add SSE regression tests that hold the connection open and verify immediate
error delivery, terminal error handling, and retry delays. Extend WebSocket
coverage for statusless errors received before the close handshake.

GitOrigin-RevId: 69afd1d3b18ca3139e9b7ad98ae1481a432179f0
2026-11-18 20:28:44 +00:00
Charlie Marsh c5cff4335c Treat statusless bio and cyber policy errors as terminal (#62354)
## Why

When the Responses API sends a policy rejection in an `error` event
without an HTTP status, the SSE client can wait until its idle timeout
to report the failure.

## What changed

Recognize `bio_policy` and `cyber_policy` in the shared terminal error
parser so both SSE and WebSocket clients surface the corresponding
policy error. Preserve the provider's message and use a default when
it is missing or blank. End the SSE stream as soon as the error arrives.

## Testing

Add SSE tests for both error codes, including when the stream stays
open, and WebSocket cases that verify both errors surface without a
close handshake.

GitOrigin-RevId: 1b46b6557a39a61a1bb10bdd0d8ede48ecd6fa13
2026-11-18 20:17:25 +00:00
Charlie Marsh 097a8a7439 Add a shared sandbox launcher for Linux and macOS (#62353)
## Why

Running each helper through `codex sandbox` keeps a separate Codex
supervisor process alive for each helper. A shared launcher lets one
supervisor manage multiple helpers concurrently.

## What changed

Add a launcher mode that multiplexes helper I/O and exit status over a
newline-delimited JSON protocol on stdin and stdout. Each helper uses
the host sandbox setup with its own configuration and network proxy.
The launcher applies backpressure to helper I/O, drains buffered output
on exit, and stops tracked helpers when the controller disconnects.

## Testing

Add integration coverage for per-helper filesystem isolation, stdin
backpressure, buffered output after helper exit, and controller
disconnect while output is blocked.

GitOrigin-RevId: a7f75fdedbe0928ff5b93a412c7223371d0f321a
2026-11-18 20:14:05 +00:00
Charlie Marsh 60fcb1649f Support piped I/O when starting Seatbelt sandbox commands (#62350)
## What changed

Split Seatbelt command startup from waiting for the command to exit.
The startup helper can pipe stdin, stdout, and stderr and returns a
handle that keeps the network proxy alive while the caller manages the
child process.

The sandbox CLI still inherits stdio, waits for the child, reports
Seatbelt denials when requested, and propagates the child's exit status.

GitOrigin-RevId: 6a52a1a539bc2861b2357e9e60fab61ee65265fb
2026-11-18 19:56:33 +00:00
jif 9d8ca1df71 Preserve queued agent messages when a parent turn is interrupted (#62348)
## Why

A parent turn can acknowledge a child agent's final reply while a model
request is in flight. If the parent is interrupted before consuming the
queued reply, turn cleanup can discard it.

## What changed

Record queued agent messages in conversation history during interruption
and flush the rollout before emitting `TurnAborted`, even when the
interruption marker is disabled.

## Testing

Add a regression test that interrupts a parent while a child's final
reply is queued. The test checks that the reply is persisted when
`TurnAborted` arrives and appears exactly once in the next model request.

GitOrigin-RevId: 5bd828c4101942fa4fe7ba5040355a8244f02018
2026-11-18 19:39:41 +00:00
colby-oai 0e011c0092 Verify dependency hashes when running Python repository tools (#62346)
## Why

Using `uv run --frozen` keeps dependency resolution fixed but does not require
installed packages to match the hashes in `uv.lock`.

## What changed

Run Ruff for the Python SDK and repository scripts, and regenerate Python SDK
types during repository schema refreshes, through a shared runner. It exports
the selected locked dependencies, installs them into a temporary virtual
environment with `uv pip sync --require-hashes`, and runs the tool without
resyncing the environment.

## Testing

Update tests to check the formatter invocations and verify that only repository
schema refreshes invoke Python type generation through the runner.

GitOrigin-RevId: 4e84da5d227eb99c24efb9a1cc7647af82105536
2026-11-18 19:21:39 +00:00
Benjamin Carlsson 42cf4edfcd Add slash command argument completion to the TUI composer (#62343)
## Why

The slash command menu helps users find commands, but leaves them to
recall fixed arguments such as `on` and `off` for `/raw`.

## What changed

Show prefix-filtered suggestions for the first argument of supported
slash commands. For example, type `/mcp lo` and press `Tab` to complete
`/mcp login`. `Enter` and configured submit shortcuts still submit the
draft as typed.

Give mention completion priority and limit argument suggestions to
commands available in the current thread and connection state.

## Testing

Add tests for popup rendering, argument replacement, submit shortcuts,
and changes in thread availability and connection state.

GitOrigin-RevId: 8682c323064457dd9307b0a1520469011a8df9f3
2026-11-18 19:11:14 +00:00