Commit Graph
12980 Commits
Author SHA1 Message Date
Alex Ionescu 05d375287d Add signature verification for Plugin Service archives (#63487)
## Why

A SHA-256 digest can detect changed archive bytes, but someone who replaces
both the archive and its digest can still pass that check. A signature
verified with a Plugin Service release signing key lets callers detect
that replacement before extraction.

## What changed

Add `RemotePluginArchiveDownload::verify` to check the archive's SHA-256
digest and verify its detached RSA signature with the matching
release key from the authenticated `/ps/plugins/signing-keys` endpoint.

Allow downloads with missing or null signing metadata to proceed without
verification. Report malformed metadata when verification is called so
catalog responses can still be parsed, and omit signing metadata when
serializing download records.

## Testing

Add a signed archive fixture and tests for successful verification,
tampering with both archive bytes and the reported digest, redirected key
responses, invalid signing metadata and keys, and unsigned downloads.

GitOrigin-RevId: 8dd1575cb24ca3e531223faf57d23c12445651bf
2026-11-24 01:09:47 +00:00
Alex Ionescu 9bcb9614d3 Scaffold the plugin archive verification crate (#63484)
## What changed

Register `codex-plugin-archive-verification` in the Cargo workspace and
add a Bazel library target. The library currently contains only crate
documentation describing its purpose of verifying Plugin Service archive
signatures.

GitOrigin-RevId: 6d5b4e38985ccef2423561f10eea78a8e919946b
2026-11-24 01:00:49 +00:00
Charlie Marsh 98f8a3311b Exclude sequence numbers from Responses stream deltas by default (#63479)
## Why

Codex does not use sequence numbers on text or custom tool input deltas.

## What changed

Add `delta.sequence_number` to the default `x-codex-exclude-stream-fields`
header for Responses requests over HTTP and WebSocket. Explicit provider
header values still take precedence.

## Testing

Update the WebSocket handshake and HTTP output-token replay tests to
expect the new default.

GitOrigin-RevId: d16ecb10f9188ba9cca4504e1b68e32832fb931a
2026-11-24 00:26:55 +00:00
arnavpatidar-OAI 8bb8ed6bab Add gateway enrollment to local managed requirements (#63476)
## Why

Administrators who use one gateway for managed configuration and model
requests need to configure the gateway URL and OAuth settings in two
places. A single enrollment keeps those settings together.

## What changed

Accept `[gateway]` with a base URL and `[gateway.auth]` in system
`requirements.toml` or MDM. Use the same OAuth settings for the config
server at the gateway root and the required Responses API provider at
`/v1`, with model discovery at `/v1/models`.

MDM enrollment replaces system enrollment as a unit. Requirements
composition rejects remote enrollment, conflicting config server or
provider settings, and empty or reserved provider names.

## Testing

Add composition tests for MDM precedence, remote enrollment and
rerouting attempts, and invalid or conflicting enrollment settings.

GitOrigin-RevId: 35f04481dc2b592e25afa4ac9235481cd90cf915
2026-11-24 00:14:14 +00:00
Jay Chen f103339a79 Trace lock acquisition during cloud catalog refresh (#63475)
## What changed

Wrap the refresh mutex wait in a `cloud_catalog.refresh.acquire_lock`
span and record `acquired = true` once the lock is held. This makes
the wait visible separately from catalog preparation and refresh work.

GitOrigin-RevId: 7cdc642d11282d8efcbc1a3468110ef3ce319b4a
2026-11-24 00:13:36 +00:00
jif 5b10c107ba Support encrypted context from MCP session-start hooks (#63474)
## Why

MCP hook results were flattened to text, so `SessionStart` hooks could
not pass encrypted context to the model as encrypted tool output.

## What changed

Recognize text blocks marked with `codex/encryptedContent` in synchronous
MCP `SessionStart` hooks. Send them to the model as standalone
`function_call_output` items with the originating tool name and namespace.
Keep ciphertext out of hook previews and plaintext spill files. Reject
empty encrypted blocks and cap the serialized encrypted output at
40,000 bytes per hook run.

## Testing

Add a scenario that checks that ciphertext above the plaintext spill threshold reaches
the first model request unchanged, appears once after a cold resume, and
stays out of hook previews and spill files. Cover discarding encrypted
context when hook output fails JSON parsing under both failure policies.

GitOrigin-RevId: cbc11c6f7055cc131212c6e9ddd37a882ed61d38
2026-11-24 00:13:03 +00:00
vishnu-oai 83077214a4 Reuse config server discovery when loading managed policy (#63473)
## Why

CLI login and interactive TUI startup could look up the same config server's
OAuth metadata again when loading managed policy, even after resolving it
for sign-in.

## What changed

- Carry the resolved config server settings in memory from sign-in to policy
  loading and through TUI startup and worktree setup. Reuse them only when
  the configured server, outbound proxy policy, and system proxy fallback
  setting match.
- Rediscover anonymous servers after onboarding so the TUI can pick up a
  newly enabled OAuth requirement.
- Use discovered OAuth settings to classify app-server startup errors as
  config server errors when applicable.

## Testing

Add a regression test that blocks discovery requests and checks reuse for
matching OAuth and anonymous resolutions, as well as cache misses when the
server or either proxy setting changes.

GitOrigin-RevId: 28b5c8ffdb80db09dd8bbae3c1e187189ea393bf
2026-11-24 00:11:35 +00:00
Anton Panasenko 6a33df4e0a Speed up remote control reconnects when a controller is active (#63471)
## Why

A silent WebSocket can leave an active controller waiting up to 60 seconds for the host to detect the outage. Reconnect backoff from earlier failures can delay recovery further.

## What changed

- Reconnect after 30 seconds without incoming WebSocket frames when a live controller is present. Keep the 60-second pong timeout when only the relay client is connected.
- Start at the initial jittered delay for the first five retries when controller activity resumes after a period with no live controllers, then increase backoff if failures continue.
- Preserve live streams and their terminals when a sequenced `initialize` request is replayed. Ignore cleanup from an old writer if a replacement connection has reused the stream.

## Testing

Cover the attached and relay-only timeout paths, retry backoff across controller lifecycle changes, and writer cleanup after stream reuse.

GitOrigin-RevId: 6618e7bca4852b05d41b18e53fe49efcb2b6db70
2026-11-23 23:55:35 +00:00
Matthew Zeng d4af2452f7 Honor explicit plugin disablement without a global default (#63468)
## Why

Without `plugins._default`, the activation policy ignored a plugin's explicit `enabled = false`. The CLI also reported remote plugin enablement directly from the marketplace, so its output could disagree with the effective state.

## What changed

Apply per-plugin enablement before falling back to `plugins._default.enabled`. The `codex plugin list` command now applies that policy to remote plugins, so an installed plugin can appear as disabled while retaining its installation and account settings. Plugins disabled at their source stay disabled.

## Testing

Cover explicit disablement without a global default in config and remote plugin loading tests, and check that the CLI reports the plugin as installed and disabled in both JSON and table output.

GitOrigin-RevId: ab9f5a5b36150d7350c2d11a8421f9e14524a1ad
2026-11-23 23:39:54 +00:00
jgrodman-arch 56bb44c05c Support model and reasoning effort overrides in remote exec (#63462)
## Why

`codex exec --remote` rejected model and reasoning effort overrides,
so callers had to configure those settings on the app server.

## What changed

Accept `--model`, `-c model=...`, and `-c model_reasoning_effort=...`
when starting or resuming a remote thread. As in local exec, `--model`
takes precedence over `-c model=...`.

Explicit overrides update the remote thread for the current and
subsequent turns. Omitted settings retain the thread's current values
or use the server defaults for a new thread.

## Testing

Add CLI integration coverage for fresh and resumed threads, override
precedence, and inheritance across turns. Check that invalid or
unrelated overrides fail before connecting.

GitOrigin-RevId: 9bd18b65978962cf6f325feee1056d130e9e6b91
2026-11-23 23:13:28 +00:00
Charlie Marsh a4ee1058d9 Request omission of preliminary reasoning ciphertext (#63461)
## Why

Reasoning replay only needs the ciphertext from the completed item, so
sending it when the item is first added is unnecessary.

## What changed

Default `x-codex-exclude-stream-fields` to
`reasoning.added.encrypted_content` on Responses HTTP streams and WebSocket
handshakes. Provider-configured values take precedence, and an empty value
opts out. Use a separate header to preserve compatibility with servers that
recognize `x-codex-exclude`.

## Testing

Extend integration tests to cover the default on both transports, provider
overrides, and replay with or without preliminary ciphertext.

GitOrigin-RevId: 83b72e5dd896f96e2793e67f0f05828218b98af7
2026-11-23 22:58:47 +00:00
Charlie Marsh 93752dd4d5 Avoid redundant buffer copies when applying patches (#63460)
Borrow the contents of added and updated files. Allocate the byte vector
required by the filesystem once for the initial write and again only if
the write is retried after creating a missing parent directory.

GitOrigin-RevId: b193f0c979aecc65b3b7b6307ba1c45a6898de16
2026-11-23 22:40:20 +00:00
Charlie Marsh c0a9009b7b Avoid cloning realtime conversation events before sending them (#63458)
GitOrigin-RevId: 4c5281b73d3bd0617c8142e9f6151444f0337c40
2026-11-23 22:39:07 +00:00
Dmitriy Kovalenko 45bdafbda0 Defer paginated thread history updates on NFS (#63456)
## Why

Live rollout writes also update SQLite, so lock contention in rollback
journal mode can delay recording thread activity.

## What changed

For local threads with paginated history on NFS, defer SQLite updates on
the live write path and materialize rollout history when serving history
pages. For pools configured to prefer rollback journaling, cap the pool
at two connections and allow 60 seconds for SQLite locks and 120 seconds
to acquire a connection.

Skip work already committed by another history reader. Remove rollout
files before clearing their history checkpoints and reject stale batches
that would recreate deleted history.

## Testing

Extend the thread deletion test to verify that applying a stale batch
after deletion returns `ThreadNotFound`. Check SQLite settings on every
connection using the configured pool size.

GitOrigin-RevId: e2a3c19bc8fec0a97075d468767929ce396b65e3
2026-11-23 22:14:21 +00:00
Eric Traut c028016428 Handle TCP resets in the code mode session recovery test (#63454)
## Why

The shared-connection release test can fail when the client closes its
socket with a TCP reset instead of a clean EOF.

## What changed

Use an in-memory stream between the proxy and the gRPC host so only the
client socket can report a TCP reset. Accept either a clean close or a
client reset as the release signal, propagate other I/O errors, and keep
the RPC assertions that rule out an early disconnect.

GitOrigin-RevId: 25c2d5093e340da21a19a69916b3f62716e4dd52
2026-11-23 22:13:09 +00:00
iceweasel-oai c7ef448428 Add Statsig bootstrap to the Codex backend client (#63448)
## What changed

Expose `Client::statsig_bootstrap` and `StatsigBootstrapContext` so callers
can fetch server-evaluated Statsig values using the client's existing
authentication. The client posts the targeting context to the bootstrap
endpoint for its configured API and returns the `statsigPayload` string.

## Testing

Add a mock-server test that checks the ChatGPT route, bearer token,
account header, and JSON request body, and verifies that the client
returns the payload string from the response.

GitOrigin-RevId: 0bbe812ee036c5bf744f9e07d01b70e9c241cce3
2026-11-23 21:56:18 +00:00
Charlie Marsh 9c5ebee9df Avoid unnecessary clones in local thread conversions (#63446)
Move preview strings out of owned rollout items and state metadata when
building stored threads. Move Git metadata out of rollout items as well.

GitOrigin-RevId: e5529857c851a0da2e2463a4b983d7b10800da0a
2026-11-23 21:41:46 +00:00
Eric Traut 7a1325c191 Preserve the TUI logo's aspect ratio across terminal cell sizes (#63445)
## Why

Mapping the logo to a fixed character grid can stretch it when terminal
cells have different pixel proportions.

## What changed

Use the terminal's pixel and grid dimensions to scale the logo uniformly
and keep it centered in the space reserved for it. Use the original grid
mapping when usable pixel dimensions are unavailable.

Refresh the cached dimensions after resize or resume in onboarding,
startup draft input, and the main TUI, even if the grid size is unchanged.

## Testing

Update the settled onboarding logo snapshot to cover a HiDPI terminal
with 11 × 25.5 logical pixels per cell.

GitOrigin-RevId: 3a8a504e00ba80ba0acc421a8b48f64c73e465aa
2026-11-23 21:41:05 +00:00
Eric Traut a66312f2e9 Resolve subagent nicknames in TUI transcripts (#63444)
## Why

Live and replayed tool calls can show raw thread IDs when subagent
metadata hasn't arrived yet, making it harder to tell which agents
were spawned or are being waited on.

## What changed

Look up missing nicknames in the background and refresh tool-call rows
in the active transcript and parked panes as metadata arrives. Use
archived subagent metadata to label older rows while keeping archived
threads out of the agent picker.

## Testing

Add regression coverage for replayed spawn rows and live wait rows
when metadata arrives late, including a subagent that closes during
the lookup. Extend picker coverage to verify that archived metadata
is cached.

GitOrigin-RevId: 47a5f585d6ebc1b0d9ac49020efeaf6c1b205198
2026-11-23 21:39:43 +00:00
Benjamin Carlsson 573bc54846 Keep TUI event receivers with their threads (#63441)
## Why

Clearing the active thread could drop its receiver and discard unread
events. A queued close from an old stream could also trigger close
handling while the same thread was being reattached.

## What changed

Keep each receiver in its thread's event channel and look it up by the
active thread ID. When a live attachment replaces the active thread's
stream, drain pending events and skip the old stream's `ThreadClosed`
notification unless the TUI is waiting for it to finish shutting down.

## Testing

Cover switching focus away and back without losing or misrouting unread
events. Exercise same-thread reattachment with a queued close, both
with and without a pending shutdown.

GitOrigin-RevId: b58767b2666ddbb64b09e6542ec8f550538531b6
2026-11-23 21:24:20 +00:00
Dmitriy Kovalenko 8a64bc9c7e Defer tool search indexing until the first search (#63440)
## Why

Tool planning built the search index even on turns that never used
`tool_search`.

## What changed

Build the index on a blocking worker when the first search over a
nonempty tool catalog needs it. Regular and Code Mode searches share
the same build within a handler and reuse the completed index. The
build continues if the search that started it is canceled.

## Testing

Add coverage for deferred indexing, concurrent first searches, and
reuse of an in-progress build after the first search is canceled.

GitOrigin-RevId: eb696e93dbc481a76a5adfe7f5506db971047bd5
2026-11-23 21:23:09 +00:00
iceweasel-oai 598083ae58 Route Statsig requests through Codex's HTTP client (#63438)
## Why

Statsig requests need to honor the caller's proxy, TLS, and network policy
settings.

## What changed

Add a `codex-statsig` crate that adapts a caller-supplied
`RouteAwareClientPool` to the Statsig SDK's HTTP interface. The adapter
requests identity encoding, applies the SDK's timeout and optional
response body limit, and leaves HTTP status handling and retries to the SDK.

## Testing

Mock-server tests cover request forwarding, preservation of HTTP error
responses, response size limits, timeout error mapping, and policy denial
before a request reaches the server.

GitOrigin-RevId: 6e78435f1f93ee272977b2f0058afd8f485cf4e0
2026-11-23 21:05:43 +00:00
jif 871559d9ce Remove the TUI's test-only MCP inventory conversion (#63433)
The TUI renders inventory directly from `McpServerStatus`. Remove
`mcp_inventory_maps_from_statuses` and the unit test that only exercised
its conversion to inventory maps.

GitOrigin-RevId: dbae1b541a60d490c18b50e19fca420df791c1df
2026-11-23 20:43:38 +00:00
ioanbudea-OAI bfb5f7d83b Keep active turns running when /compact is rejected (#63428)
## Why

Manual compaction could interrupt a running turn before discovering that
the session settings prevent compaction. This can happen when a policy
refresh requires auto review for the current model.

## What changed

Validate the session settings before interrupting the active turn for
`/compact`. If validation fails during a turn, emit a warning and leave
the turn running. If the session is idle, report a bad request and set
the agent status to errored.

## Testing

Add a regression test that verifies the running turn completes after
a compaction warning and that retrying `/compact` while idle reports an
error.

GitOrigin-RevId: 7e841450461b78661c026a348a610aefa24d8a77
2026-11-23 20:26:13 +00:00
Dmitriy Kovalenko 91f5c31ddb Make Codex tests more portable across environments (#63427)
## Why

Read-only Bazel runfiles can leave copied patch fixtures unwritable, and
restricted Linux environments can deny the mount setup Bubblewrap needs.
Test environments can also lack Python or use paths long enough to
produce identical truncated worktree headings.

## What changed

- Write fresh, writable copies of patch scenario inputs.
- Treat Bubblewrap's mount permission error as sandbox unavailability in
  the CLI and Linux sandbox tests.
- Use `printf` and `tr` to generate output for code mode truncation tests.
- Normalize one worktree heading at a time in the overview snapshot.

GitOrigin-RevId: 88590c9c08a739ecdd4ed49bd41734b02ece3f66
2026-11-23 20:25:06 +00:00
jif 06d76ee77b Remove test-only agent message grouping from TUI backtracking (#63423)
Delete the agent message grouping helpers and their sole test, which
checked that a context compaction marker did not count as an agent
message group.

GitOrigin-RevId: e694196474529f101fff5893f0fcf04161024595
2026-11-23 20:09:12 +00:00
jif aae9db9f5f Test subagent metadata on stored thread conversions (#63422)
Remove the app server's test-only rollout summary reader and cover
subagent nicknames and roles through the conversions from `StoredThread`
to a thread and a summary. Keep the summary assertions for millisecond
timestamp precision.

GitOrigin-RevId: f7481fd3c2d4d332ee094a62ec7cad8997903cdb
2026-11-23 20:06:57 +00:00
Anton Panasenko 00696090d6 Preserve slash command selection across TUI connection changes (#63419)
## Why

Going offline can change the slash command menu while a user is choosing a
command. With `/ex` typed and `/export` selected, a disconnect could move the
highlight to `/exit` and cause Enter to quit Codex.

## What changed

- Keep the same command highlighted when it remains in the menu. If it
  disappears, clear the selection and prevent submission from falling back to
  the draft. Restore the cursor, selection, and popup dismissal on reconnect.
- Honor configured submit chords in restricted slash command menus and prevent
  Tab from queuing the draft there.
- When users try to report an issue offline, scroll to the latest transcript
  entry to show the thread ID and prompt them to reconnect and retry.

## Testing

Add regression coverage for the `/export` to `/exit` case, popup state after
reconnect, offline Tab and submit chords, Vim command submission, and thread ID
visibility while scrolled back.

GitOrigin-RevId: 8143534f9d40e77a389d80d1dff3db993e194a23
2026-11-23 19:51:13 +00:00
jif 490e213e17 Terminate unregistered exec processes on startup interruption (#63415)
## Why

Interrupting `exec_command` after launch but before terminal registration
can leave the process running. The network denial monitor holds a strong
reference that prevents startup cleanup from dropping the process.

## What changed

Give the network denial monitor a weak reference so startup cleanup can
terminate the process on interruption. The monitor can still terminate a
registered process when a deferred network approval is denied.

## Testing

Add a regression test that interrupts startup while plugin attribution
is waiting on the exec server and checks that the server receives
`process/terminate` for the launched process.

GitOrigin-RevId: 54eb237028f9057d8520098b640782fe85c58331
2026-11-23 19:32:41 +00:00
jif 964fdd565e Remove the empty-preview rollout summary test (#63414)
## What changed

Delete the app-server unit test that reads a rollout containing only
session metadata and expects an empty preview when there is no user
message.

GitOrigin-RevId: fd033dec4e938b0352620ca76c448ae9e650493f
2026-11-23 19:13:12 +00:00
jif 8d867a0c7d Remove redundant Responses WebSocket v2 beta header test (#63409)
Other WebSocket handshake tests already verify that `OpenAI-Beta`
includes `responses_websockets=2026-02-06`. Drop the standalone test
that checks the same header.

GitOrigin-RevId: 844173591c7f1f2f7026fdc1f5414d7a41fcdc65
2026-11-23 18:58:26 +00:00
jif 9c7103216f Remove the app-server's test-only thread summary helper (#63408)
Delete `summary_from_thread_metadata` and the unit test that checks its
second-precision timestamp formatting.

GitOrigin-RevId: 917c0d28bb486c69baba8142ac84cc9057c6d5ee
2026-11-23 18:57:13 +00:00
Charlie Marsh 69477b3a77 Specialize blocking OTLP/HTTP providers for single-signal export (#63406)
## Why

The code-mode host only exports traces, and Windows sandbox setup only
exports metrics. Selecting the required exporter and HTTP client at compile
time lets the linker drop unused exporter and custom client code.

## What changed

Use `BlockingHttpService` for OTLP/HTTP JSON traces in the code-mode host
and Statsig metrics during Windows sandbox setup. These providers use the
OpenTelemetry SDK's default HTTP client. Traces use the dedicated batch span
processor even inside a Tokio runtime.

Move `codex_home` from `OtelSettings` to `OtelHeadersHelper`, where it
supplies the working directory for user-configured header commands.

## Testing

Exercise the blocking providers in HTTP loopback tests for trace export
inside a current-thread Tokio runtime and cumulative metrics temporality.

GitOrigin-RevId: 21bacbdb18b603f5f536532812ce7643e4eb36d6
2026-11-23 18:44:09 +00:00
jif 78fe0c9f23 Remove duplicate legacy MCP HTTP response size test (#63404)
The `mcp_2026_message_limits` suite already verifies that legacy MCP
over HTTP accepts a JSON `tools/list` response larger than 8 MiB. Drop
the duplicate test from `mcp_2026_discovery`.

GitOrigin-RevId: 9d6b0684558dd2749a32c5052388ff15758a9755
2026-11-23 18:41:38 +00:00
jif 70e009974c Remove the empty plugin list rendering test (#63401)
GitOrigin-RevId: 0b695079580e257f8de014c50d6797b2ff91a908
2026-11-23 18:27:38 +00:00
Eric Traut 6755b0d25a Use session permission profiles for local /diff (#63400)
## Why

`/diff` runs Git through standalone app-server commands, so it can pick up
the server's default permissions even when the active session uses a
different profile.

## What changed

- Use the session's named profile for all Git commands when the local daemon
  can resolve it for the session's single workspace root. Use server defaults
  when the profile depends on session-only settings or the workspace cannot
  be represented by the command's working directory.
- Disable Git transports and lazy fetching for profiled diff commands.
  Surface repository discovery errors under the selected profile.
- Display asynchronous diff results only when both the thread and working
  directory still match.

## Testing

Cover profile fallback after reattaching to a live thread, missing blobs
without lazy fetching, and stale results from another thread or directory.

GitOrigin-RevId: be8259d8d7af536c2d542d2edce2c601ed4482d0
2026-11-23 18:26:30 +00:00
jif 1b6ef00d25 Consolidate Responses WebSocket v2 continuation tests (#63398)
Fold the duplicate prompt-prefix case into the provider WebSocket support
test. Assert that both requests use `response.create` on the same
connection and that the follow-up sends the `previous_response_id` and
only the new input.

GitOrigin-RevId: 6d4c88aa4d8babf44b295ec9a1c8a1d4f6956adc
2026-11-23 18:16:40 +00:00
jif d56ae4699b Remove duplicate MCP HTTP response size-limit test (#63397)
## Why

`mcp_2026_message_limits.rs` already checks that the MCP client rejects
oversized HTTP JSON responses to `server/discover` and `tools/list`,
including HTTP error responses to `tools/list`.

## What changed

Remove the redundant test from `mcp_2026_discovery.rs`.

GitOrigin-RevId: ee04bf20a4b2f69d5aa7482fac83aef237d8d9ae
2026-11-23 18:16:00 +00:00
jif 699889ecb3 Remove the redundant TUI test for default collaboration mode (#63396)
`collab_mode_applies_default_preset` already checks that submitting a
message sends a user turn with `ModeKind::Default`. Remove
`collab_mode_is_sent_after_enabling`, which repeats that assertion after
explicitly enabling collaboration modes.

GitOrigin-RevId: 44e27b989d3106988a629be3ff0002d53554251e
2026-11-23 18:13:25 +00:00
jif e7cde429e1 Consolidate Responses WebSocket streaming coverage (#63393)
The test for omitting the timing metrics header already streams through
a WebSocket-capable provider with no feature flags enabled. Assert that
it sends exactly one request over a single WebSocket connection and
remove the separate test that exercises the same setup.

GitOrigin-RevId: 15aa2d2b503c3e1accfdf0de80eddd91e0b982e4
2026-11-23 18:02:47 +00:00
jif a3fd52a61d Remove the disabled-app mention popup test (#63392)
GitOrigin-RevId: efb85449bb79f6bffe10813c4b36b7fd47add159
2026-11-23 18:02:10 +00:00
ioanbudea-OAI 74efed3bf3 Apply current approvals reviewer policy after thread revert (#63390)
## Why

If Guardian policy changes while `thread/revert` is in progress, restoring
the saved effective reviewer can carry an outdated policy decision into
the replacement runtime.

## What changed

Resolve the saved reviewer request against the current Guardian policy
when the replacement runtime starts. Use the previous effective reviewer
as the request if no explicit request was saved.

## Testing

Extend the revert regression test to switch the reviewer allowlist from
`auto_review` to `user` after the settings snapshot and verify that the
replacement honors the original `user` request.

GitOrigin-RevId: a66fceb19e201b921d111f7a299c2be2c8a451ad
2026-11-23 18:00:50 +00:00
Felipe Coury 0c7efeb50d Show and copy file paths from TUI sidebar previews (#63388)
## Why

The sidebar file chooser can show and copy paths, but an open preview
has no equivalent shortcuts. The full path is especially useful when
a file fails to load and the user needs to locate it.

## What changed

Press `p` to show the full path in a scrollable view or `c` to copy
it from a sidebar preview, including when the file fails to load.
The preview reports clipboard status and can reveal the path when
copying fails or cannot be confirmed. `Esc` dismisses the path view
and returns to the preview.

Wrap long paths at directory separators where possible in both the
preview and file chooser, and let preview footer hints wrap across
two rows when space permits.

## Testing

Cover path reveal for a missing file, remapped list shortcuts in the
path view, and footer hints when a pager binding takes precedence.

GitOrigin-RevId: 480636c91a7bd7b0eb0b814dac62ce8ec9a6d783
2026-11-23 17:45:25 +00:00
Charlie Marsh d916a952a7 Preserve slashes in default branch names for remote diffs (#63386)
## Why

When the remote's default branch is `release/stable`, taking only the
last segment of its ref can make Codex diff against `stable` and include
changes already present on the default branch.

## What changed

Strip the `refs/remotes/<remote>/` prefix from the remote HEAD's
symbolic ref to preserve the full branch name.

## Testing

Add a regression test with both `origin/stable` and
`origin/release/stable`. It checks that the diff uses the
`release/stable` commit as its base and includes only the feature change.

GitOrigin-RevId: 527cfe47b5fecb9c178f9cfeb095ec66c6219260
2026-11-23 17:26:33 +00:00
Charlie Marsh af81d2770f Avoid cloning turn history in thread/fork (#63382)
Move the turns into the fork response and clone only the thread metadata.
The `thread/started` notification already omits turns.

GitOrigin-RevId: 8ffcefa3b6ed0908b511a58b53d034674ee8b668
2026-11-23 17:13:13 +00:00
jif ed02716c09 Omit final-answer schemas from legacy remote compaction (#63381)
## Why

Legacy models such as `gpt-5.2` emit compaction summaries on the final
channel, where the turn's JSON schema can constrain the summary.

## What changed

Remote V2 compaction omits the final-answer schema for the legacy
`gpt-5`, `gpt-5.1`, `gpt-5.2`, and `gpt-5.4-nano` model families,
with an exception for `gpt-5.2-codex`. It recognizes the same model names
with Bedrock's `openai.` prefix. Other models retain the schema in
compaction requests to preserve the cached prompt prefix.

## Testing

Integration tests check schema handling across model variants and verify
that compaction retries use the schema rules for the model handling each
attempt. Regular sampling retains the configured schema.

GitOrigin-RevId: f2ebaa7f3e272cb18ccb879dc7f67973ba1642cc
2026-11-23 17:11:57 +00:00
Charlie Marsh 1589e80b28 Fix project config diagnostics after an unknown setting (#63377)
## Why

When a project config contains an unknown key before an invalid setting,
deserializing the effective config directly can mask the type error users
need to fix.

## What changed

Reuse the TOML validation deserializer when diagnosing effective config
layers, with ignored-field path collection disabled.

## Testing

Extend the project config diagnostic test with an unknown key and verify
that the error still points to the invalid `tui.vim_mode_default` in the
current file after filtering out `tui.status_line_provider`.

GitOrigin-RevId: b124d0819ac34b2341f18fad7b6651ef0fe48379
2026-11-23 16:53:58 +00:00
chess 113e0c6d5e Allow per-subagent service tiers in spawn_agent (#63376)
## Why

Subagents can inherit the root session's service tier or get one from their
role. A per-spawn override lets a caller choose a tier for an individual
child without changing those defaults.

## What changed

Enable the optional `service_tier` argument for v1 and v2 `spawn_agent`
with `multi_agent_v2.expose_spawn_agent_service_tier`. The setting is off by
default, and tool schemas expose the argument alongside model selection.

Omit the argument to use normal inheritance, pass `default` to request
the default tier, or specify a tier available for the child's model and
provider. Unavailable explicit tiers return a spawn error.

Persist the child's choice across eviction and reload. Parent, sibling,
and descendant agents continue to use their usual tier selection.

## Testing

Extend coverage for tier selection in model requests, rejection of
unadvertised Flex on Bedrock, and restoration after eviction without
passing the override to grandchildren.

GitOrigin-RevId: 2e9b92af44232b6a5682fe2cd97980f17cbb5d97
2026-11-23 16:52:47 +00:00
ioanbudea-OAI 177c406276 Include completed audio transcripts in Guardian review context (#63368)
## Why

Guardian review can use spoken context when history supplies completed
transcripts for user recordings and tool results. Source labels distinguish
transcribed speech from typed user messages and identify the originating turn
or tool call.

## What changed

- Collect completed transcripts alongside their source history items so they
  participate in review delta selection. Respect tool output filtering.
- Preserve source labels when truncating transcript text. Quote and escape
  speech in line format so it cannot introduce a new role header.
- Support an optional `transcript_audio` elastic budget for synchronous and
  asynchronous reviews. Without it, user and tool audio use the message and
  tool budgets respectively.

## Testing

Add coverage for loading the audio budget in both reviewers, enforcing it in
line and JSON transcripts, and preserving the delta cursor as history grows.

GitOrigin-RevId: fa7e130b1212692e71a996528d8397826837a644
2026-11-23 16:14:06 +00:00
jif 22c1681aec Clean up network approvals when command startup is interrupted (#63365)
## Why

Interrupting `exec_command` while startup is pending can leave a stale
network approval registration. When the next command makes an untagged
request through the shared proxy, the stale entry makes request
attribution ambiguous and prevents an approval prompt.

## What changed

Tie the registration to the command's approval handle from startup
through completion. Remove the active entry and its stored outcome on
explicit completion or when the last handle is dropped. Cache the outcome
so that all deferred completion observers can report the same denial.

## Testing

Add a regression test that interrupts a pending launch and checks that
an untagged proxy request for the next command prompts for approval and
returns HTTP 403 when denied. Cover cleanup when the last deferred handle
is dropped and denial reuse across cloned handles.

GitOrigin-RevId: 257a32695c487a92d15937772b09085a49533fd3
2026-11-23 15:59:10 +00:00