Commit Graph

10257 Commits

Author SHA1 Message Date
ostepanian
b3f5e45cc1 Add direct SigV4 transport to exec-server (#42781)
## Why

Allow remote exec servers to connect directly to AWS-hosted registries that
authenticate registry requests and WebSocket handshakes with AWS SigV4.

## What changed

- Add `--remote-transport direct` with SigV4 profile, region, and service
  options while keeping Noise as the default transport.
- Register the `direct_jsonrpc_v1` transport and carry plain exec-server
  JSON-RPC messages over the authenticated WebSocket.
- Reuse direct registrations across transient disconnects, refresh them after
  a `409 Conflict`, and require TLS for non-loopback endpoints.

## Testing

- Cover CLI validation and SigV4 request signing.
- Exercise direct registration, handshake retry behavior, JSON-RPC
  interoperability, and process recovery after reconnecting.

GitOrigin-RevId: 0755df330ba3abe5db0a516fdaa49338d9bbe2d2
2026-09-04 14:49:46 +00:00
Chris Hayduk
c9fac4dd5a Avoid holding metadata permit during cold resume config load (#42773)
## Why

Cold `thread/resume` configuration loading can call back into the host. Holding the global metadata permit during that work blocks unrelated thread metadata updates and MCP requests.

## What changed

- Release the metadata permit while loading configuration for a cold resume.
- Reacquire the permit and reload the resolved thread history before startup.
- Reload configuration when persisted metadata, settings, or the history working directory changed during the unlocked interval.
- Rejoin a thread that another request resumed concurrently, and avoid reopening threads that were archived or deleted.

## Testing

Add coverage for unrelated metadata and MCP requests during a blocked config load, concurrent resume mutations, and the extra history read required for non-local thread stores.

GitOrigin-RevId: 8cbd3868eeff84968765b1e3dbc7590ebe5fa892
2026-09-04 14:23:27 +00:00
felixxia-oai
99d66aa1c5 Preserve acceptance order in retained thread context (#42770)
## Why

Queued prompts and `request_user_input` answers can be persisted in a different
order from when the host accepted them. Using persistence order can therefore
reorder retained instructions during replay or apply the wrong rollback
boundary.

## What changed

- Reserve an acceptance sequence for user prompts and elicitation responses
  when retained thread context is enabled.
- Persist that sequence with user-message metadata and verified answers, and
  use it when ordering, bounding, replaying, and rolling back retained context.
- Keep events without acceptance metadata compatible with legacy recording
  order.

## Testing

- Cover delayed queued-input recording, rejected prompts, checkpoint replay,
  compaction, rollback migration, and legacy retained-context behavior.

GitOrigin-RevId: 42d24465cc2033bc51c0c2da79d3c0884a8ad98a
2026-09-04 13:50:27 +00:00
jif
88f87d907a Avoid port races in streamable HTTP tests (#42767)
## Why

The test helper previously released its reserved port before starting the
streamable HTTP server. Another concurrent test could claim that port and
satisfy the readiness probe for the wrong process.

## What changed

Start the child server on an OS-assigned port and wait for it to publish its
actual bound address. Use that address to build the base URL returned to the
streamable HTTP integration tests.

GitOrigin-RevId: 606ae446f947d39424e4ec996ac647881777ff44
2026-09-04 13:35:41 +00:00
felixxia-oai
80d7ca34bc Retain user instructions in guardian thread context (#42762)
## Why

Guardian review needs the original user instructions alongside verified answers, even after compaction, resume, or rollback. A summarized or legacy checkpoint cannot establish a complete instruction history.

## What changed

- Capture text user messages in retained context when `guardian_thread_context` is enabled, preserving their message identity through compaction and replay.
- Keep retained instructions and verified answers in arrival order, with independent size and completeness tracking for each family.
- Roll back retained evidence at the exact user-message boundary, including steers that share a turn ID, and apply the same semantics during rollout migration.
- Treat checkpoints without retained user messages as incomplete while preserving their verified answers.

## Testing

- Cover capture, compaction, resume, rollback, child forks, legacy checkpoints, storage bounds, and rollout migration.

GitOrigin-RevId: 72706731b54e5ac8645db61b446d2401afb42235
2026-09-04 13:24:42 +00:00
jif
cc4b8bdeb8 Propagate response tickets to Guardian reviews (#42758)
## What changed

- Request and parse server-issued Guardian tickets for eligible Codex backend responses.
- Scope each ticket to the response that produced a Guardian review or classifier request, including HTTP and WebSocket retries, without adding it to model-visible or persisted context.
- Validate ticket shape, reserve its metadata keys, redact it from debug and request-body logging, and attach it only at the Guardian transport boundary.

## Testing

- Cover ticket parsing, endpoint and authentication routing, retry scoping, classifier retries, and redaction for compressed and uncompressed requests.

GitOrigin-RevId: 6219dd15c9f19ed3387de516aac1b8e7c9cdb0e3
2026-09-04 12:56:26 +00:00
jif
97e46694e1 Stabilize the interactive tmux startup safety test (#42755)
## What changed

- Wait for the directory trust prompt before shutting down the TUI.
- Retry the decline key while the trust screen drains pending input, and keep
  consuming PTY output until the process exits.
- Include captured TUI output when shutdown times out.

GitOrigin-RevId: cb88523a72915787a436da4f16fb13450fa7a175
2026-09-04 12:48:10 +00:00
jif
1cd78651e2 Preserve response IDs for fast collaborator tool events (#42752)
## Why

Collaborator tools can finish before their sampling response arrives, causing
their analytics events to be emitted without response correlation.

## What changed

Hold completed collaborator tool events until the reducer can attach their
originating and subsequent response IDs.

## Testing

Add coverage for both orderings of collaborator completion and sampling
response arrival.

GitOrigin-RevId: 5933424dd90702685cdb4a9693fed96c7885989a
2026-09-04 12:39:40 +00:00
Felipe Coury
a1294e57f1 Improve automatic thread naming in the TUI (#42749)
## Why

Automatic title generation used a provisional thread name and only applied the
generated result while its thread remained active. Switching threads could
therefore leave the originating thread without its generated name.

## What changed

- Track title-generation requests by thread so results are persisted for the
  originating thread, while preserving any name set before generation finishes.
- Show a `renaming...` spinner instead of a provisional name, including across
  thread switches and failure paths.
- Add `thread-name` items to the status line and terminal title, and include the
  generated thread name in both default layouts.

## Testing

- Cover automatic naming, manual-name precedence, thread switching, failed
  requests, deduplication, and status-surface rendering and animation.

GitOrigin-RevId: a03ae4849bedec9f62f256fadad72c1685ce46e0
2026-09-04 12:20:57 +00:00
jif
8e85265c39 Handle pending network reviews after process completion (#42746)
## Why

A remote process can finish while a network policy review is still pending. Normal process cleanup should withdraw that review without turning the completed command into a review failure or losing its output.

## What changed

- Record whether a network policy request was withdrawn because the process finished, was cancelled, lost its executor connection, or timed out.
- Treat normal process completion as cleanup while retaining fail-closed behavior for other cancellation causes.
- Preserve explicit network denials before policy persistence so cleanup cannot replace the reported call outcome.

## Testing

Add an integration test that completes a remote process during a pending network review and verifies that the command reports its successful exit and output without approving the withdrawn request.

GitOrigin-RevId: 7f42d75631ee29eba43bf04cc953eea490f553fc
2026-09-04 12:08:02 +00:00
jif
4e48cd02da Honor model-provided Guardian review policies (#42744)
## What changed

- Add optional per-model Guardian modes for computer use, shell, code mode,
  file changes, MCP, network, and permission requests.
- Apply disabled, synchronous, or adaptive review by action category while
  preserving legacy configuration when model policy is absent.
- Bind cached risk scores to the active model policy, thread settings, and
  environment selections so outdated scores cannot approve later actions.
- Keep unknown review modes on the synchronous path and ignore unknown policy
  fields for forward compatibility.

## Testing

- Cover policy serialization, legacy fallback, scoped tool classification,
  disabled categories, and score invalidation after policy changes.

GitOrigin-RevId: f334a5f4fffb198da66cde3a400233e0df650516
2026-09-04 11:59:18 +00:00
jif
9d253c885c Make the TUI symlink startup test Bazel-compatible (#42741)
## Why

The macOS startup symlink test applies its own Seatbelt policy, which cannot
run inside Bazel's sandbox.

## What changed

- Tag the TUI Bazel tests with `no-sandbox` so the startup test can install
  its policy.
- Verify that the mocked write tool reports a successful exit before checking
  the file written through the symlink.

GitOrigin-RevId: c12eb00f995985fccc053765399fbb0eb7ce70d9
2026-09-04 11:43:37 +00:00
jif
3c837e568c Gate unified exec TTY support behind a feature flag (#42718)
## What changed

- Add the stable, default-on `unified_exec_tty` feature.
- When disabled, omit `tty` from the `exec_command` tool schema and reject calls that explicitly request a TTY.
- Continue to support commands that omit `tty` or set it to `false`.

## Testing

- Add unified exec coverage for the disabled tool schema, explicit TTY rejection, and non-TTY command execution.

GitOrigin-RevId: c5934fe9db1423170b891c7ecd0188792cd03f42
2026-09-04 10:22:43 +00:00
jif
d13aeb77ea Allow trusted symlinks beneath CODEX_HOME on macOS (#42716)
## What changed

- Add the macOS-only `allow_symlinked_codex_home` user setting. When enabled in the execution host's `$CODEX_HOME/config.toml`, writable roots at or beneath that home may traverse symlinks.
- Keep the exception disabled by default and prevent project config, command-line overrides, and ignored user config from enabling it. Other writable roots remain subject to symlink checks.
- Propagate the resolved setting through local, interactive, and exec-server sandbox paths, including `CODEX_HOME` aliases.
- Explain the opt-out in symlink rejection errors, including that it trusts targets outside `CODEX_HOME` and targets that change between commands.

## Testing

- Add macOS coverage for shell commands, patches, filesystem helpers, process execution, and interactive startup with enabled, disabled, aliased, and out-of-scope homes.

GitOrigin-RevId: 99fcdf611200c9e1b7713cf06f7fdea5bfa7f089
2026-09-04 10:12:03 +00:00
Benjamin Carlsson
8e6a44b428 Fix the worktrees experimental feature test fixture (#42682)
## What changed

Construct the worktrees entry in `experimental_features_popup_snapshot` with
its string feature key and mark it writable, matching the current
`ExperimentalFeatureItem` fields.

GitOrigin-RevId: c12cd3d472504777e77d21a13a276e1d2381e85f
2026-09-04 06:14:15 +00:00
rka-oai
f3f6922519 Narrow async user message guidance (#42677)
## What changed

Remove guidance that told `send_message_to_user_async` to request missing
information, preferences, constraints, clarification, or approval. Keep the
tool focused on critical blockers, direction-changing findings, and replies to
user questions or status requests during ongoing work.

GitOrigin-RevId: c764ffc2b9c14e37467bd25ee3ed07407d550290
2026-09-04 05:20:06 +00:00
Benjamin Carlsson
1b53f6a44e Add WebRTC negotiation to the voice host (#42676)
## What changed

- Add helper protocol requests to create a WebRTC offer, apply an answer, and report readiness once the ordered `oai-events` data channel opens.
- Support UDP and TCP candidates while bounding signaling size, remote candidates, inbound TCP streams, and WebRTC buffers. Redact session descriptions and peer errors from diagnostics.
- Close unexpected remote data channels and tear down the peer during helper shutdown, including when the parent pipe is lost during startup.

## Testing

- Exercise offer/answer negotiation and clean shutdown over real UDP and TCP sockets.
- Cover signaling validation, candidate and connection limits, early packet loss, slow TCP connection setup, and blocked-startup parent loss.

GitOrigin-RevId: 5f5e60a3a4d1d8eaca2e4724e66284f54061b6af
2026-09-04 05:07:02 +00:00
Eric Traut
048a936a23 Persist server-advertised experimental features from the TUI (#42674)
## What changed

- Save writable `/experimental` selections through `config/batchWrite`, including features that are not known to the local client.
- Refresh configured values after writes and surface timeouts, failures, and higher-priority overrides without changing the active task's settings.
- Serialize saves and discovery, let accepted writes finish after the popup closes, and retain uncertain selections for explicit retry.

## Testing

- Cover new server feature keys, server defaults, overrides, write and readback failures, timeouts, selected config profiles, and popup retry behavior.

GitOrigin-RevId: acee4e10cbb8c2fce9211e8fadd3cd67fa0eb1a5
2026-09-04 04:55:40 +00:00
Eric Traut
b995d06050 Preserve TUI sessions while starting replacement threads (#42671)
## Why

Starting a replacement thread can fail while reading configuration or calling
`thread/start`. The active thread and any composed input should remain available
when that happens. Remote app servers also need new threads to use their own
effective defaults instead of stale client-side model settings.

## What changed

- Read effective server configuration before starting a replacement thread,
  while preserving explicit model and reasoning-effort launch settings.
- Keep the current thread, configuration, subscriptions, and composer input
  intact until `thread/start` succeeds.
- Fall back to local defaults when an older server does not support
  `config/read`.

## Testing

Added coverage for server and managed defaults, explicit launch overrides,
remote working directories, older servers, and failures during configuration
reads or thread startup.

GitOrigin-RevId: 507a918ea2bf79c9f0adbb189bc611ecf57b757a
2026-09-04 04:45:44 +00:00
ningyi-oai
ea2046f36d Cancel remote control enrollment on stdio shutdown (#42668)
## Why

A pending remote control enrollment could prevent the app server from exiting
after stdio EOF, leaving resources such as thread writers held by the process.

## What changed

- Give remote control its own child shutdown token and cancel it before draining
  RPCs when the stdio connection closes.
- Interrupt enrollment requests that require network access after shutdown has
  begun, while still allowing in-memory or persisted enrollments to be enabled
  and durably saved.

## Testing

- Cover stdio shutdown during a blocked enrollment and verify that another app
  server can acquire the released thread writer.
- Cover durable enablement after shutdown with in-memory, persisted, and missing
  enrollments.

GitOrigin-RevId: ef9ab49672f273a4cf8257188454a154c03088bd
2026-09-04 03:40:37 +00:00
Eric Traut
ff2f01b0c2 Tailor TUI cyber refusal notices to Daybreak eligibility (#42667)
## What changed

- Prefetch ChatGPT account eligibility in the background and cache it across TUI widget replacements.
- Show an application link when Daybreak is available but not enabled, an Astra-specific explanation for unsupported models, and neutral copy when access is already present or eligibility cannot be determined.
- Refresh eligibility after account changes and reconnects without changing the selected model or delaying refusal handling.

## Testing

- Cover eligibility responses, account changes, model-specific notices, fallback behavior, and rendered notice snapshots.

GitOrigin-RevId: 7ae8613a946cb46b8f0b46bf47e5e15ae258ed86
2026-09-04 03:30:21 +00:00
Adam Perry @ OpenAI
a7ab2d66d7 Use a generic fallback model name in status tests (#42657)
GitOrigin-RevId: d6566e2b5f427aeb198bfd326886c0977b545590
2026-09-04 02:24:54 +00:00
Adam Perry @ OpenAI
e8b65624e0 Update the stable exec-server test to Codex 0.153.1 (#42654)
## What changed

Point the stable exec-server compatibility test at the pinned Codex 0.153.1
Linux x86_64 release and update the release archive checksum.

GitOrigin-RevId: ebbce8d61811ccea09adf7539cd7a85f24cbf97a
2026-09-04 02:05:47 +00:00
Benjamin Carlsson
eb5a00b068 Add managed worktrees to codex exec (#42652)
## What changed

- Add the experimental `worktrees` feature and a shared `--worktree` flag for new and forked `codex exec` sessions.
- Create each enabled session in a managed Git worktree, use that checkout as the session working directory, and bind the checkout to the new thread.
- Share the configured worktree pool with Desktop while leaving automatic cleanup disabled for CLI allocations.
- Reject unsupported commands, remote execution, ignored user configuration, ephemeral sessions, and use without the feature enabled before allocating a worktree.

## Testing

- Cover flag placement and inheritance, supported and rejected command combinations, worktree allocation and thread ownership, configuration gating, and compatibility with existing worktree-backed sessions.

GitOrigin-RevId: 011ff4639b09e8992c50d7b823df23e71798670e
2026-09-04 01:56:38 +00:00
Ian MacLeod
f46671b14a Render assistant file citations as local links (#42650)
## What changed

- Convert `codex-file-citation` directives in assistant Markdown into local-file links while preserving paths with Markdown-significant characters, Unicode, Windows separators, and location suffixes.
- Apply citation rendering consistently to streaming output, finalized messages and plans, and resume-picker transcript previews.
- Keep directives literal in code, HTML, existing links, reference definitions, escaped text, and generic Markdown rendering.
- Bound repeated parsing work for malformed directive candidates without limiting valid citations.

## Testing

- Add coverage for citation parsing and rendering across finalized, streaming, and resume-preview output, including malformed input and path edge cases.

GitOrigin-RevId: 5a0bfb3fc7ac21b7e8846fd170a349fb2d2d5e85
2026-09-04 01:46:55 +00:00
Felipe Coury
956aa3f637 Restore the inline TUI after full-screen overlays (#42641)
## Why

Leaving an alternate-screen overlay in inline mode could retain stale overlay
cells and leave conversation history scrolled out of view.

## What changed

- Invalidate the restored inline viewport after leaving the alternate screen so
  the next draw repaints it against the main screen.
- Reflow transcript history once when a full-height inline viewport returns to
  the shorter chat layout, including transitions not tracked by the agents
  overview.

## Testing

Added regression coverage for repainting the restored composer and rebuilding
history exactly once after a full-screen overlay closes.

GitOrigin-RevId: c6d63299fd95731603d8b1d7f04afcd4b92c1681
2026-09-04 00:39:56 +00:00
Ian MacLeod
0305dde920 Harden TUI parsing of assistant markup (#42640)
## What changed

- Add a shared parser for assistant directives that handles quoted and unquoted attributes, embedded braces, escaped quotes, and malformed input consistently.
- Use the parser for Git action receipts and code comments, including Git actions that follow a rendered code comment on the same line.
- Parse `file://` links with `PathUri` so Windows drive and UNC paths render correctly regardless of the TUI host while preserving line and column anchors.

## Testing

- Add unit coverage for directive grammar and snapshot coverage for code comments, Git actions, and foreign Windows file links.

GitOrigin-RevId: 8252b3254b92ec6943096026e74c19160c4e24cc
2026-09-04 00:31:51 +00:00
Eric Traut
68e9c4a31a Warn when saved model defaults are overridden (#42639)
## Why

A model-default config write can succeed even when a higher-priority configuration layer overrides the saved value, leaving the TUI's success message misleading.

## What changed

- Show a warning when saved model, reasoning-effort, or service-tier defaults are overridden.
- Preserve the active conversation's explicit selection while reporting the saved default's effective status.

## Testing

- Cover successful, overridden, and rejected writes against the app server's target config profile.

GitOrigin-RevId: 6720d66a58629447b71cd9363c9e08c1c5b9edc1
2026-09-04 00:23:45 +00:00
rhan-oai
0e0f55fc4e Update GPT-6-Astra Fast tier speed description (#42638)
## What changed

Describe the `gpt-6-astra` Fast service tier as providing 2x speed with
increased usage.

GitOrigin-RevId: a5b470dc598d23aea312172986823212922219f9
2026-09-04 00:12:18 +00:00
Krish Chainani
03467026f2 Add an injectable attachment store to ThreadManager (#42634)
## What changed

- Add the `codex-attachment-store` crate with storage-neutral attachment metadata, references, errors, and an asynchronous persistence interface.
- Provide an inline implementation that preserves attachment bytes as media-typed base64 data URLs.
- Inject the store into `ThreadManager`, expose it to consumers, and retain inline storage as the default for existing entry points.

## Testing

- Verify inline storage round-trips binary, text, PNG, and JPEG data.
- Verify attachment debug output redacts URLs while retaining file IDs.

GitOrigin-RevId: 7688dcd3c89d7540ed2398f3e7c63881fbfcda97
2026-09-03 23:20:54 +00:00
Benjamin Carlsson
d979df154c Initialize the packaged GStreamer runtime in the voice host (#42631)
## Why

The voice helper previously supported only handshake and shutdown, without
validating that its packaged native runtime could be initialized safely.

## What changed

- Add an `initializeRuntime` protocol exchange that loads GStreamer and the
  required plugins from physical package paths without opening audio devices.
- Restrict plugin discovery, registry access, and native library search paths,
  and keep loaded libraries alive until the helper exits.
- Give initialization a dedicated deadline and terminate the owned helper when
  initialization is cancelled or fails.
- Allow binary-only Rust targets to disable the default Bazel library target.

## Testing

- Cover helper-only packages, cancellation, and environment filtering.
- Add an ignored integration test for initialization from a relocated prepared
  runtime and rejection of duplicate initialization.

GitOrigin-RevId: 8fff68fe26e52cb2e0722dc98fb5f124eddb0d4d
2026-09-03 22:53:45 +00:00
Krish Chainani
280ae8b9fc Centralize prompt image detail modes (#42624)
## What changed

- Add `PromptImageMode::HIGH_DETAIL` and `PromptImageMode::ORIGINAL_DETAIL`
  constants with the standard resize limits.
- Use the shared modes during core image preparation instead of defining the
  limits locally.
- Cover the dimension and patch budgets for both detail modes in the image
  utility tests.

GitOrigin-RevId: 27fdc77719f23d2e8f1060886576b3be843a8491
2026-09-03 22:22:48 +00:00
bkotsopoulos
781c183c3b Bound Noise handshakes by the exec server initialization timeout (#42623)
## What changed

- Wait for the authenticated Noise handshake before sending the JSON-RPC
  `initialize` request.
- Share the configured initialization timeout across the handshake and RPC,
  while preserving the configured duration in timeout diagnostics.
- Record the handshake and initialization RPC as child spans of the existing
  initialization span, and terminate transport tasks when handshake readiness
  fails.

## Testing

- Cover stalled handshake timeouts and cleanup of the underlying WebSocket.
- Cover timeout reporting after the handshake has consumed part of the budget.

GitOrigin-RevId: c3eb5f7cfedd8d155fde5b7614fc2eb399ce337c
2026-09-03 22:16:19 +00:00
Celia Chen
1f7b99922a Add GPT-6-Astra to Amazon Bedrock catalogs (#42619)
## What changed

- Add `openai.gpt-6-astra` to the Amazon Bedrock model catalog.
- Include its global and US cross-region variants in the Bedrock Runtime catalog.
- Preserve the bundled model metadata while applying Bedrock-specific capabilities and identifiers.

## Testing

- Cover catalog ordering, metadata, context-window overrides, and runtime routing variants.
- Add TUI snapshots for the Bedrock model and reasoning pickers.

GitOrigin-RevId: 25895174f00b85a738da5bb94ade82feaacb474c
2026-09-03 21:21:09 +00:00
Ian MacLeod
32c303c197 Condense TUI startup warnings (#42609)
## What changed

- Coalesce configuration, skill, sandbox, and MCP startup diagnostics into a single summary below the session header, including MCP and sign-in counts.
- Keep the complete warning text in the transcript and update the summary's transcript shortcut when key bindings change.
- Continue rendering warnings that arrive after work begins as inline history entries.
- Hide the MCP startup status row before a turn while preserving the configured interrupt shortcut.

## Testing

- Add coverage for warning ordering and deduplication, transcript details, MCP sign-in counts, resumed sessions, runtime warnings, reflow, backtracking, and interruption without a visible status row.

GitOrigin-RevId: 009657cf04f1d3a52270cf096eebf9db7513c040
2026-09-03 20:25:59 +00:00
rhan-oai
ed391d4dd2 Add GPT-6-Astra to the bundled model catalog (#42607)
## What changed

- Add the hidden `gpt-6-astra` model definition, including its reasoning levels,
  tool capabilities, context limits, agent instructions, and review policies.
- Reorder existing model priorities around the new catalog entry and provide the
  browser-use policy to the bundled auto-review model.
- Keep TUI snapshots pinned to `gpt-5.6-sol` and make Guardian coverage read the
  policy from the model selected by each test case.
- Allow the expanded `models.json` through the repository blob-size check.

GitOrigin-RevId: 039b224b91ca35c8d894cf6d23568bc6dc18ceeb
2026-09-03 20:05:58 +00:00
ostepanian
801ca0d0d1 Support trusted headers for remote exec WebSockets (#42606)
## What changed

- Add `RemoteEnvironmentOptions` and `upsert_environment_with_options` so embedding hosts can attach trusted HTTP headers to remote exec-server WebSocket handshakes.
- Preserve the headers across session reconnects while redacting them from debug output.
- Reject invalid, duplicate, and WebSocket-controlled headers, and require `wss://` for non-loopback destinations.
- Connect header-bearing loopback WebSockets directly, with DNS results restricted to loopback addresses.

## Testing

- Cover header validation and redaction, delivery on initial connections and reconnects, and loopback destination enforcement.

GitOrigin-RevId: f2e2b0456c8e33c13fd8ab4ee040a8b5c15e885d
2026-09-03 20:01:07 +00:00
ostepanian
7eee24ef51 Expose global metrics installation in codex-otel (#42603)
## What changed

Add `install_global_metrics` as the public entry point for installing an
externally managed, non-Statsig `MetricsClient` during single-threaded startup.
The returned handle retains ownership of the installed exporter so callers can
flush and shut it down.

GitOrigin-RevId: 1108a0468588046e5cc8266d2af6143f14456d82
2026-09-03 19:49:13 +00:00
yansenzhou-oai
f84c9776dc Deprecate detached review delivery (#42602)
## What changed

- Emit a connection-scoped `deprecationNotice` when `review/start` uses
  `delivery: "detached"`, including when validation later rejects the request.
- Preserve detached review behavior while directing callers to use `thread/start`
  followed by an inline review for a separate review thread.
- Document the deprecation and migration options in the app-server protocol and
  README.

## Testing

- Cover the notice for accepted and rejected detached reviews.
- Verify that omitted, null, and inline delivery do not emit the notice.

GitOrigin-RevId: 4234a09d2bb7ef8053091580175dc8cbe8d7512c
2026-09-03 19:36:11 +00:00
victor-openai
8f31b64c7f Report MCP tool discovery errors in server status (#42598)
## Why

An empty tool map does not distinguish a successfully returned empty catalog from a server whose startup or tool discovery failed.

## What changed

- Add nullable `toolsError` to each `mcpServerStatus/list` entry when no catalog is available because startup or tool discovery failed.
- Keep `toolsError` null for returned catalogs, including cached and empty catalogs, and continue returning healthy servers when another server fails.
- Update the protocol schemas and generated TypeScript type.

## Testing

- Extend the app-server status integration test with a broken MCP server and verify its error without losing the healthy server's inventory.

GitOrigin-RevId: 30b4ca4d9a45cec6998f5f626d3fddbee90a525d
2026-09-03 18:36:58 +00:00
iceweasel-oai
f60dfe80b5 Record Windows sandbox private desktop usage (#42596)
## What changed

Increment the `codex.windows_sandbox.private_desktop` counter when preparing a
Windows restricted-token sandbox execution, tagging it with whether private
desktop isolation is enabled.

GitOrigin-RevId: 1eb5e183b57e19753dc133dbe152eabe23dd2a23
2026-09-03 18:25:13 +00:00
victor-openai
2387310b52 Reload user config after local plugin installation (#42593)
## Why

Loaded threads can retain their previous configuration after a local plugin is
installed, preventing the plugin's bundled MCP servers and pending user-config
changes from taking effect in the current session.

## What changed

- Reload user configuration for loaded threads after installing a local plugin.
- Refresh MCP and hook runtimes only after the new configuration is applied.
- Keep installation successful if configuration reload fails, while logging the
  failure.

## Testing

- Verify an installed plugin's MCP tool can be called from a thread that was
  started before installation.
- Update the hook runtime test to verify installation applies a staged hook
  configuration change to the loaded session.

GitOrigin-RevId: 63f5a5c7f16303e51cf940e8d9dc3b45c50ae2a9
2026-09-03 18:20:59 +00:00
Won Park
ec84e69261 Harden the macOS sandbox against terminal input injection (#42590)
## Why

Sandboxed commands inherit the user's controlling terminal. Without an explicit
restriction, a child can use `TIOCSTI` to queue input for the unsandboxed shell
that resumes after Codex exits.

## What changed

Append a `file-ioctl` denial for `TIOCSTI` after the shared Seatbelt policy
allowances used by `codex sandbox`.

## Testing

Add a macOS PTY integration test that first proves terminal input injection
works without the sandbox, then verifies Seatbelt rejects it with `EPERM`.

GitOrigin-RevId: 5a8b0a5b4fd980cc406ad184d04ceae9b0ea90e4
2026-09-03 18:00:14 +00:00
felixxia-oai
ad8ee16a5f Require Guardian review for incompatible compaction checkpoints (#42588)
## Why

Guardian can reuse an opaque parent compaction only when the checkpoint's
recorded producer hash matches the scoring model. Missing or incompatible
provenance must not allow an asynchronous score or cached approval to omit
compacted context.

## What changed

- Record the producing model's compatibility hash on compaction history items
  and expose the latest checkpoint hash through conversation snapshots.
- In thread-owned context mode, fail closed and require synchronous review when
  checkpoint reuse is enabled but the latest checkpoint is incompatible or has
  unknown provenance.
- Reject incompatible checkpoints in the sampler while preserving the legacy
  context behavior.

## Testing

Add coverage for local, remote, resumed, compacted, and rolled-back histories,
including matching, mismatched, missing, and empty compatibility hashes.

GitOrigin-RevId: 1ce959cb276edc602fd7dfa442133c7fe5e53857
2026-09-03 17:48:15 +00:00
Benjamin Carlsson
1d6727c0b5 Recover Vim escape input in legacy terminals (#42584)
## Why

Legacy terminals encode `Alt` plus a character the same way as `Esc` followed
by that character. In Vim insert or replace mode, typing a command immediately
after `Esc` could therefore leave the composer in the wrong mode.

## What changed

Recover ambiguous input as separate `Esc` and character events when Vim mode
can consume the escape. Preserve active `Alt` bindings, key chords, image
paste, agent navigation, enhanced-key terminals, and AltGr input.

## Testing

Add coverage for recovered Vim commands and for each shortcut and terminal
case that must retain its existing behavior.

GitOrigin-RevId: 3d8464d805f95f677cce5c46ae00338e611d776a
2026-09-03 17:28:48 +00:00
felixxia-oai
1d74c3ba1e Persist verified user answers in Guardian thread context (#42579)
## Why

Guardian authorization reviews need host-verified `request_user_input` answers to
remain aligned with thread history across compaction, resume, and rollback.

## What changed

- Record verified question-and-answer pairs in retained thread context when
  `GuardianThreadContext` is enabled, and source both local and delegated Guardian
  review evidence from that context.
- Preserve complete answer records within the evidence budget. Mark authorization
  context incomplete when records are unavailable or oversized, and defer cached
  fast approvals in that case.
- Keep the existing runtime-only answer path for threads that do not enable the
  thread-owned context.

## Testing

- Cover answer retention through compaction and resume, removal after rollback,
  source-call eviction, oversized answers, delegated review evidence, and legacy
  behavior.

GitOrigin-RevId: 01f6f4541515434a0d00fdde318ff59f2f8bd2eb
2026-09-03 16:41:11 +00:00
iceweasel-oai
7a7c188682 Preserve target-native paths in command approvals (#42577)
## What changed

- Pass the selected executor's `PathUri` through user command approval requests instead of converting the working directory to a host-native path.
- Make native-path permission helpers explicitly local and require executor-aware permission transforms to receive a `FileSystemSandboxPolicyContext`.
- Cover approved remote commands to verify that the approval request reports the selected remote working directory and execution resumes after approval.

GitOrigin-RevId: 0aa3042f2d7594af6c7d0abf31d7f99cf67d5556
2026-09-03 16:21:10 +00:00
Alex Kotliarskyi
0650d6d1ca Preserve MCP authentication challenges on tool calls (#42552)
## Why

When silent OAuth refresh cannot recover a rejected MCP tool call, the caller
needs the server's authentication challenge to initiate interactive login. The
rejected call must not be replayed automatically after refresh has failed.

## What changed

- Convert `401 Unauthorized` responses with `WWW-Authenticate` headers into an
  MCP tool error containing `mcp/www_authenticate` metadata.
- Preserve multiple authentication challenges by combining all
  `WWW-Authenticate` header values.
- Keep successful silent refresh behavior while avoiding replay when refresh
  fails.

## Testing

Added coverage for successful and failed refresh, multiple authentication
headers, propagation through agent tool-call events, and no-replay behavior.

GitOrigin-RevId: c560cff6286d7ab09b1f5c6cf3618d4650cde47d
2026-09-03 15:12:02 +00:00
felixxia-oai
6d7f6dcd22 Register the Guardian thread context feature flag (#42529)
## What changed

- Add the disabled, under-development `guardian_thread_context` feature flag for selecting thread-owned context for Guardian reviewers.
- Expose the boolean setting in the generated configuration schema.
- Verify default, base configuration, and profile override resolution.

GitOrigin-RevId: c4878be96d12f4ccd84356df15d3e55f13ac141f
2026-09-03 14:35:02 +00:00
Can Sar
728cb12fe5 Expose thread originators through the app-server API (#42458)
## What changed

- Add the creation-time `originator` to app-server thread responses and `thread/started` notifications.
- Persist originators in thread metadata and preserve the first recorded value across list, read, resume, rollout, and SQLite paths.
- Add an `originators` allowlist to `thread/list` for hosted backends. The local app-server accepts omitted or empty values but rejects nonempty filters.

## Testing

- Cover originator persistence across server restarts and list, read, and resume requests.
- Verify local `thread/list` handling for nonempty, omitted, null, and empty originator filters.
- Heap-allocate large TUI dispatcher futures in affected tests to keep them within the Windows test-thread stack.

GitOrigin-RevId: 73ad6e61b8fdd2d93a22d1f971723a19ec7be3fc
2026-09-03 06:02:25 +00:00