Commit Graph

5081 Commits

Author SHA1 Message Date
zm-oai
426fa8cdab Use compatible PowerShell for elevated Windows sandbox commands (#41227)
## Why

Microsoft Store PowerShell executables under `WindowsApps` can be inaccessible to the dedicated elevated sandbox account.

## What changed

- For local elevated sandbox commands that target Store PowerShell, select the first compatible `pwsh.exe` or `powershell.exe` from `PATH` or the standard fallback locations.
- Continue adding `-NoProfile`, and preserve the selected shell for remote execution and other sandbox modes.

## Testing

Added unit coverage for Store-path filtering, fallback ordering, local replacement, and remote-path preservation.

GitOrigin-RevId: 8ab3d0db925e886879701445040f13902fb1ad24
2026-08-27 23:58:09 +00:00
felixxia-oai
dd453867fa Move Guardian review session tests to a separate file (#41226)
GitOrigin-RevId: 9fe1385c004a2ca778ba9aa45e3c9c1fe09b19e4
2026-08-27 23:54:42 +00:00
felixxia-oai
2d929eb7c3 Honor turn token budgets in Guardian review rollover (#41221)
## What changed

Resolve the review model's token budget from the parent turn's original
configuration and model-default setting when deciding whether a Guardian
follow-up review needs context rollover. This preserves explicit token-budget
preferences instead of unconditionally applying the review model's defaults.

GitOrigin-RevId: cb3adaea7dad22f4975d84c6ee62dfc2bfbddbb9
2026-08-27 23:36:08 +00:00
felixxia-oai
bae69125df Roll over Guardian context before follow-up reviews (#41215)
## Why

Long-lived Guardian sessions can exhaust the review model's context window. After
a rollover, a transcript delta is insufficient because the new window no longer
contains the original transcript or persistent review instructions.

## What changed

- Compact an exhausted Guardian session before submitting the next review while
  respecting the review model's token-budget configuration.
- Detect whether the full transcript remains in the reviewer history. If it does
  not, reset transcript and Node REPL evidence cursors so the next review replays
  the complete transcript and associated image evidence.
- Restore the follow-up reminder and Node REPL policy when compaction removes
  them.

## Testing

- Cover rollover both when the reviewer window is already exhausted and when a
  follow-up reminder crosses the limit.
- Verify that multimodal reviews preserve the fallback buffer and replay browser
  evidence after rollover.

GitOrigin-RevId: f2a02a84e1f25d15c6e2b8eddb93e2d1805449f5
2026-08-27 22:28:46 +00:00
rka-oai
f6494dc8f5 Enable clock tools from model metadata (#41210)
## What changed

- Register both `clock.curr_time` and `clock.sleep` when a model lists `clock` in `experimental_supported_tools`.
- Keep current-time reminder injection controlled separately by the `current_time_reminder` feature.

## Testing

- Cover a model-advertised clock with reminders disabled, verifying that both tools are available and no reminder is added.

GitOrigin-RevId: c39b5cb6e2da397daaaa4e0ad81f0763b8dd91e9
2026-08-27 21:46:20 +00:00
iceweasel-oai
19321435b1 Propagate executor OS into turn environments (#41207)
## What changed

- Add the optional `platformOs` field to exec-server environment metadata, with
  local exec servers reporting `std::env::consts::OS` and legacy servers
  remaining compatible when the field is absent.
- Preserve the reported OS in each selected turn environment, including the
  local environment.

## Testing

- Extend protocol serialization and environment-selection coverage for remote
  and local platform values.

GitOrigin-RevId: 0f325f6cb83cd8f8c7ec1ce2a4041f45a29e8f38
2026-08-27 21:05:40 +00:00
Shijie Rao
7f135e1314 Make Ultra reasoning fallback model-aware (#41206)
## What changed

- Add an optional `multi_agent_reasoning_effort` field to model metadata.
- When `Ultra` is selected, use a supported catalog override when present. Otherwise, prefer `max`, then the highest supported non-`ultra` effort, and finally `medium` when the model has no reasoning levels.
- Preserve existing request behavior for other reasoning efforts, including mapping `persistent` to `disabled`.

## Testing

- Cover configured, missing, unsupported, and empty-catalog fallbacks for both parent and spawned-agent requests.

GitOrigin-RevId: b7ef576f32e0ea95ef38bf95c25789ed16aae94e
2026-08-27 21:03:09 +00:00
florence-oai
e931d07b88 Track executor MCP discovery telemetry (#41205)
## What changed

- Count remote executor MCP discovery attempts, including refreshes, with `success` and `error` outcomes.
- Count each discovered server by name and report whether it was found or unavailable before policy and startup filtering.

GitOrigin-RevId: b912aa64b606e6243cce79df0fe85d485a2c3547
2026-08-27 20:55:12 +00:00
iceweasel-oai
d4d2b293b4 Propagate executor home directories into sandbox contexts (#41204)
## What changed

- Report the executor's user home in environment metadata.
- Cache the reported home on selected turn environments and include it in
  filesystem sandbox contexts, including `apply_patch` requests.
- Preserve compatibility with executors that do not report a home directory.

## Testing

- Cover local, remote, inherited, serialized, and `apply_patch` sandbox
  contexts.

GitOrigin-RevId: ea65e68e33a80bc9bcfc7c53b1486ab944699470
2026-08-27 20:44:47 +00:00
Evan Fannin
5bf0ba3dd6 Let extensions process MCP tool results (#41202)
## What changed

- Add `ToolLifecycleContributor::on_mcp_tool_result` with access to the
  executed MCP tool context, rewritten arguments, extension data stores, and
  mutable server result.
- Run contributors before publishing MCP completion and before preparing the
  result for the model, so extensions can inspect or replace successful and
  error results.

## Testing

- Cover unchanged, replaced, and error results for direct MCP calls, plus
  replaced and error results through Code Mode.
- Verify completion waits for result processing and the processed result flows
  to both completion events and subsequent model input.

GitOrigin-RevId: ece7acfe9c5eed4778cb78a29c3ffd06a74e1bcf
2026-08-27 20:39:39 +00:00
trolle-oai
124e560b93 Make the optional MCP startup grace configurable (#41199)
## What changed

- Add `mcp_optional_startup_grace_ms` with a default of 1,000 ms to control how long tool catalog capture waits for optional MCP servers.
- Treat a value of `0` as disabling the shared grace, so optional servers use their configured `startup_timeout_sec` instead.
- Apply updated grace values during runtime and MCP configuration refreshes, and reset cached startup deadlines when the configured duration changes.

## Testing

- Cover custom, disabled, refreshed, and shared startup grace behavior in MCP connection and core integration tests.

GitOrigin-RevId: 936196215ed6e0a29c9ec72cfee17663978df8ef
2026-08-27 20:31:40 +00:00
rka-oai
035295b46e Improve sandboxing, MCP errors, and cached approvals (#41196)
Expand Windows deny-read globs robustly across protected directories while preserving filesystem enforcement. Preserve structured MCP tool and resource errors through app-server responses. Bind cached Guardian classifications to current local and root authorization state so stale scores cannot approve actions.

Add regression coverage for the sandbox resolver, structured protocol errors, and authorization changes.

GitOrigin-RevId: 4b80ed724d869afeca79204222d8465fa99d3a24
2026-08-27 20:05:08 +00:00
Abhinav
0182ff3480 Finalize model-specific tool plans in ToolRouter (#41195)
## Why

Planning tools for a candidate model must not change the selected model or its
Responses Lite tool inventory. Otherwise, preparing a fallback can overwrite
metadata before the current model's request is sent.

## What changed

- Build tool registries and visible specs from an explicit `ModelInfo`.
- Store the finalized tool mode, code-mode names, namespace inventory, and
  terminal and child-management capabilities on `ToolRouter`.
- Publish namespace inventory only after selecting the step's router, and use
  that router's mode when dispatching and recording tool calls.

## Testing

Added coverage for candidate-model isolation, fallback compaction metadata,
code-mode worker selection, normalized tool names, and router capabilities.

GitOrigin-RevId: 56df2de8f42c7e93a4c4dcd117720e40a0cca3db
2026-08-27 20:01:39 +00:00
Tamir Duberstein
8aea62b2d8 Harden core test fixture startup assertions (#41194)
## Why

Test fixture setup can take more than five seconds on loaded CI workers, and
failures returned from setup can be obscured when downstream mocks verify their
expectations during teardown.

## What changed

- Add a shared `expect_startup` helper with a 30-second timeout that panics on
  either timeout or setup failure before mock teardown runs.
- Use the helper for remote-environment and unified-exec fixture setup, and
  allow the same startup window for the initial exec-server requests.

## Testing

Add paused-time tests covering successful startup after five seconds, timeout
reporting, and propagation of setup errors in the presence of unmet mocks.

GitOrigin-RevId: 39db69bde2983acd023a1911a6fad106674e169a
2026-08-27 19:58:09 +00:00
jif
8935ff19db Stabilize Guardian WebSocket tests (#41191)
## Why

Guardian tests could continue after a WebSocket handshake but before the
connection entered the idle pool. The shared request waiter could also miss a
notification delivered between checking the request log and registering its
wait.

## What changed

- Wait for Guardian prewarming to populate the idle connection pool instead of
  treating completed handshakes as sufficient.
- Use two initial Guardian connections in tests while retaining eight in
  non-test builds.
- Register for request-log notifications before inspecting the log to avoid a
  lost wakeup.

GitOrigin-RevId: 88f6a22c5401e03c24e6e114f2563fc641bfef80
2026-08-27 19:47:41 +00:00
jif
efc020d224 Instrument stdin review size checks (#41189)
## What changed

Emit a `codex.unified_exec.stdin_review.size_check` counter when reviewing
input for an escalated terminal. Tag each check with:

- the result: `formatter_truncated`, `over_limit`, or `within_limit`;
- whether the submitted input is control-only or text.

Preserve the existing rejection behavior for truncated or oversized reviews.

GitOrigin-RevId: 6556beb2121cfaf91d572a26822b50442391c95f
2026-08-27 19:44:11 +00:00
jif
5f49aba876 Require explicit requests for spawn model overrides (#41165)
## What changed

- Tell the `spawn_agent` tool to set `model` only when the user explicitly
  requests a different model.
- Update the tool-description test to enforce the stricter guidance.

GitOrigin-RevId: ed46bcb544876e408896e0d8c54292192369951c
2026-08-27 15:18:57 +00:00
Abhinav
8228e9b867 Resolve token budgets from each step's active model (#41162)
## Why

Model settings can change between steps in the same turn. Token-budget defaults,
context-window limits, and model-visible guidance need to stay aligned with the
model captured for each step.

## What changed

- Preserve the turn's original token-budget preferences and resolve model-owned
  defaults when each `StepContext` is created.
- Use the step's model to determine context-window availability and token-budget
  guidance, while keeping explicit user settings unchanged.
- Emit one-time replacement or removal notices when context-window guidance
  changes, including compatibility with previously persisted world-state
  snapshots.
- Add `ModelInfo::usable_context_window()` to distinguish reserved-headroom
  capacity from the resolved context window and auto-compaction limit.

## Testing

- Cover mid-turn model switches with model defaults, explicit settings, config
  reloads, missing context windows, and missing destination guidance.
- Cover unchanged, replaced, removed, blank, and legacy guidance transitions.

GitOrigin-RevId: 91100a9f3625bef8a79ecd158eb028051c309eee
2026-08-27 15:01:22 +00:00
jif
bce96bcb43 Reject oversized reviewed terminal input (#41159)
## Why

Reviewing a shortened `write_stdin` action while sending the complete input could allow unreviewed bytes to reach an escalated terminal.

## What changed

- Require the fully formatted action and approval reason to fit within 8,000 bytes.
- Reject truncated or oversized actions before requesting approval or writing any bytes to the terminal.
- Document the reviewed stdin size limit in the app-server protocol.

## Testing

Add an integration test that uses JSON escaping to push a formatted action over the limit and verifies that it is neither offered for approval nor executed, while a subsequent valid write still succeeds.

GitOrigin-RevId: f6c96a78a65a136366c8119a7d242dfc2ec05fe6
2026-08-27 14:54:13 +00:00
felixxia-oai
694edc23b2 Propagate trusted root skills to delegated workers (#41118)
## Why

Guardian reviews for delegated workers need to recognize skills explicitly
invoked by the user on the root turn.

## What changed

- Record verified user-owned skill paths as bounded, turn-matched Guardian
  evidence.
- Include trusted paths from the current worker and its root snapshot when
  building review context.
- Exclude skill trust from later root turns so stale authorization is not
  inherited.

## Testing

- Add an app-server lifecycle test covering inheritance of a root-invoked
  skill by a delegated worker and its removal on the next root turn.

GitOrigin-RevId: aa28f485edb7a447e51d51de8dc89b959fd63d40
2026-08-27 11:31:40 +00:00
felixxia-oai
aa89cf62bb Freeze plugin roots in MCP tool attribution (#41117)
## Why

Plugin MCP trust decisions must describe the exact host-discovered server
registration. Looking up a plugin again by ID can resolve a different root.

## What changed

- Retain the host plugin root in MCP catalog attribution and connection identity.
- Reconnect an MCP server when its attributed plugin root changes.
- Pass the retained root through tool lifecycle attribution and use it directly
  when building trusted tool context.

## Testing

Add coverage for catalog identity, connection reconciliation, lifecycle
attribution, and rejecting a different root associated with the same plugin ID.

GitOrigin-RevId: bc92743dd40ab44065a07c3ea972b4956ef8351f
2026-08-27 11:27:50 +00:00
Ankush Gupta
89650c66f2 Require synchronous review for sensitive MCP actions (#41094)
## What changed

- Recognize `codex_sensitive_action: true` on MCP approval elicitations.
- Route marked actions to the synchronous Guardian reviewer instead of extension fast approval. Absent or false values preserve the existing path.
- Cover ordinary and strict auto-review configurations, including marked, unmarked, and explicitly false metadata.

GitOrigin-RevId: dce13d1696568ca81c8d2b08a7ef0d5f13e155bf
2026-08-27 08:44:54 +00:00
Dylan Hurd
2c4a95736b Expose response usage metadata in completion events (#41087)
## What changed

- Parse optional `usage_metadata.amount` values from Responses API completion events without converting their string representation.
- Propagate the metadata through SSE and WebSocket streams, regular turns, and remote compaction.
- Add `usageMetadata` to the app-server `rawResponse/completed` notification and its generated schemas.

## Testing

- Cover missing, null, zero, and high-precision amounts, including completion events emitted during compaction.

GitOrigin-RevId: b16d81e8350eab0dc7ff613d0dc9dbed73041713
2026-08-27 07:50:05 +00:00
Ankush Gupta
b592a0bfed Forward model confirmation policies to actor MCP tools (#41072)
## What changed

- Add optional Browser Use and Computer Use confirmation-policy Markdown to model catalog messages.
- Send the configured documents verbatim in `openai/confirmation_policies` metadata for `node_repl` and `cua_repl` tool calls. Send an empty object when the issuing model has no policies so runtime defaults are cleared.
- Use the issuing step's model snapshot across approval waits, and omit the metadata for other MCP servers and Guardian sessions.

## Testing

- Cover policy serialization, configuration overrides, model changes, approval waits, partial or empty policies, eligible server filtering, and Guardian exclusion.

GitOrigin-RevId: 038c4c262a31fc71986e4a2a947fe9bcbd407acc
2026-08-27 06:58:07 +00:00
rka-oai
218a3e50ae Clarify when to send asynchronous user messages (#41070)
## What changed

Expand the `send_user_message_async` tool description to:

- identify questions, blockers, significant findings, and in-progress replies as
  messages that may need immediate user attention;
- distinguish those messages from routine progress updates that belong in
  commentary;
- clarify that sending a message neither ends the turn nor waits for a reply;
  and
- encourage formatting questions so they are easy to notice and answer.

GitOrigin-RevId: 004ba7fd77b2e225a4baa2ab69d08660a2cf73d7
2026-08-27 06:54:38 +00:00
ningyi-oai
d5caceccb1 Track Code Mode tool call metadata completeness (#41058)
## Why

Executed-tool metadata for a Code Mode cell can span its `exec` and `wait`
outputs. Consumers need to know whether that metadata contains the cell's full
tool call inventory or only a partial record.

## What changed

- Associate recorded tool calls with the originating Code Mode cell across
  `exec` and `wait` outputs.
- Add a host-owned `tool_calls_complete` marker when recording finishes without
  dropped or truncated calls. The marker describes inventory completeness, not
  tool success.
- Preserve the cell metadata through replay and pruning, and clear the
  completeness marker when prompt budgeting makes the record incomplete.

## Testing

Add coverage for multi-wait cells, retries, interruptions, recording limits,
argument truncation, prompt budgeting, and rejection of input-forged metadata.

GitOrigin-RevId: 377014edec06aab42aadab78b8b5dccc0a1c83ba
2026-08-27 06:03:29 +00:00
brianz-openai
f1433fc71f Add developer instructions for persistent mode (#41050)
## What changed

- Add bundled proactivity and follow-up guidance when `ReasoningEffort::Persistent` is selected.
- Allow model metadata to override or disable the guidance with `persistent_instructions`.
- Track the instructions as world state so effort and model changes replace or retire stale guidance without duplicating unchanged context.
- Tailor approval guidance to `send_user_message_async` availability, rebuild it for forked agents and rolled-back history, and exclude Guardian sessions.

## Testing

- Cover default, overridden, disabled, replaced, and retired instructions.
- Cover model changes, history transitions, agent forks, Guardian sessions, and asynchronous-message tool availability.

GitOrigin-RevId: 78e05d0335a70b385bd069b45edcd4ba570cef91
2026-08-27 04:58:21 +00:00
marksteinbrick-oai
307ce6cda9 Track Guardian reviewer turn and tool analytics (#41023)
## Why

Trusted Guardian reviewer sessions can emit events without an app-server listener, leaving their turns and tool usage absent from analytics.

## What changed

- Translate Guardian session lifecycle and canonical tool item events into analytics notifications while excluding messages, reasoning, and review content.
- Preserve Guardian lineage during prewarming even when inherited client metadata is not yet available, without emitting an incomplete thread initialization event.
- Limit direct session tracking to trusted Guardian children so resumed threads that have an app-server listener do not report duplicate events.

## Testing

- Cover completed, failed, and interrupted Guardian turns, tool counts and timing, lineage, content exclusion, prewarmed lineage, and resumed-thread deduplication.

GitOrigin-RevId: 70ace5f7ed30a7e3b6a9d6097c8b2a6a326dc4f7
2026-08-27 02:19:10 +00:00
Adam Perry @ OpenAI
81e180044d Scope extension capabilities to invocation lifetimes (#41020)
## What changed

- Add callback lifetimes to extension `ToolCall`, `ToolEnvironment`, turn-input context, and skill-read request types.
- Require extension tool executors to handle calls for any invocation lifetime and tie their returned futures to that lifetime.
- Update built-in extensions, adapters, and tests to use the lifetime-scoped APIs without retaining host-owned environment capabilities.

GitOrigin-RevId: aca9ce3a1b6870df550bc84ec9308cc65533f161
2026-08-27 02:00:31 +00:00
yqz-openai
eed1dee69e Propagate trace context through gRPC code mode (#41017)
## What changed

- Inject W3C `traceparent` metadata into code-mode session and execution requests.
- Carry each execution's trace context on streamed tool callbacks so callback and nested-tool spans remain connected across the gRPC boundary.
- Preserve the relevant spans when execution, callback, and dispatch work moves into spawned tasks.

GitOrigin-RevId: 6482963cb9b2e2f0ea27f1345bba208b70a80d0b
2026-08-27 01:55:53 +00:00
xl-openai
7c3747941a Reduce skill catalog prompts with path aliases (#41011)
## Why

Repeated skill locator roots can make catalog prompts larger even when the
catalog fits within its metadata budget.

## What changed

Evaluate aliased catalogs regardless of budget pressure and select them when
they preserve skill inclusion and description content while reducing prompt
size. Apply the same selection to combined host, executor, and orchestrator
catalogs.

## Testing

Add coverage for alias selection in full host-only catalogs and update skill,
symlink, and orchestrator resource tests to expect shortened locators and their
root mappings.

GitOrigin-RevId: ccedd3f3f6c7efaa1e5177a2d8c3d81d59239f52
2026-08-27 01:22:23 +00:00
felixxia-oai
b68acc4d4b Trust invoked user skills in Guardian reviews (#41006)
## Why

Guardian treated all skill instructions as untrusted, so it could not use the
invocation of a user-owned skill as authorization evidence.

## What changed

- Record explicit and implicit skill invocations through extension contributors.
- Send Guardian a bounded, deduplicated list of canonical skill paths only when
  they resolve under the user's Codex or `.agents` skill directories.
- Keep repository skills and symlinks that escape trusted roots untrusted, and
  send only verified paths rather than skill contents to the classifier.
- Avoid recording host skill prompts that were superseded by core skill
  injection.

## Testing

- Added unit coverage for trusted roots, symlink escapes, deduplication, and
  size limits.
- Added integration coverage showing that Guardian trusts invoked user skills
  while rejecting a forged repository skill.

GitOrigin-RevId: 1cc0be230f7e6649110201c23c3de8f26447ff36
2026-08-27 00:07:26 +00:00
soyeon-oai
ae357e7250 Attach verified access context to eligible plugin MCP calls (#41005)
## What changed

- Fetch ChatGPT account access and attach `cyber_trusted_access` under
  `openai/entitlementContext` when an installed or selected plugin explicitly
  requests it from a local, read-only stdio tool with no arguments.
- Reject caller-supplied entitlement context on direct MCP calls, and fall back
  to an `unknown` status when access cannot be verified or the account changes
  during the lookup.
- Count entitlement lookup time against the MCP tool-call timeout.

## Testing

- Cover eligible calls plus unowned, remote, HTTP, mutable, argument-bearing,
  API-key, undeclared, direct, and account-switch cases in core and app-server
  integration tests.

GitOrigin-RevId: 303b61585ef4530276c373d914a2d0ccef1f4ac2
2026-08-27 00:02:26 +00:00
rka-oai
e56e4922eb Support standalone tool outputs in turn/start (#41002)
## What changed

- Add an optional `toolOutput` to `turn/start` for starting or steering a turn with a named function-call output instead of user input.
- Emit standalone outputs as `functionCallOutput` thread items, persist them in durable history, and include them in resumed threads.
- Validate that tool outputs have a name, are not combined with nonempty `input`, satisfy the text-size limit, and use supported image URLs.

## Testing

- Cover standalone tool-output notifications, model input, and resumed history in both legacy and paginated history modes.
- Cover the text-size limit for structured tool output.

GitOrigin-RevId: a1eeec7b9b7de67b1a1c5e829a54552b85ec118b
2026-08-26 23:58:10 +00:00
pakrym-oai
528fd7ace5 Enable retained-image budgeting by default (#40994)
## What changed

- Promote `compaction_image_budget` to stable and enable it by default.
- Charge retained images against the remote compaction context budget unless the feature is explicitly disabled, trimming older images as needed.

## Testing

- Update remote compaction coverage for the default, explicitly enabled, and explicitly disabled behavior.

GitOrigin-RevId: 0f715347cefc33b814bdcfd9b430ef453d3bd6df
2026-08-26 23:05:08 +00:00
rka-oai
b9c4b9a0cf Support standalone function outputs in turn routing (#40991)
## What changed

- Allow `start_or_steer_turn` to accept named `function_call_output` items without a `call_id`, starting a turn when idle or steering the active turn.
- Preserve standalone outputs as pending input, assign response item IDs, and record them in conversation history without treating them as user prompts.

## Testing

- Cover starting a turn with a standalone output and steering an active turn with one.
- Verify passive response items do not signal pending steering activity.

GitOrigin-RevId: e32b292106b3c5a5f03577b8ebf67d2d7dee4e5d
2026-08-26 22:48:37 +00:00
Sean Huang
6e008417bb Expose permission profile resolution in the core API (#40989)
GitOrigin-RevId: 80229fcfd3a91715c361b1ba57d1c63eb0728529
2026-08-26 22:42:35 +00:00
Brandon Zhang
0d654e6536 Track window and fork positions in turn metadata (#40987)
## What changed

- Add the zero-based `window_number` to Responses turn metadata and include it in prewarm requests.
- Persist `forked_from_ordinal_exclusive` separately from the physical history base so fork lineage remains accurate after reverts and cold resumes.
- Report context-inheriting subagents through `parent_thread_id` without also emitting fork lineage.
- Reserve the new metadata keys while accepting and filtering previously valid configured values so Codex-owned values take precedence.

## Testing

- Cover window numbering across compaction, resume, and fork operations.
- Cover fork cutoff persistence across direct forks, legacy rollouts, reverts into inherited history, and cold resumes.

GitOrigin-RevId: 288f6cd632254814c1f166668b33828082d799a1
2026-08-26 22:37:59 +00:00
Dylan Hurd
a57b398351 Require approval for input to escalated terminals (#40978)
## What changed

- Add the `write_stdin_approval` feature flag, disabled by default, to require a fresh approval before sending non-empty input to an escalated unified-exec terminal.
- Route these reviews through hooks, Guardian, app-server, and the TUI as `writeStdin` approvals while keeping the parent command item unchanged.
- Preserve the terminal environment, launch directory, and escalation state across turns, and revalidate the process identity after approval before writing input.

## Testing

- Cover approval routing, policy decisions, process reuse, terminal identity preservation, app-server events, analytics, and TUI rendering.

GitOrigin-RevId: 4ba29eaae6208e934737ba078c96e589c7c2164d
2026-08-26 21:39:05 +00:00
felixxia-oai
21ff2e802c Expose MCP provenance to tool lifecycle extensions (#40976)
## What changed

- Add optional `McpToolContext` metadata to `ToolStartInput`, exposing the
  model-visible MCP tool details and its source classification without exposing
  the executable client.
- Classify MCP calls as connectors, configured servers, plugin servers,
  executor-selected plugins, or other registrations based on the prepared call.
- Prepare each MCP call before notifying tool lifecycle contributors and reuse
  that same call for execution so the callback describes the call that runs.

## Testing

- Cover host-owned connector calls and extension-owned Apps server calls,
  including their distinct provenance and executed tool names.

GitOrigin-RevId: efd23f511b1045ffdd96349d621ad62365569b2b
2026-08-26 21:30:23 +00:00
Won Park
f74bcd2811 Build Guardian V2 synchronous review prompts (#40964)
## What changed

- Add a synchronous reviewer prompt builder that combines root authorization,
  trusted user answers, bounded conversation history, parent environment and
  permission context, retained REPL evidence, and the proposed action.
- Select text or image REPL evidence from Guardian feature and transcript
  settings while respecting the reviewer model's supported modalities and
  shared image limits.
- Render network access requests with trigger-specific guidance and bound
  approval reasons and nested action strings before including them.

## Testing

- Add a prompt test covering root authorization, untrusted transcript framing,
  retry reasons, denied-read restrictions, and action serialization.

GitOrigin-RevId: d1cf886c2e30f7abbf94cce977cef14439ef3f2e
2026-08-26 19:53:32 +00:00
pakrym-oai
e77773085c Give Responses Lite prefix items stable IDs (#40962)
## Why

Responses Lite rebuilds its tools and base-instruction prefix for each request. Stable item identities let follow-up WebSocket requests recognize that unchanged prefix and send only incremental input.

## What changed

- Derive deterministic IDs for additional-tools and base-instruction items from the thread ID and each item's serialized payload.
- Preserve IDs when rebuilding an unchanged request or resuming a session, while changing them when the thread or payload changes.

## Testing

- Cover ID stability and payload/thread sensitivity in request construction.
- Verify resumed Responses Lite sessions reuse prefix IDs and WebSocket follow-ups use `previous_response_id` with only new input items.

GitOrigin-RevId: 3c8548b96979d7578865b0ccc51c147926823478
2026-08-26 19:44:12 +00:00
Benjamin Carlsson
d47e5cc0e2 Add Vim buffer jump motions (#40958)
## What changed

- Add `gg` and `G` motions to jump to the first and last buffer lines.
- Support the motions with delete, change, and yank operators, including dot-repeat for edits.
- Expose normal-mode and operator-motion bindings in the configurable keymap while preserving conflicting user bindings.

## Testing

- Cover buffer jumps, operator combinations, repeat behavior, chord routing, and custom remapping.

GitOrigin-RevId: 24a9178cf7964053aaf9a8cd268c5434dda0778e
2026-08-26 19:31:52 +00:00
willwang-openai
6ac012a0d4 Honor layered configuration when loading plugins (#40954)
## What changed

- Resolve plugin activation, MCP server policy, and marketplace definitions from the effective configuration stack, including system settings and trusted project overrides.
- Load plugin skills independently for each working directory passed to `skills/list`.
- Exclude project configuration from catalog requests whose `cwds` are omitted or empty.
- Cache up to eight loaded plugin configurations with least-recently-used eviction so requests for different working directories can reuse their results.

## Testing

- Cover layered plugin and MCP policy across trusted and untrusted projects.
- Cover per-directory skill and plugin catalog results, cache reuse and eviction, and system-defined marketplaces.

GitOrigin-RevId: cb68b2b1bdab1da48e05ca7562bc05014431fc71
2026-08-26 19:02:02 +00:00
Francis Chalissery
7276d67081 Expose resumable misalignment details through app server (#40952)
## Why

App-server clients need the explanation and steering instruction returned with a
misalignment policy violation to offer a user-confirmed continuation. Missing or
incomplete details must continue to behave as a terminal block.

## What changed

- Parse optional misalignment classification, explanation, and steering details
  from streamed and HTTP Responses errors and propagate them through core errors.
- Include the details in live app-server `error` and `turn/completed` payloads and
  export the corresponding protocol schemas and TypeScript types.
- Keep explanations and steering messages out of serialized rollout events and
  redact them from debug output.
- Document how clients can resume with `turn/start` after user confirmation.

## Testing

- Cover streamed, HTTP, and WebSocket-wrapped errors, including malformed and
  classification-only details.
- Verify live app-server notifications expose resumable details without writing
  the explanation or steering message to the rollout.

GitOrigin-RevId: 329258a444c2cd91d0c57ab1720830b33ddcfac5
2026-08-26 18:42:44 +00:00
rka-oai
0e9a2bae52 Enable clock tools for persistent reasoning turns (#40942)
## What changed

- Default the current-time reminder and interruptible `clock.sleep` tool on for
  turns using persistent reasoning effort.
- Preserve explicit `features.current_time_reminder` settings and managed
  requirements, and gate reminder recording on the resolved feature state.

## Testing

- Cover configured, persistent, ordinary-effort, explicitly disabled, and
  managed-disabled clock setups.
- Verify review turns do not expose clock tools or current-time reminders.

GitOrigin-RevId: 4ff8805807ceeef374abd962b1d9e7c37f1fbd83
2026-08-26 18:06:12 +00:00
Steve Coffey
e0c727de04 Classify streaming rate-limit errors (#40931)
## What changed

- Classify `response.failed` events with the `rate_limit_exceeded` code as a distinct retryable error while preserving any parsed retry delay.
- Expose the error as `rateLimitExceeded` through the core protocol and app-server schemas after stream retries are exhausted.
- Preserve the upstream message for TUI display while keeping it out of telemetry summaries.

## Testing

- Cover SSE classification, retry metadata, protocol conversion and serialization, exhausted stream retries, telemetry redaction, and TUI rendering.

GitOrigin-RevId: 02dab4d3477dcd7653a58c49c4bd38687a616579
2026-08-26 17:45:42 +00:00
sayan-oai
7625bd5665 Honor environment-resolved workspace roots (#40912)
## What changed

- Add effective workspace roots to `EnvironmentConfig` and use them when
  materializing permission profiles and filesystem context.
- Preserve selection roots for thread-owned configurations while allowing a
  ready environment attachment to supply its resolved roots.
- Propagate resolved roots to child environments and validate both command and
  `apply_patch` writes in owner-provided secondary workspaces.

GitOrigin-RevId: 1832c168ce1fc37fa67efc2a472998ab4f448c70
2026-08-26 16:28:35 +00:00
jif
5b92c2d2f5 Make Guardian risk score persistence opt-in (#40911)
## What changed

- Add the `features.guardianv2.persist_scores` configuration option for debugging.
- Default the option to `false`, so Guardian V2 reviewed actions and risk scores are only written to rollout files when explicitly enabled and the session is not ephemeral.

## Testing

- Cover configuration deserialization, default non-persistence, and opt-in persistence for nested code-mode actions.

GitOrigin-RevId: 452af99ef14553d45140340ececc2913389124d0
2026-08-26 16:23:34 +00:00
jif
bde9db1375 Record actual Responses endpoints in tracing spans (#40906)
## Why

Responses-compatible requests can use routes other than `/responses`, but their
tracing spans reported the default route regardless of the selected endpoint.

## What changed

- Populate `api.path` from the selected `ResponsesEndpoint` for HTTP and
  WebSocket requests.
- Retain the endpoint on WebSocket connections so stream-request spans report
  the same route as connection spans.

GitOrigin-RevId: 349eca94b27d4cc3a1adde8b257313506bdaf0f4
2026-08-26 15:31:30 +00:00