Commit Graph

1930 Commits

Author SHA1 Message Date
Andrei Eternal
cbfd999db7 Add hooks for interrupted turns (#40511)
## What changed

- Add an `Interrupt` hook event that runs for an active top-level turn before its
  interrupted abort event is emitted.
- Flush the turn transcript before invoking the hook and provide the session,
  turn, transcript, working directory, model, and permission mode in its input.
- Support command and MCP handlers, including asynchronous commands, with a
  one-second default timeout and a three-second maximum.
- Expose the event through hook configuration, managed requirements, app-server
  notifications, generated schemas, analytics, and the TUI hook views.

## Testing

- Cover handler discovery, timeout normalization, output parsing, protocol
  compatibility, TUI rendering, and interrupt execution ordering.

GitOrigin-RevId: 163fa7c098d94ac2775f6d137f8e916f8ea9b6eb
2026-08-25 01:27:18 +00:00
guinness-oai
41ca88e95c Persist realtime events in the thread timeline (#40508)
## Why

Clients need a bounded view of realtime conversations that preserves the order of speech, agent work, and turn lifecycle events without loading the full thread history.

## What changed

- Persist realtime session boundaries, transcript segments, and promoted agent items in paginated thread rollouts.
- Add the experimental `thread/timeline/list` API to page ordinary items, realtime items, and turn boundaries in canonical rollout order. Include `activeRealtimeSessionAtPageStart` so each page can be rendered independently.
- Emit typed `thread/realtime/item/started`, `thread/realtime/item/transcript/delta`, and `thread/realtime/item/completed` notifications around durable realtime items.
- Keep the existing `thread/items/list` response and legacy thread history behavior unchanged.

## Testing

- Cover mixed timeline pagination, realtime-session state at page boundaries, rollout replay, subagent history prefixes, transcript streaming, steering, and promoted agent artifacts.

GitOrigin-RevId: faa2c420192d63e060e8fb32446e3c797422656e
2026-08-25 01:03:20 +00:00
victor-openai
5918c743f3 Deduplicate plugin skills in unified mentions (#40501)
## Why

Unified `@` search could show a plugin alongside the skills it owns, creating duplicate entry points for the same capability.

## What changed

- Add a nullable `pluginId` to `SkillMetadata` returned by `skills/list` so clients can associate skills with their owning plugin without inspecting names or paths.
- Hide a plugin's owned skills from unified `@` results when that plugin is present, while retaining standalone skills and skills with unknown ownership.
- Keep `$` focused on individual skills and apps, and use it consistently as the skills-list shortcut. Preserve the legacy mention behavior when `mentions_v2` is disabled.

## Testing

- Cover plugin ownership in `skills/list` and the updated `@` and `$` composer results.

GitOrigin-RevId: e168cdff8d0c58f74ce4c228a683880a3167775b
2026-08-25 00:15:49 +00:00
spasumar-oai
4ef1d4b89b Increase the app-server model refresh interval (#40498)
## What changed

Change the background model refresh interval from 3 minutes to 4 minutes 30
seconds.

GitOrigin-RevId: dcefe471c91dc94a04ddc74595c3ce00d9061e55
2026-08-24 23:29:10 +00:00
jif
be3a666143 Track history, notes, and async messages as control tools (#40496)
## What changed

- Emit control-tool analytics for history and notes extension calls and for
  `send_user_message_async`.
- Preserve non-default namespaces in reported tool names, such as
  `history.read_item` and `notes.write_file`.

## Testing

- Add an app-server integration test covering successful and failed calls,
  turn-level tool counts, and omission of tool argument values from analytics.

GitOrigin-RevId: b15a53a311228339f4d577a7b96146ed67f22253
2026-08-24 23:19:03 +00:00
Tamir Duberstein
c941572917 Honor response budgets when reading skill resources (#40491)
## Why

`skills.read` paginated resources against a fixed response limit, so a page could exceed a smaller tool-call response budget.

## What changed

- Size each serialized `skills.read` page to the current call's response budget, accounting for JSON escaping and UTF-8 boundaries.
- Cache one bounded executor-resource snapshot per thread so cursor continuations return consistent contents without rereading the file. Replace the snapshot when another resource is read, and reject stale cursors after a reread.
- Tie cached executor snapshots to the selected environment and sandbox context without keeping the environment alive.

## Testing

- Cover budget-constrained reads, escaped and multibyte contents, multi-page reconstruction, changed resources, snapshot eviction, and expired turn-scoped access.

GitOrigin-RevId: e515935b82771b3f29b3fb91ea7a7a72e19a65ee
2026-08-24 23:00:57 +00:00
xli-oai
2497518490 Export turn cost as an OTEL metric (#40488)
## What changed

- Emit `codex.turn.cost_microusd` as a counter with turn, conversation,
  interruption, speed, and reasoning-effort attributes. Convert the estimated
  USD string to microdollars, rounding to the nearest microdollar and skipping
  values that cannot be represented safely.
- Start turn-cost collection when an OTLP metrics exporter is configured, even
  when the OTEL log exporter is disabled.

## Testing

- Verify cost conversion, rounding, and metric attributes with an in-memory
  metrics snapshot.
- Verify that a metrics-only OTLP configuration starts the turn-cost worker.

GitOrigin-RevId: e60587079f097f10cc1b6d1bf889d3f7a0dc3d5f
2026-08-24 22:44:33 +00:00
Eddie Chen
49880081fe Add root turn IDs to turn and tool analytics (#40486)
## Why

Analytics need to associate subagent activity with the top-level turn that
caused it, while avoiding a stale association when steering makes that origin
ambiguous.

## What changed

- Add `root_turn_id` to turn and tool-item analytics events.
- Read the root from live turn metadata when each event is built, reporting
  `null` when the root is unknown or ambiguous.
- Propagate the metadata through control-tool and code-mode completion facts so
  correlated and background tool events retain the correct root.

## Testing

- Cover root IDs for top-level turns, subagent turns, correlated code-mode
  calls, and tool events emitted after turn completion.
- Verify that queued and subsequent events report `null` after the live root is
  invalidated.

GitOrigin-RevId: 42fd76541c3c716cec74787d47b50adb2d22e6d2
2026-08-24 22:30:59 +00:00
alexsong-oai
4f6d43c267 Support managed AWS access keys for Amazon Bedrock (#40481)
## What changed

- Add the experimental `amazonBedrockAccessKeys` app-server login flow, persist its credentials in the configured auth store, and use them for SigV4-signed Bedrock requests.
- Report `bedrockAccessKeys` as a distinct auth mode and document access-key login alongside AWS profile and environment credential setup.
- Clear the selected Bedrock provider, AWS settings, and Bedrock-specific model on logout while leaving external AWS credentials and `.env` untouched.
- Reject managed access-key login when higher-precedence configuration would prevent its region or profile settings from taking effect.

## Testing

- Cover access-key login, storage, request signing, configuration conflicts, status reporting, and logout cleanup.

GitOrigin-RevId: bbf297887c6503d3651ceb2aad85c4d626e32723
2026-08-24 21:39:48 +00:00
jif
219c203417 Add a computer-use-only Guardian v2 review scope (#40480)
## What changed

- Add `features.guardianv2.review_scope.computer_use_only` to restrict asynchronous classification and fast approvals to browser and computer-use REPL tools.
- Keep other tools on the synchronous approval path without letting them age or reuse scores from in-scope calls.
- Give this scope precedence over `sandboxed_exec_commands` when both options are enabled.

## Testing

- Cover configuration precedence, direct and code-mode tool detection, fast-approval isolation, and end-to-end approval routing for browser, computer-use, and unrelated MCP servers.

GitOrigin-RevId: bfd9ab6abdbd90634b265d354e038724b1e81d65
2026-08-24 21:33:32 +00:00
rhan-oai
d21794d6ba Reload Multi-Agent V2 children through their parent (#40477)
## Why

Multi-Agent V2 children are owned by their parent at runtime. Resuming an
unloaded child directly could rebuild it from caller-provided settings instead
of the parent's current authority.

## What changed

- Route child reloads through their loaded immediate parent and reject direct
  cold resume when that parent is unavailable.
- Preserve the child's recorded model, provider, reasoning effort, and role
  while inheriting the parent's execution policy and MCP extensions.
- Validate cached environments against the parent, intersect local permission
  profiles, and reject stale remote or workspace-root configurations.
- Keep paginated cold-resume token usage attribution when attaching to the
  reloaded child.

## Testing

Add coverage for owner validation, nested-parent reloads, permission and
environment changes, role instruction restoration, paginated usage replay,
and app-server child resume behavior.

GitOrigin-RevId: 84014762bcdb57f94fc23974c9c1af55dc1babf1
2026-08-24 20:47:10 +00:00
Winston Howes
c3d5e4418f Add credential brokering to network proxy feature config (#40466)
## What changed

- Add `features.network_proxy.credential_broker` and preserve structured network proxy settings when toggling the feature through config APIs.
- Protect broker enablement and provider context variables from project config, while carrying trusted context into filtered shell environments.
- Propagate brokered credentials through shell snapshots and restore real credentials for unsandboxed escalated commands.
- Normalize broker context environment keys case-insensitively on Windows and avoid conflicting remote managed-network enforcement when no proxy launch configuration is available.

## Testing

- Cover config layering, editing, project sanitization, Windows environment handling, shell snapshots, escalated execution, and end-to-end GitHub credential brokering in the zsh-fork runtime.

GitOrigin-RevId: 500e51e804e1988022052ccfe00b8fac5e495f4f
2026-08-24 19:52:27 +00:00
felixxia-oai
c2904b9c5a Record Guardian classifier input truncation metrics (#40465)
## What changed

- Track truncation and omission across Guardian v2 actions, transcript entries and images, and synchronous review evidence.
- Emit `codex.guardian_v2.classification.truncation` counters and byte histograms for original, retained, and omitted content after successful classifications.
- Tag observations by input component and whether content was truncated or fully omitted.

## Testing

- Extend async scorer coverage for action truncation metrics.
- Verify the app-server Guardian flow records truncated review evidence.

GitOrigin-RevId: 70680897f75716770aa072f866d60bd37e171c1d
2026-08-24 19:47:48 +00:00
rhan-oai
b6333bb1bb Enforce subagent ownership across app-server inputs (#40464)
## Why

Parent-owned Multi-Agent V2 subagents must remain controlled by their parent,
but several app-server endpoints could still mutate them directly.

## What changed

- Centralize the direct-input ownership check and apply it to turn injection,
  MCP calls, reviews, compaction, rollback and revert, shell and Guardian
  actions, realtime requests, and goal mutations.
- Enforce the same policy for goal mutations on unloaded threads while keeping
  goal reads and turn interruption available.
- Document the affected endpoint behavior and continue exposing
  `canAcceptDirectInput: false` for parent-owned subagents.

## Testing

- Cover direct-input rejection for both legacy and paginated thread history.
- Cover goal mutation ownership checks for unloaded V2 subagents, V1
  subagents, and non-subagent V2 threads.

GitOrigin-RevId: 791b7af98490aed5eab4e672b90661acad11ec23
2026-08-24 19:44:14 +00:00
jif
b705b6b076 Report completed sub-agent activity on parent turns (#40437)
## Why

A Multi-Agent V2 child can finish after the parent turn that spawned it, so its
successful completion needs to remain associated with that parent turn in
notifications and history.

## What changed

- Add `completed` to `SubAgentActivityKind` and emit the corresponding started
  and completed item events on the spawning parent turn when a child succeeds.
- Persist completed activity as a canonical turn item in both legacy and
  paginated history, and expose it through app-server history and schemas.
- Render completed activity as terminal in the TUI without counting it as a
  separate tool call or tool-runtime event.

## Testing

- Cover successful completion in legacy and paginated history, late updates to
  completed parent turns, TUI rendering, analytics, and rollout tracing.
- Verify that terminal child errors do not emit completed activity.

GitOrigin-RevId: 6c71eb8b10e7327611c6af84f70e294e27d94d02
2026-08-24 17:07:21 +00:00
felixxia-oai
523519d974 Render Guardian review evidence with async scorer truncation (#40431)
## What changed

- Retain completed synchronous Guardian reviews as structured records until the async scorer builds its classification input.
- Render and bound review correlation, action, rationale, and full evidence body with the async scorer's transcript truncation marker.
- Extend the Guardian V2 integration test to verify oversized action and rationale content is truncated and the resulting review evidence remains bounded.

GitOrigin-RevId: 0000ba77b810748e34254dd00df4a69f8492e175
2026-08-24 16:41:55 +00:00
jif
a9e7920da1 Classify Guardian V2 risk with a single token (#40393)
## What changed

- Replace structured numeric classifier output with a single `high` or `low`
  token and map those classifications to `1.0` and `0.0` risk scores.
- Require the classification contract in both default and overridden prompts,
  including when classifier instructions are truncated.
- Return the first streamed classification immediately while draining the
  remaining response for connection reuse and token accounting.

## Testing

- Cover prompt rendering and truncation, classification parsing, early streamed
  results, conflicting later output, WebSocket reuse, and approval routing.

GitOrigin-RevId: 31a57e4eb9bf8df2a161b84aa3d5b16ab8f2937b
2026-08-24 12:22:02 +00:00
cgst-oai
2df6705423 Cache executor metadata from initialization (#40343)
## What changed

- Include `environmentInfo` in the exec-server `initialize` response and seed the Rust client's metadata cache from it.
- Fall back to one lazy `environment/info` request when connecting to older servers that omit initialization metadata, then share the cached result across client clones and session recovery.
- Keep app-server `environment/info` requests uncached so they continue to probe the executor.

## Testing

- Cover initialization metadata, the legacy-server fallback, shared caching, accepted WebSocket environments, and repeated uncached app-server probes.

GitOrigin-RevId: 380132d9db183998d73e8c6b0954e4d70c7e8406
2026-08-24 06:43:07 +00:00
Eric Traut
068c49f075 Update the frameless realtime default model (#40321)
## What changed

- Use `gpt-live-1-codex` as the default model for frameless realtime sessions.
- Preserve an explicitly supplied per-session model override.

## Testing

- Cover both default and explicit model selection in the WebRTC frameless conversation test.
- Update the app-server live session request expectation for the new default.

GitOrigin-RevId: ce5dc978911ff0289d677b60fae2dd8cb1058d22
2026-08-24 03:34:15 +00:00
Owen Lin
a1d4aea265 Shut down resumed descendants when archiving thread trees (#40179)
## Why

Collaboration can resume an archived descendant without unarchiving its
rollout. Archiving the parent again previously skipped shutdown for that
descendant because only rollouts newly marked as archived were prepared.

## What changed

Prepare every loaded thread in the spawn subtree for archival, including
descendants whose rollouts are already archived, before updating archive
state.

## Testing

Add an app-server integration test that resumes an archived child through its
parent and verifies that archiving the parent unloads the entire subtree.

GitOrigin-RevId: aca8c0d6ddb8900aad16becbeb594426cea1e3a6
2026-08-23 03:25:56 +00:00
Eric Traut
343074d420 Report runtime MCP connection status (#40068)
## Why

MCP inventory can be cached or collected separately from a thread's live
connections, so tool availability alone does not describe the current runtime
state.

## What changed

- Add a nullable `runtimeStatus` to `mcpServerStatus/list` for thread-scoped
  requests, covering not-started, starting, connected, authentication-required,
  failed, cancelled, and disabled connections.
- Observe published connection state without starting or reconnecting servers,
  and return an unknown status when no thread is supplied or the active
  configuration no longer matches the published registration.
- Show connection state and tool counts in the compact `/mcp` view while
  retaining the detailed inventory in `/mcp verbose` and compatibility with
  servers that omit `runtimeStatus`.

## Testing

- Cover runtime status transitions, deferred and disabled servers, closed
  transports, configuration changes, protocol compatibility, and TUI rendering.

GitOrigin-RevId: e3bb6efe652f0fa8b3c97d5c53e4729b3a87cd91
2026-08-22 05:54:43 +00:00
Ankush Gupta
970b7f2ff4 Preserve strict MCP auto-review outcomes (#40031)
## What changed

Propagate canonical denial, timeout, and abort responses from strict MCP
auto-review instead of replacing them with a generic decline. This preserves
the reviewer's action and metadata, including denial rationale, while still
failing closed when no canonical decision is available.

Update the fallback message to direct the agent to request explicit user
approval before proceeding.

## Testing

Add unit and app-server integration coverage for strict auto-review denials
and cancellations.

GitOrigin-RevId: d8126ab223ab546b95e2d984f6e4dd540a324a59
2026-08-21 23:14:28 +00:00
Dylan Hurd
50ea8fd411 Log Guardian V2 classification results (#40028)
## What changed

- Emit a structured log event for each completed Guardian V2 classification with its thread, turn, tool call, risk score, review threshold, sample time, and whether the score was accepted or superseded.
- Verify that accepted async classification events appear in the reviewed thread's log export with the expected context and decision fields.

GitOrigin-RevId: a027d5991b12a1968b9327da57e2993f0a529ca1
2026-08-21 22:24:28 +00:00
rafael-oai
95118dff65 Add browser and computer use configuration (#40018)
## What changed

- Add typed `browser_use` settings for history access and per-origin access,
  download, upload, and full CDP policies.
- Add typed `computer_use` settings for default app access, macOS bundle IDs,
  Windows AUMIDs, and Windows executable identities.
- Expose the merged settings through app-server config reads and generated
  Rust, TypeScript, and JSON schemas.

## Testing

- Cover TOML serialization round trips, layered config reads with origin
  metadata, and app-server batch writes.

GitOrigin-RevId: 78065f6fec990602071fc81ff639ff97f7ad8cd5
2026-08-21 21:41:55 +00:00
Matthew Zeng
e6a3877e95 Harden remote installed plugin cache reconciliation (#40015)
## What changed

- Scope remote installed-plugin and loaded-plugin snapshots to the active account, and discard in-flight loads when the account changes.
- Serialize bundle reconciliation with direct installs and uninstalls, and use cache generations to prevent stale refreshes from overwriting newer state.
- Validate the complete installed-plugin snapshot before downloading bundles or removing stale cache entries, while retaining valid installed metadata when materialization fails.

## Testing

- Cover account changes during plugin loading, incomplete snapshots, refresh/reconciliation races, and reconciliation cancellation recovery.

GitOrigin-RevId: 694c25577b420b93dacc6c65e3c0ecb7b8cc64c3
2026-08-21 21:28:16 +00:00
felixxia-oai
9949c9eafa Reuse Guardian reviews in async risk scoring (#40013)
## What changed

- Retain bounded evidence from completed synchronous Guardian allow and deny reviews and supply it to subsequent Guardian v2 async classifier samples as trusted developer context.
- Keep review evidence isolated from the conversation transcript, escape and truncate its fields, and ignore failed or incomplete reviews.
- Invalidate retained evidence after conversation history rewrites or new user messages, including authorization changes in a worker's root thread.

## Testing

- Cover approved, denied, malformed, and forged review inputs, plus root rollback and authorization-change scenarios.

GitOrigin-RevId: 27817e1fde9a136de727048c4220d148fcf72f42
2026-08-21 21:22:35 +00:00
alexsong-oai
e77c2a90af Implement Amazon Bedrock setup in the app server (#40007)
## What changed

- Implement `account/bedrock/discover` to report AWS profiles and available environment credentials.
- Implement `account/bedrock/setup` for validated AWS profiles and environment credentials, persisting the selected region and profile in the Bedrock provider configuration.
- Resolve Bedrock authentication according to the selected credential source, and clear stale profile configuration when using a Codex-managed Bedrock API key.

## Testing

- Cover profile and environment discovery, setup validation and persistence, conflicting credentials, and authentication-source precedence.

GitOrigin-RevId: 16d700cb0843df768c2fdb6d0c8d26c3402e93df
2026-08-21 20:57:17 +00:00
sayan-oai
ad9e8097fd Preserve managed deny-read rules across permission updates (#40004)
## Why

Runtime permission updates must not weaken managed filesystem `deny_read`
requirements.

## What changed

- Retain managed deny-read rules separately and merge them into updated
  permission profiles.
- Reject permission profiles and legacy sandbox policies that conflict with a
  managed denied path.
- Apply the same constraint when `command/exec` handles a request-specific
  sandbox policy.

## Testing

- Cover thread permission updates with managed deny-read requirements.
- Cover `command/exec` enforcement for managed and user-defined denies,
  including conflicting policy and profile overrides.

GitOrigin-RevId: 5e387b9c1bf1650a21753a74a3338bd33df7d0ce
2026-08-21 20:15:23 +00:00
rafael-oai
0f1a30b5c2 Expose browser and computer-use requirements through app-server (#40000)
## What changed

- Expand `configRequirements/read` with the Browser/Computer Use umbrella
  policy and the complete browser-use policy, including origin-specific access,
  download, upload, auto-review, and approval controls.
- Return computer-use persistent approval, default app access, macOS bundle ID
  rules, and Windows AUMID and executable rules.
- Export the corresponding v2 protocol types and generated JSON and TypeScript
  schemas.

## Testing

- Extend the config requirements RPC test to cover the new browser and
  platform-specific computer-use fields.

GitOrigin-RevId: d1be93388701b06312a26853d640401b63b4d535
2026-08-21 19:56:52 +00:00
rafael-oai
950dd184a1 Expand browser and computer use requirements (#39995)
## What changed

- Add a top-level `allow_browser_and_computer_use` requirement.
- Support browser requirements for history access, automatic review, persistent approvals, and default or per-origin access policies.
- Support computer-use requirements for persistent approvals, default app access, macOS bundle IDs, Windows AUMIDs, and Windows executables.
- Preserve these settings and their sources when composing layered requirements.

## Testing

- Cover deserialization, empty-value detection, source propagation, and layered TOML merging for the new requirements.

GitOrigin-RevId: d14a10b64465f1c54e9bcc3795dc93031e6b029b
2026-08-21 19:20:09 +00:00
Won Park
56012fafb8 Add Guardian internal session support (#39994)
## What changed

- Add an extension API for spawning host-owned internal sessions and a
  `ThreadReadyInput` lifecycle callback that runs after thread registration.
- Add Guardian reviewer session scaffolding that records the parent thread and
  effective model, plus the under-development `guardian_ext` feature flag.
- Start internal sessions with fresh history while preserving parent lineage,
  shared session controls, and internal-thread visibility rules.
- Scope internal-session prompt cache keys to their source and parent thread,
  and expose `guardian` as an internal session source.

## Testing

- Cover internal-session spawning, parent metadata, history isolation, prompt
  cache keys, and extension spawner argument forwarding.

GitOrigin-RevId: 682dae80397d62bb36247796b447042e760ca364
2026-08-21 19:11:05 +00:00
andrewgu-oai
79b7606803 Keep credentials out of app-server logs (#39993)
## Why

App-server logs can be persisted or included in submitted diagnostics, so credentials used by model providers, authentication refreshes, and attestation requests must not appear in diagnostic output.

## What changed

- Add `RedactedString`, which preserves serialization and string access while replacing debug output with `<redacted>`.
- Use it for model-provider bearer tokens, header and query values, authentication command arguments, and attestation tokens.
- Avoid logging JSON-RPC error payloads and parser or authentication errors that may echo credentials; retain safe context such as error codes and categories.

## Testing

- Add an app-server regression test that exercises provider credentials, refreshed authentication tokens, and attestation tokens, then verifies none appear in persisted SQLite or submitted diagnostic logs.

GitOrigin-RevId: 8c50408adf94d93847658b1320682cf3b637d2cc
2026-08-21 19:04:32 +00:00
felixxia-oai
c517cc6d84 Bypass risk scoring for models that require automatic review (#39981)
## Why

Models listed in `auto_review.required_on_models` must always use the full
automatic review path, regardless of any cached Guardian v2 risk score.

## What changed

- Skip Guardian v2 risk classification for models that require automatic
  review and clear any cached `SecurityRiskScore` before review routing.
- Count thread lookup failures as failed scoring attempts so stale scores
  cannot continue approving later tool calls.

## Testing

- Verify required-review models do not start a classifier and always run full
  reviews.
- Verify failed thread lookups advance score lag and fall back to strict review.

GitOrigin-RevId: 048d9a80ac2a282e05437a3abb0c46ec21391be8
2026-08-21 17:33:45 +00:00
jif
8edb95f274 Preserve MCP compatibility with older executors (#39979)
## Why

Older executors do not support resolving HTTP header values from their own
environment. Sending environment-backed bearer tokens to them can prevent MCP
servers from starting.

## What changed

- Advertise executor support for environment-backed HTTP headers with the
  `httpHeaderEnvVars` capability.
- Delegate bearer-token resolution only when the selected executor advertises
  that capability; otherwise, resolve tokens available in the host environment.
- Exclude executor-owned MCP servers that require environment-backed bearer
  tokens when the executor cannot resolve them, while retaining compatible
  host-owned and executor-owned servers.

## Testing

Added protocol and environment-variable coverage plus an end-to-end test that
simulates an older executor and verifies compatible MCP servers remain usable.

GitOrigin-RevId: 43545926f6f7e0f3b1091eb29d34647f6372bc4a
2026-08-21 17:21:30 +00:00
jif
e482cc66ae Keep Guardian reviews isolated from executor MCP servers (#39962)
## Why

Executor-owned MCP configuration can include required servers that are unavailable. Guardian review sessions should not attempt to discover those servers or let them block an approval review.

## What changed

- Skip projecting MCP servers from selected executors when the session source is a Guardian reviewer.
- Preserve executor MCP discovery for regular thread sessions.

## Testing

Added an app-server integration test that configures an unreachable required executor MCP server and verifies that Guardian can still review an escalated command and return its decision.

GitOrigin-RevId: 5b712a3ee04e6896d5ca0cff39a32dd8e0fe0132
2026-08-21 15:44:52 +00:00
jif
8ce27647fb Test browser MCP bearer tokens over executor WebSockets (#39961)
## Why

Browser MCP bearer tokens live in the executor environment and are not
inherited when an executor is spawned.

## What changed

Update the executor MCP integration test to launch `exec-server` over a
WebSocket, provide the bearer token only to that process, and configure the
MCP server with `bearer_token_env_var`. Register the running executor by URL
and verify the token is absent from the app-server test environment.

GitOrigin-RevId: 319b073d2eb1dbca015d4e6fea8ca714e78f3246
2026-08-21 15:34:19 +00:00
jif
054588acfe Honor required MCP servers from selected executors (#39952)
## What changed

- Preserve the `required` setting on HTTP MCP servers discovered from a selected executor.
- Cover delayed startup for a required executor MCP server and verify its tool is available on the first turn.

GitOrigin-RevId: df66e12233b8e1aaa7744e29c154157af8dc4776
2026-08-21 15:15:05 +00:00
jif
00a7b888b2 Discover HTTP MCP servers from selected executors (#39941)
## What changed

- Read `mcp_servers` configuration and requirements from each selected remote
  executor and add eligible HTTP servers to the thread's MCP runtime.
- Bind discovered servers to the thread's concrete executor snapshot and apply
  environment MCP policy and requirements. Discovery is best effort, and
  executor-local servers are not treated as required at startup.
- Ignore unsupported stdio servers and HTTP configurations that depend on
  environment-provided headers or header helpers.

## Testing

- Added an app-server integration test covering discovery, authenticated HTTP
  tool invocation, requirements enforcement, and exclusion of stdio servers.

GitOrigin-RevId: 6e1cdcebdbb1cc21a5a2285fbc5617d8d5997182
2026-08-21 14:23:33 +00:00
jif
7f9832d0d0 Enforce issuer binding for MCP OAuth endpoints (#39935)
## Why

Interactive MCP OAuth must not trust authorization metadata that could route an
authorization code or PKCE verifier to an unrelated token endpoint.

## What changed

- Require an advertised issuer to match the origin that served authorization
  metadata.
- Validate authorization and token endpoint origins before starting both
  pre-registered and dynamically registered client flows.
- Allow delegated endpoint origins when the server advertises issuer-bound
  authorization responses, while retaining narrow compatibility exceptions for
  existing providers.

## Testing

Add coverage for rejected untrusted metadata, accepted issuer-bound delegation,
legacy provider exceptions, and both client registration paths.

GitOrigin-RevId: 43c9f94c9f6ba2d23d7e373576cf9fa26861cfc3
2026-08-21 13:28:28 +00:00
jif
93c54bca38 Resolve HTTP MCP bearer tokens in executor environments (#39926)
## Why

Executor-owned HTTP MCP servers need to read their bearer credentials from the
selected executor environment instead of the host process.

## What changed

- Preserve `bearer_token_env_var` for executor-owned HTTP MCP configurations and
  resolve it when the executor sends each request.
- Extend delegated HTTP headers with executor-local environment references while
  rejecting missing, empty, or protected credential variables.
- Keep transport-provided bearer authentication compatible with MCP redirect and
  OAuth handling without sending a placeholder authorization value.

## Testing

- Cover authenticated executor-owned MCP requests end to end.
- Cover delegated header resolution and rejection of protected variables.
- Cover parsing executor-owned bearer configuration and transport-provided bearer
  behavior.

GitOrigin-RevId: 442bf7382198ffb69eba797eb36d4c74faabda88
2026-08-21 12:50:15 +00:00
Zahan Malkani
536f86e5cc Support attaching to existing realtime calls (#39876)
## Why

Clients that create and negotiate realtime calls themselves need Codex to join
those calls without creating another call or overwriting the client-owned
session configuration.

## What changed

- Add the `existingCall` transport to `thread/realtime/start`, accepting a
  client-provided `callId` and optional `realtimeSessionId`.
- Attach Codex over the call's sideband WebSocket without SDP negotiation or a
  session update, and reconnect that sideband while preserving transcript
  state.
- Default existing calls to realtime v1, support v1 and v3, and reject v2 or
  options that would reconfigure the client-owned session.
- Encode call IDs as a single URL path segment for v3 sideband connections.

## Testing

Add protocol, app-server, core, reconnection, authentication-header, and URL
encoding coverage for existing-call attachments.

GitOrigin-RevId: 2046b70566f98efa55381bb1e461ea3cc68256c5
2026-08-21 06:41:28 +00:00
Brandon Zhang
27c05a52e0 Include context window IDs in response metadata (#39847)
## What changed

- Add `context_window_id` to turn metadata for sampling and compaction requests, using the UUID for the model-visible context window.
- Keep the ID stable for requests in the same context window and advance it after compaction, independently of the existing thread-generation `window_id`.
- Reserve `context_window_id` so client metadata cannot override it.

## Testing

- Cover HTTP and WebSocket metadata, remote compaction, token-budget context alignment, resume behavior, and post-compaction window changes.

GitOrigin-RevId: 55cceea377ad509c8dd96ad668f2b5703ea46a63
2026-08-21 03:31:56 +00:00
pmccrary-oai
d8ec270183 Rename the history notes extension config option (#39830)
## What changed

Rename the token-budget configuration key and its Rust field from
`use_history_notes_history` to `use_history_notes_extension`. Update the config
schema, extension gating, explicit-setting detection, and tests to use the new
name consistently.

GitOrigin-RevId: b6a514e23f02095fcd1d35dc42eeb7394b800c77
2026-08-21 01:51:48 +00:00
pmccrary-oai
daa48072f4 Add history and notes tools for token-budget sessions (#39827)
## Why

Token-budget sessions need a way to recover prior conversation context and preserve working state across context-window transitions.

## What changed

- Add direct-model `history` tools for listing windows and items, reading items, and searching conversation contents.
- Add direct-model `notes` tools for listing, reading, searching, appending, and writing persistent notes.
- Route tool calls through the configured Codex backend with trusted session and agent context, bounded request arguments, and truncation-aware output handling.
- Expose the extension when `features.token_budget.use_history_notes_history` is enabled with an OpenAI provider and Codex backend authentication.

## Testing

- Cover tool registration, configuration changes, provider and authentication requirements, backend request context, encrypted output preservation, and request and response limits.

GitOrigin-RevId: 43b259f01014ba3f30803dd7cd5634942407a9bb
2026-08-21 01:24:52 +00:00
Eddie Chen
cc801d7048 Enrich thread archive analytics with thread context (#39797)
## What changed

- Add app-server client, runtime, thread source, and parent thread ID metadata to archive and unarchive analytics events when the reducer has that context.
- Omit non-automation feature thread sources and skip unavailable metadata.

## Testing

- Cover archive and unarchive event enrichment, filtered feature sources, and threads without cached context.
- Verify the app-server archive flow emits the enriched analytics payload.

GitOrigin-RevId: 163f9c30721cee0172bb4581b6dcd269e44cd941
2026-08-20 20:44:31 +00:00
rhan-oai
010738a25c Reject settings updates for parent-owned subagents (#39792)
## What changed

- Apply the existing direct-input restriction to `thread/settings/update` for
  parent-owned Multi-Agent V2 subagents.
- Document the restriction and extend the direct-input test to verify that the
  request returns an invalid-request error.

GitOrigin-RevId: 2eead01c6f54ec637c68573378f3b56a7ee85652
2026-08-20 19:52:44 +00:00
rka-oai
aead844f64 Handle standalone tool outputs as external context (#39791)
## What changed

- Treat standalone `function_call_output` items without a `call_id` as external context, including items injected into new and forked threads, and mark the thread memory mode polluted when `memories.disable_on_external_context` is enabled.
- Include these outputs in guardian transcripts with their namespaced tool name and a placeholder for non-text content.
- Allow image generation to reuse images from standalone and otherwise unpaired function or custom-tool outputs.

## Testing

- Cover injected thread items, external-context detection, guardian transcript rendering, and recent-image selection.

GitOrigin-RevId: ca4e8c16a4b731e1256a5956908d00f785b4feb1
2026-08-20 19:46:29 +00:00
xli-oai
0cc80b8db5 Support turn cost telemetry for custom model providers (#39785)
## What changed

- Route turn-cost queries for non-OpenAI providers through the configured
  provider endpoint and authentication, while retaining the existing OpenAI
  API-key path and excluding Amazon Bedrock.
- Observe turns only when their model provider matches the worker's provider.
- Retry custom-provider authentication failures during periodic availability
  probes and ensure client authentication takes precedence over provider
  headers.

## Testing

- Add coverage for provider matching, custom-provider authentication retries,
  ChatGPT-auth rejection, and header precedence.

GitOrigin-RevId: 04a7b28e8e3e18a510ae6fface5193af40d114c0
2026-08-20 19:28:32 +00:00
rka-oai
763787d061 Support standalone named function call outputs (#39782)
## Why

External tool events may need to enter thread history without a preceding function call and therefore do not have a `call_id`.

## What changed

- Allow `function_call_output` items to omit `call_id` and carry optional `name` and `namespace` fields.
- Preserve named standalone outputs during history normalization and agent forks while retaining existing pairing behavior for outputs with a `call_id`.
- Accept, persist, and forward these outputs through `thread/inject_items`, and update the app-server schemas and documentation.

## Testing

- Cover paired and standalone JSON round trips, history normalization, agent forks, and injected thread history.

GitOrigin-RevId: a3258163a7dc93777c7c3023116fe204819bdbb0
2026-08-20 19:19:41 +00:00
jif
bce5f2fcfc Standardize shell execution on unified exec (#39772)
## What changed

- Use `exec_command` and `write_stdin` as the shell tool surface.
- Treat legacy `default`, `local`, and `shell_command` model metadata as `unified_exec`.
- Remove obsolete shell-selection configuration and runtime paths while preserving the feature and policy gates for zsh fork execution.

GitOrigin-RevId: d743cbe598630d73052f1fecad680c4cde17977d
2026-08-20 18:29:35 +00:00