Commit Graph

1890 Commits

Author SHA1 Message Date
Owen Lin
cbb7e82a8b Unify turn input submission and routing (#38275)
## What changed

- Add `TurnInputRequest` and typed submission results for atomically starting a turn, steering the active turn, or declining input with a specific reason.
- Expose `start_or_steer_turn`, `start_turn_if_idle`, and `steer_turn` on `CodexThread`, and migrate Core consumers to these APIs.
- Make app-server `turn/start` steer an active regular turn and return that turn's ID. Reject incompatible output schemas and non-steerable turns without applying settings or enqueueing input.

## Testing

- Cover concurrent start-or-steer submissions, accepted and rejected settings updates, output-schema compatibility, idle-start rejection, and app-server steering.

GitOrigin-RevId: dd9b5528d76ec650c019e97af420bc13190ea86a
2026-08-13 00:00:16 +00:00
Tamir Duberstein
4b07886d59 Represent persisted world state as JSON objects (#38274)
## Why

World-state snapshots and merge patches are keyed collections of sections. Allowing
their persisted `state` field to contain any JSON value required replay code to
handle shapes that cannot represent world state.

## What changed

- Type `WorldStateItem.state` and snapshot patches as JSON object maps.
- Reconstruct full snapshots directly from those maps and apply patches without
  fallible arbitrary-value conversions.
- Regenerate the app-server protocol schema for the object-only representation.

GitOrigin-RevId: 3d7662b74f3dd1f3ccc5fdd0200074c13a73cbe5
2026-08-12 23:56:45 +00:00
ashwinnathan-openai
361fe2d202 Stamp conversation history items with creation times (#38272)
## What changed

- Add fractional Unix creation times to locally authored user, developer, agent, and tool-output items when they enter durable conversation history.
- Preserve any creation time already supplied with an item across subsequent requests, remote compaction, and resumed history.

## Testing

- Cover timestamp assignment and preservation in session, client, tool, agent-spawn, and remote-compaction tests.

GitOrigin-RevId: 431d1770b9746005c808bc0a43953845166d68ad
2026-08-12 23:04:42 +00:00
jif
130c7c93a9 Resolve skill package aliases in skills.read (#38261)
## Why

Skill catalogs can present shortened package locators, but callers previously had
to expand those aliases before reading a skill.

## What changed

- Resolve catalog aliases automatically when `skills.read` looks up a
  model-visible executor or orchestrator skill package.
- Update skill prompts and tool documentation to tell models to pass the listed
  package locator directly.

## Testing

- Exercise reading an executor skill through its shortened package locator when
  the skills catalog exceeds its context budget.

GitOrigin-RevId: d1cdfd64002510b616146929deb5b7077850b951
2026-08-12 22:10:55 +00:00
cooper-oai
18dcc7646f Unify external authentication provider handling (#38258)
## What changed

- Use each `ExternalAuth` provider's error classification for resolve, refresh,
  and validation failures.
- Allow runtime providers to be replaced, clearing any recorded permanent
  refresh failure after the replacement resolves successfully.
- Preserve workload identity as immutable, host-managed authentication while
  sharing external ChatGPT credentials through the process-local store.

## Testing

- Cover provider replacement after a permanent failure, provider-defined error
  classification, workload identity immutability, and refreshed headers after
  an unauthorized response.

GitOrigin-RevId: ec75cf9224dc82d3fd10063606c724e3b06fb1e7
2026-08-12 22:04:27 +00:00
Dylan Hurd
020f6c963e Report the latest rejection from multiple network reviews (#38256)
## Why

A single execution can trigger multiple network approval reviews. Its tool
result should reflect the latest specific rejection.

## What changed

- Let each explicit network review outcome replace the previously recorded
  outcome for the execution.
- Keep generic blocked-request messages as fallbacks that cannot overwrite an
  explicit review outcome.

## Testing

- Add unit coverage for outcome precedence.
- Add an integration test that rejects two network requests from one execution
  and verifies that only the latest rejection is returned.

GitOrigin-RevId: 644a01e5c49855adcdc48ba8f91baededce26875
2026-08-12 21:55:31 +00:00
Kyle Brown
9ca0337dbf Collect metrics from plugin shell commands (#38252)
## What changed

- Provide matching local plugin commands with a sandbox-writable temporary output file through `CODEX_PLUGIN_METRICS_OUTPUT` when analytics is enabled.
- Validate successful command output against the plugin's `analytics.yaml` declaration, including measurement names, enum dimensions, finite values, duplicate rows, and size limits, before publishing analytics events.
- Keep the output path reserved from user overrides and clean up the temporary file after execution.

## Testing

- Cover output validation, limits, cleanup, sandbox permissions, environment handling, and path replacement.
- Verify measurement collection through both classic and zsh-fork shell runtimes.

GitOrigin-RevId: 88af0f87dc2f207fcbcca6af498f5c940d79349d
2026-08-12 21:23:21 +00:00
pakrym-oai
8bb8d60234 Read model ETags from WebSocket metadata events (#38251)
## What changed

- Extract `x-models-etag` from `codex.response.metadata` events and emit it as a `ModelsEtag` response event.
- Stop reading or reporting the model ETag from WebSocket upgrade headers.

## Testing

- Update the WebSocket response-stream test to deliver the ETag through a metadata event and verify that it is emitted.

GitOrigin-RevId: 9b9cff3d8a0a914549aca62d8d316483a9a47f69
2026-08-12 21:18:15 +00:00
xl-openai
379cb68444 Add dynamic HTTP header helpers for MCP servers (#38245)
## What changed

- Add `http_headers_helper` configuration for local streamable HTTP MCP servers. The configured shell command runs once per connection and returns a JSON object of headers that is cached across requests.
- Apply helper headers to MCP startup and OAuth flows while restricting them to the server origin, stopping redirects, rejecting reserved or duplicate headers, and enforcing output and execution limits.
- Reject helpers for remote or managed-disabled servers, use the local environment working directory, and redact helper commands from `codex mcp list` and `codex mcp get` output.

## Testing

- Cover configuration validation, helper lifecycle and output parsing, origin isolation, OAuth discovery and token refresh, managed requirements, environment selection, and CLI redaction.

GitOrigin-RevId: 84e0e26ce75520b0869d37c72b1678e033bd6818
2026-08-12 20:36:32 +00:00
rka-oai
0e0ef5d818 Track client-authored developer messages in rollout history (#38243)
## What changed

- Mark developer messages received from clients with `client_authored` harness
  metadata when `retain_client_developer_messages` is enabled.
- Carry that provenance through pending input and persist it alongside rollout
  response items without adding it to provider requests or the serialized
  `TurnInput` payload.
- Preserve existing behavior for unannotated response items and when the
  feature is disabled.

## Testing

- Cover client item injection before and during turns, additional application
  context, rollout replay, image resize notices, and serialization boundaries.

GitOrigin-RevId: f385c177732becde732272e4b8440eb91f5c1039
2026-08-12 20:05:49 +00:00
Ankush Gupta
74004b5397 Include Node REPL policy in turn metadata (#38241)
## What changed

- Parse `node_repl_auto_review_required` and `node_repl_disabled` from model catalog entries and include their values in each turn's Responses API metadata.
- Treat both fields as reserved metadata so client-provided values cannot override the selected model's policy.
- Use the selected review model's catalog entry when building metadata for review turns.

## Testing

- Cover metadata propagation across model switches, review turns, Responses API requests, and MCP tool calls.

GitOrigin-RevId: c1f63426eeb8e559abff439fbc618716a4908aff
2026-08-12 19:37:51 +00:00
Eddie Chen
1f4ea79853 Track root turns across delegated Codex requests (#38232)
## Why

`parent_turn_id` identifies the immediate caller of a nested request, but not the
top-level turn that initiated a multi-level chain of work.

## What changed

- Add `root_turn_id` to turn state, submissions, and Responses API metadata.
- Propagate the root through spawned agents, delegated work, review sessions, and
  turn-triggering inter-agent messages.
- Omit the root when background work has no user turn or combined input makes the
  root ambiguous.

## Testing

Added coverage for nested agent resumes, reviews, mailbox delivery, steered input,
and reserved metadata handling.

GitOrigin-RevId: 60057db2ee81f4efefa946a9f63c74ff98b93929
2026-08-12 18:11:13 +00:00
jif
7093e8c480 Start required cached MCP servers lazily for subagents (#38217)
## Why

Subagents can reuse cached MCP tool definitions without opening another server
connection immediately, but marking a server as required previously forced eager
startup even when its cached tools were available.

## What changed

- Allow required MCP servers with usable cached tools to remain dormant under
  the lazy startup policy.
- Treat those cached tools as satisfying required-server validation and tool
  catalog capture until the server is needed.
- Preserve eager startup for required servers without cached tools and start a
  dormant server when one of its tools is called.

## Testing

Extend the cached HTTP MCP subagent test to cover both optional and required
servers, verifying that the required server stays dormant until its cached tool
is called.

GitOrigin-RevId: 48ea20b9ae447eef27461caee2320ea78465bb6a
2026-08-12 16:50:23 +00:00
Dylan Hurd
95aada11c4 Enforce non-interactive approval policy for Codex delegates (#38205)
## What changed

- Require delegated Codex sessions to use the `never` approval policy and reject
  delegate creation with any prompt-capable policy.
- Stop forwarding delegate approval and permission requests to the parent
  session. Approval-requiring commands and MCP tool calls are denied within the
  delegate instead.
- Skip prompts for missing skill MCP dependencies when approvals are disabled.

## Testing

Add coverage for review and Guardian delegates to verify that command
escalations, MCP approvals, and skill dependency installation do not prompt or
execute approval-gated actions.

GitOrigin-RevId: fee96a97624352cd25c904592ba7eebe2ae3fd63
2026-08-12 15:31:47 +00:00
felixxia-oai
e1b7b1acb3 Stop overriding environments in the skills user-turn test (#38186)
GitOrigin-RevId: d72b6751ba5dc180857992780093dc40dbc7d20e
2026-08-12 13:14:30 +00:00
felixxia-oai
c4b287cf57 Run search tool integration tests on Windows (#38184)
## Why

The search tool integration test suite was disabled entirely on Windows.

## What changed

- Remove the suite-wide Windows exclusion and build test fixtures with automatic environment selection.
- Configure stdio MCP fixtures with environment-aware server paths and environment IDs for local and remote runs.
- Skip the three stdio MCP cases that still require a native Windows test server when running through Wine.

GitOrigin-RevId: cf6f919bed28722996680dd0a085c1d1f80e4dcb
2026-08-12 12:59:34 +00:00
rphilizaire-openai
69ae78291d Read executor skill packages directly (#38167)
## Why

Executor skills required a `skills.list` lookup before their contents could be
read, even when the catalog already identified the skill.

## What changed

- Render executor skill catalog entries as package locators, including shortened
  locators when skill roots are aliased.
- Tell the model to pass those packages directly to `skills.read`, while keeping
  `skills.list` as the fallback when no package is available.
- Use the shorter package locators when applying the skills context budget.

## Testing

Update catalog, aliasing, budget-pressure, and selected-skill coverage, including
an executor package ID containing a literal backslash.

GitOrigin-RevId: 2ace5e527dc4f29651a8f3214475ccc90d52c73f
2026-08-12 10:34:25 +00:00
Dylan Hurd
2230d64464 Route MCP tool calls through shared approval handling (#38108)
## What changed

- Represent MCP tool calls as approval actions and route them through the
  session-level approval flow for permission hooks, reviewer selection,
  rejection handling, and resolution telemetry.
- Preserve MCP-specific user prompts, session and persistent approval choices,
  and the approval policy and reviewer captured for the tool call.

## Testing

- Add coverage for permission hooks resolving MCP calls before user or
  automatic review, persistence choices, captured policy routing, and MCP turn
  metadata with strict automatic review enabled.

GitOrigin-RevId: 8e134b3d17a19dc62b3b56076d2cd05a54c9f638
2026-08-12 03:00:47 +00:00
wencongli-oai
c909d1bc04 Attach hosted app context to file uploads (#38101)
## What changed

- Include the connector ID, action name, and model in file creation requests for hosted app tool calls.
- Use the file size returned by upload finalization when available, while falling back to the local size for older server responses.
- Keep upload finalization requests empty for compatibility with older servers.

## Testing

- Cover hosted app upload metadata and legacy finalization responses.

GitOrigin-RevId: 1bc834736db4fe3515f8224965cde0e5d6955ca3
2026-08-12 01:45:20 +00:00
Dylan Hurd
ca4d532b2a Test Guardian context for code mode commands (#38094)
## What changed

Add integration coverage verifying that Guardian receives both the user prompt
and the outer code mode `exec` source when reviewing a nested escalated
`exec_command` call.

GitOrigin-RevId: e78e9d4d69e7ebccc935c548565a07600659f65a
2026-08-12 00:46:11 +00:00
Owen Lin
da2803c73c Simplify queued user message admission (#38092)
## What changed

- Resolve user message admission when Core accepts the input as a new turn or a steer, without waiting for rollout persistence.
- Remove persistence- and hook-specific admission errors and task bookkeeping.
- Delete queued messages after Core accepts them for turn processing, including messages subsequently stopped by a prompt hook.

## Testing

- Update concurrent admission and queue service tests for acceptance-based admission.

GitOrigin-RevId: 7dcc311cfecd3d710733b420f2add546edb86153
2026-08-12 00:41:53 +00:00
Rasmus Rygaard
52d9218424 Allow empty input to start a turn (#38084)
## What changed

- Permit immediate user-message admission to start a turn when `Op::UserInput`
  has no items. The turn can proceed with its generated environment context and
  does not emit a user-message item.
- Continue rejecting empty input for persisted admission, where there is no
  user message to persist.

## Testing

- Cover successful empty-input turn admission and completion.
- Cover prompt rejection of empty persisted admission.

GitOrigin-RevId: d534cf0e228e3bc77f45fe6d9bd25c9073216fbd
2026-08-11 23:01:56 +00:00
rphilizaire-openai
a817d9424d Track implicit executor skill invocations (#38074)
## What changed

- Detect executor-owned skill document reads and script executions across native and URI-based working directories.
- Match skills only within the active execution environment while preserving host skill detection for local commands.
- Emit resource-backed implicit invocation events and deduplicate repeated accesses within a turn.

## Testing

- Add unit coverage for document reads, script executions, and environment-scoped matching.
- Add an integration test for environment selection, resource-backed analytics, and repeated-access deduplication.

GitOrigin-RevId: f78a48c3a4766fe8775bd88926b45a76761f6af8
2026-08-11 21:09:29 +00:00
sayan-oai
b43de77679 Scope environment readiness config to thread attachments (#38067)
## Why

Threads that share an executor environment can require different capability roots and login-shell policies. Treating readiness configuration as executor-wide can expose one thread's settings to another.

## What changed

- Add `CodexThread::environment_ready` and `EnvironmentConfig` so hosts can install capability roots and login-shell policy for an exact thread, environment, and working-directory attachment.
- Validate attachment readiness updates, merge ready attachment roots with persisted thread roots, and refresh MCP capabilities when those roots change.
- Preserve installed environment policy across thread settings updates and child-thread inheritance while resetting it when the selected working directory changes.

## Testing

- Cover attachment config inheritance and reset behavior.
- Verify that threads sharing an executor retain independent model-visible capability roots and login-shell tool schemas across updates.

GitOrigin-RevId: 60e7a296b3e41b835b0413aa2837451e8a55c230
2026-08-11 19:58:10 +00:00
rphilizaire-openai
c8f673fddc Track resource-backed skill invocations (#38066)
## What changed

- Emit skill invocation analytics when a resource-backed skill is explicitly selected or its main resource is successfully read from the first page.
- Preserve provider-supplied skill IDs and user scope when available, and derive a stable ID from the main resource otherwise.
- Deduplicate repeated implicit reads of the same main resource within a turn.

## Testing

- Extend the orchestrator skill integration test to cover explicit and implicit invocation events, stable fallback IDs, failed reads, and repeated-read deduplication.

GitOrigin-RevId: 7d8453b31b5a2205847e65cda2c46183d6c97b45
2026-08-11 19:52:54 +00:00
Eric Traut
46c3268542 Disable storage for Azure Responses requests (#38060)
## What changed

- Set `store` to `false` for every Responses request, including requests sent
  through Azure providers.
- Remove the provider-specific storage check and simplify request construction.
- Update the Azure request test to verify that storage is disabled while
  prefixed item IDs remain unchanged.

GitOrigin-RevId: 1c71cb80880058cb26789112f03269b73f0645b9
2026-08-11 19:35:05 +00:00
rka-oai
3a6f747d77 Preserve harness metadata across conversation history (#38058)
## What changed

- Wrap response items with optional harness-owned metadata while keeping the persisted response payload shape backward compatible.
- Store compacted-history metadata in an aligned sidecar and reject malformed sidecars.
- Carry metadata through history normalization, compaction, resume, fork, truncation, migration, and rollout recording without sending it to model providers.

## Testing

- Cover legacy rollout compatibility, metadata serialization and validation, compaction retention, and resume/fork reconstruction.

GitOrigin-RevId: 17a6127c9048ff984cb4df4d97c0751a38c29f5f
2026-08-11 19:30:12 +00:00
cooper-oai
b28aa476f4 Add configuration-backed external authentication (#38054)
## What changed

- Add a host-owned external auth source that runtime account APIs cannot replace,
  clear, or log out, and keep its credentials process-local instead of writing
  them to auth storage.
- Let configured providers classify refresh failures. Preserve cached credentials
  after permanent reload failures while retaining transient behavior for runtime
  providers.
- Compare external ChatGPT token data when detecting auth changes so a refreshed
  access token is applied to a retried request.

## Testing

- Cover configured-auth immutability, process-local storage, permanent reload
  failures, runtime error classification, and refreshed headers after a `401`.

GitOrigin-RevId: c6d70a39325c8ba6ca65ae68e12b55609f00a876
2026-08-11 19:04:07 +00:00
Bryan Ashley
d6ca19d99b Add turn-aware response item injection (#38047)
## What changed

- Add `inject_response_items_for_turn` for callers that inject Responses API
  items immediately before admitting user input. It defers the rollout flush so
  the injected items and user input are persisted together by turn admission.
- Keep `inject_response_items` behavior unchanged by flushing after it delegates
  to the new helper.
- Update the turn-start persistence test to exercise the turn-aware path.

GitOrigin-RevId: 8349b65f937af2b2a95d36b3fd73d862d38e5fd9
2026-08-11 18:14:09 +00:00
sayan-oai
f2a6f2585c Include auto-review state in turn metadata (#38046)
## What changed

- Add `auto_review_enabled` to serialized turn metadata for regular and review turns.
- Derive the value from approval-policy routing and reserve the metadata key so client-provided metadata cannot override it.

## Testing

- Cover enabled metadata, reserved-key handling, Guardian review requests, and updated compaction request snapshots.

GitOrigin-RevId: 52773e2bf7d4be251f8466332de9f9c9869dd084
2026-08-11 18:06:05 +00:00
iceweasel-oai
34db7e5563 Sandbox remote apply_patch operations (#38043)
## Why

Cross-platform remote `apply_patch` calls were rejected when filesystem writes
were restricted because patch verification and writes could not be safely
performed against executor files.

## What changed

- Route intercepted and direct remote patches through the executor-managed
  filesystem sandbox, including the configured workspace roots.
- Select the restricted-token sandbox for Windows executor paths when no
  Windows sandbox level was configured.
- Fail closed when an executor cannot enforce the requested sandbox, and treat
  executor-managed access failures as sandbox denials so approval can retry the
  patch without sandboxing.

## Testing

- Cover sandboxed remote patches, denied writes, approval retries, Windows
  sandbox selection, and executor filesystem enforcement.

GitOrigin-RevId: caddeed0b266c456a689080a14a3a58e2bd7887c
2026-08-11 17:47:22 +00:00
jif
279b93242c Remove config lockfile support (#38011)
## What changed

- Remove effective-config lockfile export, replay, and validation from session startup.
- Remove the `debug.config_lockfile` settings and generated schema entries.
- Remove feature-config materialization helpers that were only used to create lockfiles.

GitOrigin-RevId: a8c07c1c06325b3ec3dae9a97c36c2488d37df25
2026-08-11 13:52:48 +00:00
jif
0ca439900e Cache tool catalogs for streamable HTTP MCP servers (#37970)
## Why

Subagents should be able to use known HTTP MCP tool definitions without opening a connection until a tool is actually called.

## What changed

- Add streamable HTTP configurations to the process-scoped MCP tool catalog cache when their authentication identity can be derived safely.
- Fingerprint transport settings, relevant environment variables, protocol mode, plugin status, and client capabilities so catalogs are reused only across equivalent connections.
- Keep OAuth and other dynamically resolved credential configurations out of the shared cache.

## Testing

- Add an integration test proving that a subagent receives cached HTTP tools without reinitializing the server, then starts its own connection when it calls one.

GitOrigin-RevId: bb2787e29e9b71993def31aafd1f0d8f1b728d26
2026-08-11 09:22:50 +00:00
rka-oai
41ece455b7 Validate images before returning view_image output (#37939)
## What changed

- Reject invalid or unsupported image data before producing tool output, so
  non-image file contents are not exposed through code mode.
- Preserve valid image bytes and metadata while leaving image preparation and
  resizing to the history insertion path.

## Testing

- Cover invalid images in both code mode and standard `view_image` calls.
- Verify that code mode preserves PNG bytes, dimensions, EXIF orientation, and
  metadata.

GitOrigin-RevId: 07343ed10b781d0ce0ffb5b24432658be4c046e3
2026-08-11 05:32:28 +00:00
Bryan Ashley
722784e936 Distinguish turn-start thread persistence (#37926)
## What changed

- Add `PersistContext` to the thread-store persistence contract so stores can
  identify persistence requested immediately before model sampling. A
  `TurnStart` request may be enqueued in the background when later flush and
  shutdown operations fence it and report any failure; all other persistence
  remains synchronous.
- Use the turn-start context only for the initial input of a regular turn, while
  admission acknowledgments, steered input, and other persistence paths keep
  the standard durability behavior.
- Flush pending metadata before turn-start persistence and ensure shutdown is
  still attempted if that metadata update fails.

## Testing

- Verify that developer instructions and user input are persisted before the
  model request completes for a default paginated-history thread.

GitOrigin-RevId: 162f0ec796a61aebe66ca0b909fbcccec3047b85
2026-08-11 03:35:45 +00:00
Abhinav
070a26a1f0 Apply refreshed cloud config bundles to later sessions (#37908)
## Why

Background refreshes previously warmed only the on-disk cache, so new sessions in the same process continued using the startup snapshot.

## What changed

- Make `CloudConfigBundleLoader` retrieve the latest shared bundle on each configuration load.
- Update the in-memory bundle after successful refreshes while preserving the last successful bundle when a refresh fails.
- Stop refresh work when its loader is replaced or its final clone is dropped.

## Testing

- Cover refreshed requirements and managed configuration in later sessions.
- Cover concurrent initial loads, refresh failures and recovery, bundle clearing, and refresh-task cancellation.

GitOrigin-RevId: ae3d79b575bad71a1eed370cee6dc66dc022ffa8
2026-08-11 01:05:48 +00:00
rka-oai
260261ed8f Defer view_image processing to history insertion (#37902)
## What changed

- Pass image bytes from `view_image` through unchanged for both direct and code-mode calls, leaving decoding and resizing to the shared history-insertion path.
- Represent invalid image data with the existing image-omission placeholder instead of returning a tool error.

## Testing

- Update the `view_image` integration test to cover placeholder output for invalid image data.

GitOrigin-RevId: 62863defd4815efb8a7725712fd583ad81db3fbb
2026-08-11 00:17:36 +00:00
knittel-openai
9e301c8c9a Add configurable Responses API request metadata (#37895)
## What changed

- Add `responses_api_metadata` for product-owned key/value metadata included in
  every Responses API turn metadata payload, including parent and subagent
  requests.
- Limit the map to 16 entries, ASCII identifier keys of at most 64 bytes, and
  values of at most 128 bytes. Reject reserved Codex metadata keys and ignore
  this setting in project-local configuration.
- Give configured product metadata precedence over app-server client metadata
  while keeping it out of metadata sent to external MCP servers.

## Testing

- Cover reserved-key validation, metadata precedence, MCP isolation, and
  propagation to parent and subagent Responses API requests.

GitOrigin-RevId: a7be798294fde25145ab375a468321bb4e4a49f1
2026-08-10 22:58:53 +00:00
Vivian Fang
7a18a5c528 Validate images before returning view_image output (#37892)
## What changed

- Decode image data in the `view_image` handler and return a clear error for invalid or unsupported input.
- Re-encode code-mode images as PNG pixel data while preserving original image bytes for direct tool calls.
- Cover code-mode PNG output and rejection of invalid image data.

GitOrigin-RevId: 0a00e595ab749c19eab866a22f6577b6627e19f1
2026-08-10 22:43:47 +00:00
ftoddywala
9558d830f6 Read safety buffering from response metadata (#37882)
## What changed

- Parse safety-buffering payloads from typed `response.metadata` SSE events.
- Preserve the existing top-level `safety_buffering` field as the authoritative value when it is present, including when it is null or malformed.
- Continue applying the header-provided fallback model when the metadata payload omits `retry_model`.

## Testing

- Add parser coverage for metadata fallback, top-level precedence, and unrelated metadata events.
- Exercise metadata-based safety-buffering delivery through the core SSE integration test.

GitOrigin-RevId: 7dadfd54be28f2f33c2283de92fd49da0557d98a
2026-08-10 21:50:55 +00:00
iceweasel-oai
a603d7ca5c Honor the configured Windows sandbox level for managed networking (#37875)
## Why

Managed networking implicitly selected the elevated Windows sandbox backend,
even when the sandbox was configured to use a restricted token.

## What changed

- Select the Windows sandbox backend solely from `WindowsSandboxLevel`.
- Reject managed networking with a restricted-token sandbox before spawning a
  process, since managed networking requires the elevated backend.
- Cover the rejection through sandbox preparation, unified exec, and Windows
  sandbox session tests.

GitOrigin-RevId: 308858652d7b629af623d22896dafde3a23d3758
2026-08-10 19:57:40 +00:00
Adam Perry @ OpenAI
63002bdb26 Extract persisted history types into a dedicated crate (#37871)
## What changed

- Add `codex-history` for model-history and persisted-rollout domain types, including `RolloutItem`, `RolloutLine`, `CompactedItem`, and initial/resumed history state.
- Re-export the persisted types from `codex-rollout` and update consumers to use the new crate boundary instead of `codex-protocol`.
- Preserve existing rollout serialization, including legacy numeric compacted-window IDs.

## Testing

- Add `codex-history` tests for rollout JSON round trips, compacted-history compatibility, persisted history modes, and multi-agent version selection.

GitOrigin-RevId: 944daa9297ddd231d3aebbdcb05fff4adf8b4e1b
2026-08-10 19:26:52 +00:00
viyatb-oai
a1c88e865d Reject duplicate resolved paths in apply_patch (#37867)
## What changed

- Reject patches containing multiple operations whose paths resolve to the same file, such as `duplicate.txt` and `./duplicate.txt`.
- Preserve support for patches that update multiple distinct files.

## Testing

- Add CLI integration coverage for distinct updates and duplicate resolved paths.

GitOrigin-RevId: 0fb7f69ae31acc5c677268ffd9e38ad8d8314276
2026-08-10 18:44:58 +00:00
jif
dd22460869 Add MCP OAuth credential contention regression tests (#37866)
## What changed

- Cover non-blocking credential probes when the file or secrets store is locked, including retaining only a matching prior credential snapshot and recovering after the lock is released.
- Extend the streamable HTTP OAuth round trip to verify that user turns continue during store contention, newly discovered servers recover after contention, and logged-out servers do not reuse authenticated connections.
- Cover reconciliation of authentication failures and effective `Authorization` headers.

GitOrigin-RevId: 8e377644001bd0be04dc9f79841080094d09d199
2026-08-10 18:40:02 +00:00
Dylan Hurd
d06dc73290 Route intercepted exec approvals through shared review (#37851)
## What changed

- Send Unix `execve` approvals intercepted by the zsh fork through the shared approval pipeline, including permission hooks, Guardian review, user prompts, and telemetry.
- Resolve the active turn and its auto-review setting when an intercepted command needs approval, so commands sent to persistent terminals use the current turn's reviewer.
- Give each intercepted command a distinct approval ID and propagate an aborted approval as a turn abort.

## Testing

- Cover Guardian review for intercepted `unified_exec` commands and persistent terminals across turns.
- Verify repeated identical intercepted commands receive separate user approvals.

GitOrigin-RevId: e6cccf160637e4246aff4714c22f08c90b65306d
2026-08-10 17:24:51 +00:00
jif
4996cf05af Preserve environments when reloading V2 agents (#37847)
## What changed

- Restore a V2 agent's inherited environment selections when reloading its
  thread after residency eviction.
- Keep the restored execution environment and its tools available when the
  agent receives a follow-up task.

## Testing

- Add an integration test that evicts and reloads a V2 agent, then verifies
  its environment selection and `exec_command` tool are preserved.

GitOrigin-RevId: a5d4ad0fa465c717b32b7ae6807486429187a41d
2026-08-10 16:57:09 +00:00
felixxia-oai
3b67b03a3f Run plugin and skill tests on Windows (#37836)
## Why

The plugin and skill test suites were excluded wholesale on Windows, even though
most cases do not depend on POSIX behavior.

## What changed

- Make generated TOML and JSON fixtures escape Windows paths correctly.
- Use Windows-safe path canonicalization and normalize advertised skill paths.
- Select test environments through the environment-aware builders.
- Run the suites on Windows while narrowly skipping cases that execute POSIX
  commands or require matching host and executor path conventions.

GitOrigin-RevId: aadf31013c2bf9bac728adc4dd96f572d4a3bf3f
2026-08-10 14:45:55 +00:00
jif
09f47c8785 Simplify package-based skill reads (#37808)
## What changed

- Make `package` the only required argument to `skills.read`, resolving the
  owning orchestrator or executor catalog automatically.
- Default omitted `resource` values to the package's main `SKILL.md`.
- Render orchestrator skills as package locators and instruct the model to read
  them directly without first calling `skills.list`.
- Update skill extension and app-server coverage for direct main-resource
  reads, referenced resources, aliases, and the revised tool schema.

GitOrigin-RevId: 9faf57a8d0935566a15094931eaabaa8f0613e9e
2026-08-10 11:10:01 +00:00
Charlie Marsh
c9c6c0daa9 Add a feature flag to preserve apply_patch line endings (#37758)
## What changed

- Add the `apply_patch_preserve_line_endings` feature, disabled by default, to
  preserve CRLF, CR, and mixed line endings when `apply_patch` updates files.
- Apply the feature consistently to built-in patch handling and patches invoked
  through shell, user-shell, unified-exec, and app-server command execution.
- Keep the active feature configuration authoritative over inherited, shell
  snapshot, and client-provided environment values.

## Testing

- Cover line-ending behavior with the feature enabled and disabled for custom
  tool calls, shell heredocs, command execution, and the `apply_patch` CLI.

GitOrigin-RevId: 531a7c66761959c650270559f57941929f03e6c4
2026-08-10 01:44:30 +00:00
sayan-oai
dd43a9967f Use step environments for Guardian approval reviews (#37618)
## Why

Deferred environments can become ready after a turn starts. Guardian approval
reviews must use the environment selected for the current step so their working
directory and permission context are not taken from the stale turn snapshot.

## What changed

- Carry `StepContext` through tool execution and approval handling.
- Add a Guardian review context that pairs the parent turn with the current
  step's environment snapshot.
- Use that snapshot for Guardian prompts, reviewer sessions, and delegated
  reviewer threads while retaining turn-level fallbacks for callers without a
  step context.

## Testing

Added an integration test that makes a deferred remote environment ready before
an escalated command and verifies Guardian receives that environment's working
directory and denied-read policy instead of the initial local environment's.

GitOrigin-RevId: 779096bc7d0e0c7453a009c02141029714b9b407
2026-08-08 20:07:27 +00:00