Commit Graph
13927 Commits
Author SHA1 Message Date
Alex Zamoshchin 6a8a81166a Refresh plugin recommendations after installed state changes (#62610)
## Why

Recommendation lookups poll the plugin service for a tooling-state marker even when the cached catalog can still be reused. Install flows and installed-plugin snapshots already give Codex signals to refresh recommendations.

## What changed

Remove tooling-state polling and refresh recommendations on the next lookup after a known install event or a change to the installed plugin inventory or enabled state. Invalidate all product SKUs for the affected plugin service and account scope. If the account changes while a remote install prompt is open, invalidate both account scopes when the user accepts.

Concurrent lookups share a catalog fetch. If a refresh fails, keep serving the last successful result when available and retry on the next lookup.

## Testing

Cover invalidation across accounts, backends, and product SKUs, retention of the last catalog after a failed refresh, and isolation from fetches that complete after invalidation. Update the remote install integration test to exercise the next turn without waiting for the poll interval.

GitOrigin-RevId: 5d2ba84d1118e9346308bf6225543e0e174f8125
2026-11-19 22:16:30 +00:00
ztanner-oai 6633c6e09a Apply backpressure to app-server request replay on thread resume (#62609)
## Why

When a client resumes a thread with many pending server requests, replay
can fill the connection's bounded outbound queue if the client reads
slowly. Replaying inline can also stall the thread listener.

## What changed

Replay pending requests in a background task after sending the
`thread/resume` response. Allow one outstanding replay write per
connection and wait for its write receipt to complete or be dropped
before sending the next request. This extends the write-receipt
backpressure used by `command/exec`.
https://github.com/openai/codex/pull/15547

A new resume replaces the previous replay for the same thread and
connection while honoring any outstanding write receipt. Unsubscribing
or disconnecting stops the replay. Before sending each request, check
that it is still pending and apply the human approval eligibility check
where required.

## Testing

Add a regression test with more pending requests than the outbound queue
can hold. It checks that a second resume succeeds while a replay write is
stalled, dropped write receipts let replay advance, and unsubscribe and
disconnect stop replay.

GitOrigin-RevId: 77fc415be0e7b50744f5ccfcaa09857359dd5c55
2026-11-19 22:15:23 +00:00
XMLIU-oai efcc0cf917 Enable Guardian V2 scoring with an explicit Guardian provider (#62607)
## Why

An explicit Guardian provider could handle approval reviews, but configuring it
disabled Guardian V2 scoring. This prevented automatic reviews from using
background scores from that provider.

## What changed

Route classification through the configured Guardian provider and use its
classifier catalog for instructions, reasoning effort, review thresholds, and
input limits. Apply the Guardian provider's API-key access policy to classifier
requests and ignore assessments from the actor's response stream when a
Guardian provider is configured.

Keep mandatory review requirements in force and skip background scoring in
User approval mode and Full Access.

## Testing

Extend coverage for separate actor and Guardian providers at startup and after
cold resume, including when both use the same model name. Cover catalog
settings, scoring restrictions, and provider-specific API-key policy.

GitOrigin-RevId: 5f83d1704bacc63033e144bba0d78752283cb590
2026-11-19 22:00:52 +00:00
keith thornhill 75f2d93e7c Expose current turn admission state on CodexThread (#62604)
## Why

A thread can reserve a turn slot and assign a turn ID while it still
waits for host admission. Callers need to distinguish a pending turn
from one cleared to execute.

## What changed

Add `turn_admission_state()` to report `Idle`, `Pending` with an optional
turn ID, or `Admitted` with a turn ID in a single snapshot. Host-managed
turns become admitted after a grant is installed. Native turns are
admitted synchronously, including when no execution guard is needed.
The current slot retains its admitted state through finishing.

Reject superseded submissions before they can overwrite an owned slot,
and verify that a host grant still belongs to the current turn and task
before recording admission.

## Testing

Cover the admission state while a host decision is pending, after an
interrupt, during execution after a grant, and after the slot returns
to idle. Cover native admission without a host guard.

GitOrigin-RevId: 0633dc036aef99433505559c92b0b1b26a023352
2026-11-19 21:45:13 +00:00
Dylan Hurd b16fddf9d0 Apply additional context when turn input is delivered (#62602)
## Why

Applying client context at submission time lets input stopped by a hook
affect the conversation. A queued prompt that is later blocked can also
supersede the context attached to an earlier accepted prompt.

## What changed

Keep each context update with its submitted input and apply updates in
delivery order after the input passes its hooks. Preserve context-only
submissions when a turn is suspended for host handoff before inference.

For experimental `additionalContext` on `turn/start` and `turn/steer`,
omission or `null` keeps the current set. A supplied map replaces it on
delivery, and `{}` clears it while preserving conversation history.

## Testing

Add regression coverage for context on prompts stopped by hooks, context
on accepted queued prompts, context-only host handoff, and context
delivery when continuing an idle thread.

GitOrigin-RevId: 160f4f90d9aebf5eb3ea4a939c67265a1c6422da
2026-11-19 21:44:38 +00:00
richardopenai 93000976e8 Retry transient exec-server connection failures (#62601)
## Why

A remote exec-server connection could fail during setup if the transport
closed before the client received the initialization response. Callers
waiting for readiness received the failure even if a new connection
could succeed moments later.

## What changed

Share retries among callers during startup, reconnect, and connection
refresh. After a retryable transport or initialization failure, use
backoff and allow new attempts for up to five seconds. Attempts already
underway can finish after that window.

Keep the registry's existing retry policy and reuse the provisioning
deadline across transport retries.

## Testing

Add regression coverage for shared startup recovery after a WebSocket
closes during initialization, registry retry limits and authentication
failures, and child-process cleanup when stdio initialization is
cancelled.

GitOrigin-RevId: 56004badb67f4e5df8d939f2bc6cdfa46246fdb0
2026-11-19 21:44:07 +00:00
Charlie Marsh 665e0a9a65 Stream app-server fs/readFile responses over stdio (#62599)
## Why

Large file reads over stdio previously allocated both a base64 string
and a complete JSON response before writing to stdout.

## What changed

Keep file contents as bytes until the stdio writer encodes them
directly into the newline-delimited JSON response through a bounded
buffer. Clients still receive the same `dataBase64` field.

## Testing

Compare streamed output byte for byte with the eagerly encoded
response for empty files, inputs that require base64 padding, and
files larger than the write buffer. Check that JSON-RPC conversion
preserves the request ID and base64 payload.

GitOrigin-RevId: 730f201f0905fd15e32b6e9c5b2ef02ca21c7532
2026-11-19 21:41:45 +00:00
zm-oai bc75380d6a Explain Windows sandbox logon policy failures (#62593)
## Why

When Windows security policy blocks the sandbox account from signing in,
commands cannot start. The runner error previously gave users only the
failing API call and the numeric error code.

## What changed

For `ERROR_LOGON_TYPE_NOT_GRANTED` (1385), explain the policy denial and
point users to the “Allow log on locally” and “Deny log on locally” settings.
Advise users on managed PCs to contact their administrator.

## Testing

Add a regression test that checks the error explanation and verifies that
the denial does not trigger a sandbox credential refresh.

GitOrigin-RevId: b638bf3d103dc4aec72f2f9c13cb2c8825594e96
2026-11-19 21:22:42 +00:00
Owen Lin 30c69e60a3 Remove cumulative MCP attribution from requests and rollouts (#62589)
## What changed

Stop collecting cumulative MCP tool attribution, sending it in Responses
API request metadata, and writing it to rollout checkpoints.

Use `model_search_state` for search provider history in new rollouts. When
reading older rollouts, decode `mcp_attribution` only to determine whether
Search MCP may have been used. Treat malformed or error attribution as
possible Search MCP use so native search fallback stays disabled.

## Testing

Add a history test that distinguishes legacy Search MCP use, an explicit
record of no use, and missing attribution.

GitOrigin-RevId: a145b5b6b7d2f423d989af10623ef21120f49d4d
2026-11-19 21:06:08 +00:00
XMLIU-oai 5f8c36e836 Support a host-selected inference provider for Guardian (#62588)
## Why

Guardian inherits the actor's inference provider by default. Hosts that run
actors on a different provider need to route Guardian reviews independently
and resolve reviewer policy and model capabilities from the Guardian provider.

## What changed

- Share the selected provider and its model catalog between asynchronous
  scoring and blocking approval reviews. Use the provider's preferred
  reviewer and resolve policy from managed requirements or reviewer model
  metadata.
- Keep Guardian review history independent of actor compaction when the
  host selects a provider. Preserve inherited routing when no provider is
  selected.

## Testing

Add integration coverage for separate actor and Guardian endpoints, catalog
isolation when both share an endpoint, and routing after resuming a compacted
thread.

GitOrigin-RevId: 1eb15421f746a58eefe27257e86d948de31bcf86
2026-11-19 20:43:32 +00:00
Charlie Marsh 8b2070d29f Centralize schema selection for config diagnostics (#62587)
## What changed

Choose the full config or shell environment filter schema inside the
diagnostics module. Config loaders call the helper for the validation
that failed without passing a deserialization type or the
`config.toml` filename. Both helpers use the same layer traversal and
source location reporting.

GitOrigin-RevId: 5dcc7984b907e3769904c303cd08577c6faf4769
2026-11-19 20:42:24 +00:00
ioanbudea-OAI 90dd6cf9df Enforce refreshed Guardian policy on running threads (#62585)
## Why

A Guardian policy refresh could leave a thread using its previous restrictions
if the new policy disallowed its current model. A refresh could also report
success after its managed policy source changed before publication.

## What changed

- Use the app server's configuration manager to load Guardian policy from
  current local and managed configuration. Report an error when the policy
  source changes before publication or a live thread rejects the update.
- Apply updated reviewer and model restrictions even when they block the
  current model. Keep automatic work queued while the model is blocked and
  wake it when a later refresh permits it. Allow a new turn to supply a
  compliant replacement model.

## Testing

Regression tests cover policy changes during thread startup and live refresh,
queued work resuming after a blocking policy is lifted, and updated policy
text reaching Guardian reviews without reconnecting MCP.

GitOrigin-RevId: c7d3e119aa409342cc2fa18946ce2b6a4392e0e3
2026-11-19 20:26:00 +00:00
Felipe Coury 81ef12b617 Refresh open sidebar file previews when files change (#62583)
## Why

Sidebar previews load a snapshot of the file when opened, so edits on disk
leave the open tab showing stale content.

## What changed

Watch each previewed file’s parent directory through the app server so the
preview refreshes even when an editor saves by atomically replacing the file.
Poll every three seconds when a watch cannot be registered, and resubscribe
when reconnecting to the same backend.

Preserve the text preview’s reading position across reloads, including when
the file temporarily becomes unreadable and then returns.

## Testing

The sidebar test covers atomic saves and recovery after moving a directory
away and back. It checks that the tab shows updated content at the existing
reading position.

GitOrigin-RevId: d5f7507d1a81a118fb10a0febf5e274c18f19d81
2026-11-19 20:13:14 +00:00
Eric Traut 40a848caf4 Allow macOS installer cleanup despite unrelated mount warnings (#62582)
## Why

On macOS, `lsof` can warn about inaccessible mounts even when its search
is scoped to the releases directory. Treating every warning as an
inspection failure can prevent the installer from pruning unused releases.

## What changed

Keep `lsof` matches when stderr contains only complete mount warnings
for paths outside the releases tree and its ancestors, on devices
different from the releases directory. Continue to reject warnings
that could affect release inspection, incomplete warnings, and
unexpected errors.

## Testing

Extend the mocked macOS `lsof` test to verify that an unrelated mount
warning preserves matches and that same-device, ancestor-mount,
truncated, and mixed diagnostics fail inspection.

GitOrigin-RevId: 006e2a38335c33ce7c974f74d3bb871d818fdd1f
2026-11-19 20:12:04 +00:00
Eric Traut 2f0374456f Render LaTeX underbraces in TUI display math (#62577)
## Why

An unsupported `\underbrace` leaves the display equation as LaTeX source,
so readers have to interpret which terms each label groups.

## What changed

Render `\underbrace{expression}_{label}` with a Unicode brace that spans
the expression's terminal columns and a label centered below it. Keep
surrounding math aligned with the expression. Inline math, unsupported
arguments, and layouts that exceed the available width still use the
existing fallback.

## Testing

Add a snapshot for labeled Boolean clauses, short expressions, and labels
wider than their expressions. Check fallback for inline, malformed,
nested, multiline, and over-width cases.

GitOrigin-RevId: 8fbe92d512d06c73cf21247343ad869743bebd0c
2026-11-19 19:54:13 +00:00
Benjamin Carlsson 6eea328081 Use the cloud emoji for cloud thread labels (#62573)
## What changed

Request emoji presentation for the cloud marker in thread labels.
Preserve the emoji variation selector immediately after the cloud
symbol in Unicode terminal titles and keep GNU Screen titles ASCII.

## Testing

Update rendering snapshots for the task overview, side panes, mentions,
resume picker, and thread identity displays. Extend the terminal title
test to cover the cloud marker in both title encodings.

GitOrigin-RevId: 15959a0760f63a45d8fff917df2e008cda7536a5
2026-11-19 19:04:56 +00:00
jif 3869f396aa Keep async Guardian scoring active for serving probes (#62571)
## Why

A serving probe that reports no review needed can bypass async scoring.
Keeping the async path active lets Guardian compare the two signals
while using the existing approval policy.

## What changed

Treat streamed review flags as observations. Match each flag to its
response item, carry the enclosing item's flag into Code Mode tool
calls, and discard the flag when a pre-tool hook rewrites the payload.

Emit correlated `codex.guardian_probe_comparison` logs for tool calls,
async classification outcomes, and synchronous review results.

## Testing

Update integration tests to expect async scoring even when a probe
reports no review needed, and verify that Code Mode retains the probe
across yield and resume.

GitOrigin-RevId: 715f56ba4a82d544ce59f0291bcd1a84dd2daa51
2026-11-19 18:54:22 +00:00
Joe Savona 99870c4f49 Add justification to custom statusline rows (#62569)
## Why

A fixed gap cannot keep two statusline groups at opposite edges as the terminal width changes.

## What changed

Set `justify: "between"` on a root `row` to distribute spare footer columns between its items on each line, in addition to the configured `gap`. Nested rows size to their content within the available width, so they can keep related fields together.

Use `justify: "start"` to pack items at the leading edge with the configured gap. Both explicit modes group adjacent bare strings into one item. Separate `text` or `row` elements can be positioned independently. Omitting `justify` preserves the existing gaps between authored children.

## Testing

Add renderer tests for edge alignment during resizing, spacing on wrapped lines, and root versus nested rows. Extend the row decoding tests and the TypeScript contract fixture to cover `justify`.

GitOrigin-RevId: 3319e688f3adfe6d35709ef279345f1db3eb9693
2026-11-19 18:53:03 +00:00
Charlie Marsh 0762dfa710 Box the managed credential loading future (#62568)
Return a pinned, boxed future from `try_load_managed_auth` so callers
store a pointer to the credential loading future in their async state
machines instead of embedding the full future.

GitOrigin-RevId: 898e4877cc197720d88fc36a566533c5594f4f38
2026-11-19 18:52:23 +00:00
Bryan Ashley 65454c7b99 Add OpenTelemetry for subagent lifecycles (#62567)
## Why

Correlating a subagent's creation, turn attempts, and stop requests
helps explain what happened when those actions span workers.

## What changed

- Emit structured events and counters for successful spawns and accepted
  `close_agent` and `interrupt_agent` calls. Count accepted stops even
  when the target is already idle or unloaded.
- Track initial, follow-up, and resumed turn attempts for spawned
  subagents. Record each start and at most one outcome per attempt:
  completed, failed, interrupted, or suspended.
- Use thread, turn, and call IDs to correlate structured events while
  keeping those IDs out of metric labels.

## Testing

Add coverage for lifecycle counts, duplicate outcomes, stop handling,
and event correlation across workers. Improve the Windows elevated
sandbox test for an approved `git pull` by provisioning the sandbox
before the turn and reporting setup or launch failures with diagnostics.

GitOrigin-RevId: bc1190302e1dffbdd79c7ac984b6debe1dac4a65
2026-11-19 18:39:32 +00:00
Dylan Hurd 617ad20df0 Remove the real-time wait from the OTLP headers helper timeout test (#62566)
## Why

The stalled-helper test waits 10 real seconds to check the timeout.

## What changed

Use Tokio's paused clock and a named pipe to keep the helper blocked.
Assert that it reports the expected timeout after exactly 10 seconds
of virtual time. Keep executable paths with spaces covered by a
separate test.

GitOrigin-RevId: ceabf0697576c7944708e467dd0f1a33fd644f42
2026-11-19 18:38:49 +00:00
Dylan Hurd 692292695b Fix timing races in core integration tests (#62564)
## Why

Steering can cancel a paused mock HTTP stream, realtime handoff and turn
events can arrive in either order, and streaming tools can run before the
response reports token usage. Tests that assume a fixed sequence can fail
depending on timing.

## What changed

- Pause the hooks test at assistant message completion so both queued prompts
  enter the same batch before the turn resumes.
- Track the handoff and turn events in one pass, waiting for the matching
  turn to complete on the unblocked path.
- Call `get_context_remaining` during the compaction fallback and assert
  zero remaining tokens using the preceding response's usage.

GitOrigin-RevId: ec8a108517c819d7087681e8e2c7b5b57f4b341e
2026-11-19 18:22:41 +00:00
Felipe Coury 308ab1b895 Document how to render TUI shortcut labels (#62560)
## What changed

Use `esc close` to show how to combine the Escape binding's display
label with the action text and use the shared shortcut styling in
views and mockups.

GitOrigin-RevId: 0bb0dc94e503932443076dbe2495e5494e3df5b2
2026-11-19 18:05:07 +00:00
tongzhou wang 65d69f25b4 Reject overflowing rollout budget charges before posting (#62559)
## Why

An overflowing hook total could send a partial charge to the host, and
an overflow in native accounting could leave the posted balance infinite.

## What changed

Reject overflowing hook totals before reporting usage. Check both the
combined provider and hook charge and the cumulative rollout balance
before posting, preserving the previous balance on overflow. Native
budgets with limit enforcement enabled still stop new work on overflow.

## Testing

Update the hook overflow integration case to verify that the response's
tool is blocked and the host receives no usage report.

GitOrigin-RevId: 2ac80a6aa1d857924a8807df7bb70c6b7c107cd2
2026-11-19 17:46:53 +00:00
Charlie Marsh d9f6fcff94 Stage ICU data for mksnapshot in rusty_v8 builds (#62558)
## What changed

Set `GN_ARGS` in the rusty_v8 release and V8 canary workflows so
`mksnapshot` can load the ICU data file from the build directory.
Code mode registers its own copy of the ICU data at runtime.

GitOrigin-RevId: a80adca7ce27906b31ae95c055f99b514cac5d9f
2026-11-19 17:45:43 +00:00
jif 4d517cce4a Preserve process state across concurrent unified exec updates (#62557)
## Why

Process lifecycle handlers could overwrite each other's updates by reading
and replacing the entire state. For example, a rejected stdin write could
restore an older snapshot after the output collector recorded an exit code.

## What changed

Apply lifecycle transitions in place under the watch channel's write lock.
Rejected stdin writes and confirmed termination only mark the process as
exited, preserving any exit code already reported by the executor.

## Testing

Regression tests cover both closed stdin and unknown-process responses.
They verify that subsequent lifecycle updates preserve the exit code and
sandbox denial recovered from the final read, and that repeated calls to
`fail_and_terminate` preserve the first failure message.

GitOrigin-RevId: f090c0860c86b6e668c31d122d986ea4f4a119b6
2026-11-19 17:33:26 +00:00
Eric Traut 325123ae4a Render \widetilde in terminal Markdown math (#62554)
## What changed

Apply the same Unicode combining tilde as `\tilde` when the
`\widetilde` argument is a single grapheme.

## Testing

Extend the Unicode math snapshot to cover both `\widetilde{I}` and
`\widetilde I` in fraction numerators.

GitOrigin-RevId: e6976f998bb0955ba9c73117bd19dd814b07399a
2026-11-19 17:12:52 +00:00
Charlie Marsh ac784eb10e Enable MCP connection sharing by default (#62552)
## Why

Local stdio discovery needs to accommodate legacy servers that return an
empty response to `server/discover`, take longer to initialize than the
discovery watchdog allows, or require `initialize` as their first request.

## What changed

Mark `mcp_connection_sharing` stable and enable it by default. Treat an
empty discovery response as an unsupported method and let legacy
initialization use the configured startup timeout. Give legacy restarts
a fresh timeout and keep modern version retries within the original
deadline.

## Testing

Cover empty discovery responses, slow initialization on the original
connection, and restarts after ignored or rejected initialization.
Explicitly select legacy mode in tests that depend on legacy behavior.

GitOrigin-RevId: 04d87ddfe02fac8491f879ce420bf294dc725128
2026-11-19 16:56:55 +00:00
Eric Traut 76aa618787 Render multiline Mermaid flowchart edge labels (#62550)
## Why

The terminal renderer already supports line breaks in flowchart node
labels. The same syntax in an edge label causes the diagram to fall
back to source text.

## What changed

Treat `<br>`, `<br/>`, and `<br />` as line breaks in edge labels.
For example, `A -->|"Review<br/>order"| B` renders the label on two
lines. Reserve space for each line and preserve blank lines without
erasing edge connectors.

## Testing

Add snapshots for all four layout directions and update the terminal
Markdown snapshot to include a multiline edge label. Test blank lines
and terminal width limits.

GitOrigin-RevId: 277525d92c6c1f105bc34516893c67eccc22a22c
2026-11-19 16:44:44 +00:00
jif ab00c6d640 Prevent remote app-server shutdown from hanging on a full queue (#62547)
## Why

A stalled WebSocket write can leave the remote client's command queue
full. Shutdown can then wait indefinitely to enqueue its command,
before it reaches the timeout that allows it to abort the worker.

## What changed

Apply `SHUTDOWN_TIMEOUT` to enqueuing the shutdown command so the client
can reach the existing worker abort fallback even if the queue stays
full.

## Testing

Add a paused-time regression test that keeps the queue full with a
stalled worker and verifies that shutdown returns and the worker has
finished.

GitOrigin-RevId: d7c1a90442cd2619893144b20e43f6d87d5caa94
2026-11-19 16:21:15 +00:00
jif f6a1b61912 Borrow user input in extension turn contexts (#62540)
Pass the host's existing `&[UserInput]` into `TurnInputContext` to avoid
cloning the input when building extension turn items. Use the borrowed
slice directly for skill mention detection and shadow selection.

GitOrigin-RevId: f4983b584830e481d914f0c9aa1e39e78b965a19
2026-11-19 15:46:27 +00:00
jif 0b248182be Respect app-server turn admission for agent mailbox wakes (#62537)
## Why

Automatic mailbox wakes can start new turns while the app-server is
draining or has paused turn admission. Native child results still need
to reach the parent during drain so they can survive a daemon restart.

## What changed

- Require a turn admission permit for ordinary automatic mailbox wakes
  and hold it through turn registration. Retry queued work when a
  temporary pause ends. Explicit follow-ups and native child results can
  still wake the parent during drain.
- Let `thread/inject_items` queue plain-text agent messages for native
  child threads when native tools are enabled. Injected mail follows the
  ordinary wake rules.
- Extract the remote app-server client, shared event and request types,
  and WebSocket compression into `codex-app-server-remote-client` so
  callers can use them without linking the app-server runtime.

## Testing

Cover delivery of queued mail when admission reopens, injection into
native child threads, and recovery of a child result after a daemon
restart.

GitOrigin-RevId: 4c5ceeca8829c2612cc2b6b74c03d0c7677a9244
2026-11-19 15:45:17 +00:00
tongzhou wang 27e16c08c3 Add built-in namespace guidance and budget tool description prefixes (#62534)
## Why

Namespace-wide guidance can repeat on every entry in flat Code Mode listings. The existing prefix limit covers only reachable `functions` tools, leaving indirect namespace guidance outside the budget.

## What changed

- Add `builtin_tool_namespaces` to put guidance on namespace headers in Code Mode prompts and tool search responses, including headers shared with client tools. The selector applies to namespaces with a registered built-in tool and is omitted from flat listings. Overlapping selectors must agree after trimming.
- Validate all four prefix maps together against the selected model's `description_prefix_budget_bytes`, which defaults to 512. Count each trimmed value once in UTF-8 bytes, including unused selectors. Exclude keys, paragraph separators, and rendered copies.

## Testing

Cover shared headers, flat listings, and conflicting selectors. Exercise the default budget boundary with multibyte text and verify that a model can raise the limit.

GitOrigin-RevId: 1570c23ea1dbad6041cc8e48d0dc2b77f92596c7
2026-11-19 15:31:33 +00:00
jif dabe0643a4 Avoid cloning the PostToolUse hook payload (#62532)
Take the payload from the successful tool result and pass it directly
to the post-tool-use hooks.

GitOrigin-RevId: bb7dbe82bbc7b565257b94a0473476326e60db12
2026-11-19 15:14:37 +00:00
jif 097558c1bd Reuse the parsed bundled model catalog (#62525)
## Why

Fallback lookups repeatedly parse the embedded model catalog even though
its contents are fixed for the lifetime of the process.

## What changed

Parse the bundled catalog once on first use. Borrow the shared catalog
for fallback lookups and copy it when building an owned snapshot or
merging remote models.

## Testing

Extend the API key discovery test to verify that a bundled model lookup
applies a request's `base_instructions` override and that a subsequent
lookup returns the original bundled model.

GitOrigin-RevId: 27c90b65667724312673c5d5ae01a3fc6b5b1416
2026-11-19 14:59:56 +00:00
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