Commit Graph

1728 Commits

Author SHA1 Message Date
jif
03edf16f0b Support plaintext collaboration tool messages (#35845)
## What changed

- Preserve `encrypted_function_args` on function calls so an empty list can mark plaintext collaboration arguments across request replay.
- Deliver `spawn_agent`, `send_message`, and `followup_task` payloads as structured plaintext agent messages when that marker is present; retain encrypted delivery otherwise.
- Redact plaintext collaboration arguments from tool and communication logs, and omit the metadata when sending requests to non-OpenAI providers.

## Testing

- Cover serialization of empty encrypted-argument metadata and plaintext versus encrypted subagent message delivery.
- Verify plaintext tool arguments are redacted and provider-specific metadata is removed from non-OpenAI requests.

GitOrigin-RevId: 64db98ff0b61a3af2f04ed609292363f2e2362a8
2026-07-28 23:49:37 +00:00
Eddie Chen
1def0a8925 Track parent turns for nested Codex requests (#35835)
## What changed

- Propagate the initiating turn ID through agent spawns, follow-up tasks, reviews, and delegated Codex sessions.
- Add `parent_turn_id` to Responses client and turn metadata while keeping it out of external MCP metadata.
- Preserve parent-turn provenance across queued agent messages when their triggering parent is unambiguous.

## Testing

- Cover spawned, resumed, nested, reviewed, delegated, and WebSocket request metadata.
- Verify queued messages do not claim ambiguous or queue-only parent turns.

GitOrigin-RevId: 481fdebbe7df2031880fe259509273cce50b20a8
2026-07-28 21:58:33 +00:00
Celia Chen
9ea975a2dc Route MCP OAuth through configured HTTP clients (#35806)
## What changed

- Pass resolved, route-aware HTTP clients through MCP OAuth discovery and login so CLI commands, plugin installation, and skill dependency setup honor configured proxies and execution environments.
- Apply per-plugin MCP server configuration and requirements before starting OAuth during installation, and skip disabled servers or servers assigned to unowned environments.
- Preserve configured MCP server policies when merging remotely installed plugin metadata.

## Testing

- Cover proxy-routed OAuth for `codex mcp add`, `codex mcp login`, plugin installation, and skill MCP dependencies.
- Cover plugin-install OAuth filtering for disabled servers, plugin requirements, and unowned environments.

GitOrigin-RevId: f84c88820e24a627faa78d6bed1b371682ecdc2f
2026-07-28 18:25:29 +00:00
felixxia-oai
03748ad5e1 Scale skill metadata budgets with context windows (#35773)
## What changed

- Allocate 2% of the resolved model context window to skill metadata without
  imposing the previous 4,000-token ceiling.
- Keep the 8,000-character fallback when no context window is available.
- Extend catalog rendering coverage to verify that a 400,000-token context
  window receives an 8,000-token metadata budget and includes more skills.

GitOrigin-RevId: 5120d462de22fbfe5f9c4ab0d1bb97e51950d4b2
2026-07-28 13:39:35 +00:00
jif
7cde2323f3 Throttle models cache TTL renewals (#35772)
## Why

Matching model ETags can arrive on every response, but a recent models cache does
not need to be rewritten each time.

## What changed

Renew the models cache timestamp only after more than half of its configured TTL
has elapsed. Matching ETags continue to avoid refetching `/models`.

## Testing

Added integration coverage that verifies a recent cache remains unchanged and an
older cache is renewed without another `/models` request.

GitOrigin-RevId: b45da3824674c6b41d982ba4a405b419b09b7715
2026-07-28 13:31:41 +00:00
felixxia-oai
f6160ca5b3 Share the skills budget across host and executor catalogs (#35769)
## Why

Rendering host and executor skill catalogs independently allows their combined
metadata to exceed the skills context budget.

## What changed

- Allocate one budget across both catalogs when both contain model-visible
  skills.
- Prefer retaining executor skills when budget pressure requires omissions,
  while preserving an executor omission marker and reporting when all host
  skills were omitted.
- Evaluate absolute and aliased host paths under the shared budget and select
  the rendering that best preserves executor entries, total entries, and
  descriptions, in that order.

## Testing

Added renderer and production-turn coverage for shared-budget description
shortening, host-first omission, executor omission markers, and alias selection.

GitOrigin-RevId: 30041736a76aa173cb641aa98a876a306cb437d2
2026-07-28 13:16:04 +00:00
felixxia-oai
a68d0a74bd Emit host skill budget warnings from world state (#35766)
## Why

Host skill catalogs supplied through extension world state should report budget warnings only when their catalog update is actually rendered.

## What changed

- Stop rebuilding an extension-owned host catalog in core.
- Emit host catalog budget warnings when the corresponding world-state fragment is rendered, and deduplicate them with executor catalog warnings.
- Cover full, shortened, and omitted host and executor catalogs, including repeated turns and resumed persisted snapshots.

GitOrigin-RevId: ba28b6e337281b49ed4da2175c193fd4a6898ab7
2026-07-28 12:43:20 +00:00
Tamir Duberstein
e597169e9a Keep agent registry identities consistent (#35744)
## Why

An agent can be registered again with restored path metadata after a root thread
resumes. Leaving its previous registry entry behind can make later lookup and
release operations act on stale metadata.

## What changed

- Add a thread-to-path index alongside the agent tree.
- Keep both indexes synchronized when root and spawned agents are registered,
  replaced, moved between paths, or released.
- Preserve other restored siblings when one agent is closed, while still
  allowing a surviving sibling to be reloaded for follow-up work.

## Testing

Add registry coverage for replacement, release, and path migration, plus resume
tests with multiple sibling agents.

GitOrigin-RevId: 1c1acf422884a6842d9bbdf89ba993d98187770d
2026-07-28 09:41:52 +00:00
jif
d9e1c9cd55 Avoid blocking turns on optional MCP startup (#35742)
## Why

A pending optional MCP server can delay the first model request even when the
turn does not need that server.

## What changed

- Give optional MCP servers a shared one-second startup grace, then omit servers
  that are still pending from the captured tool catalog.
- Continue waiting when the turn explicitly requires a server through a plugin,
  skill dependency, or `mcp://` mention, and preserve this behavior for input
  received between sampling steps.
- Route direct resource requests to the live connection set when a pending
  server was omitted from the binding, while keeping all-server resource
  discovery non-blocking.

## Testing

- Cover the shared grace period and resource behavior for pending optional
  servers.
- Verify plugin, plugin-skill, and direct MCP mentions wait for startup.
- Verify an Apps-enabled turn proceeds without tools from an unrelated pending
  optional server.

GitOrigin-RevId: b5f895c5a5362fe73f7d33250367662d4a217e4d
2026-07-28 09:32:48 +00:00
Channing Conger
9291a123fb Honor disabled code mode fallback without a process host (#35721)
## Why

When the code mode host feature was disabled, thread startup always selected the in-process provider, even when `disable_in_process_fallback` was set.

## What changed

- Select a disabled provider when both the process host and in-process fallback are disabled.
- Return a clear tool error instead of running code mode in process for that configuration.

## Testing

Added an integration test covering code mode with the process host feature and in-process fallback both disabled.

GitOrigin-RevId: 3ed80afc23e0a5518c0133fe337a37b1fa545ead
2026-07-28 05:22:02 +00:00
Adam Perry @ OpenAI
49025589b0 Add configurable developer instructions for v2 subagents (#35708)
## What changed

- Add `features.multi_agent_v2.subagent_developer_instructions` to override inherited developer instructions for subagents that do not define role-specific instructions.
- Preserve role-specific instructions as the higher-precedence setting, and carry the effective instructions through full and bounded forks, compacted histories, and cold resume without duplication.
- Treat an unset override as inheritance and a blank override as clearing inherited instructions.

## Testing

- Cover configuration parsing and materialization, instruction precedence, fork modes, compaction, role application, and resumed subagents.

GitOrigin-RevId: 32321e61abc59b14a1be5f31e6bd6570bb1cd89d
2026-07-28 03:33:31 +00:00
Charlie Marsh
bbeee9a406 Prepare MCP and plugin recommendations concurrently (#35675)
## Why

Turn preparation waited for MCP discovery before requesting endpoint plugin
recommendations, adding their latencies together.

## What changed

- Prepare the MCP runtime and endpoint plugin recommendations concurrently.
- Wait for both results before building tools and starting model sampling.
- Cancel the combined preparation when the turn is interrupted.

## Testing

- Add coverage that gates MCP initialization and verifies recommendation fetching
  overlaps it while the final request includes both results.
- Verify interrupting concurrent preparation prevents model sampling.

GitOrigin-RevId: 295ec268331bf05304e6b313925fd2b6c2ae4190
2026-07-27 21:43:27 +00:00
felixxia-oai
294d813263 Route curated plugins by authentication mode (#35671)
## Why

Curated plugin capabilities need to follow the active authentication mode, including after an account switch and when the configured model provider differs from the authentication source.

## What changed

- Select the ChatGPT, remote, or API curated marketplace from the current authentication mode, with an API marketplace fallback for ambient Amazon Bedrock credentials.
- Apply that selection consistently to plugin loading, hooks, skills, installed-plugin conflict filtering, marketplace listing, and `codex mcp` discovery.
- Start the local curated repository sync when an account change makes the remote catalog unavailable, and refresh existing thread MCP runtimes when the effective plugin cache changes.

## Testing

Added coverage for account switches, ChatGPT-authenticated Bedrock sessions, API-key MCP discovery, curated marketplace filtering, hook and skill routing, and existing-thread MCP refreshes.

GitOrigin-RevId: dbefdba3a3ea7281e7b6013e057a418770ccfc95
2026-07-27 21:17:42 +00:00
iceweasel-oai
fd41e813cb Raise the Windows exec yield floor to 10 seconds (#35670)
## What changed

- Clamp the initial `exec_command` yield time to at least 10 seconds on Windows.
- Update the tool description and unit coverage for the new effective range.
- Allow the Windows Ctrl-C integration test up to 20 seconds to complete.

GitOrigin-RevId: 65d4d1c9a89dc9979e10d3e565af61c9f632c058
2026-07-27 21:12:00 +00:00
jif
8495963ac6 Place host skills before permission instructions (#35661)
## What changed

- Insert the `host_skills` world-state section before the permissions section
  when permissions are present.
- Verify that skill metadata appears before `<permissions instructions>` in the
  rendered developer message.

GitOrigin-RevId: e9fc62f498c384e841fc34ef679850557645f989
2026-07-27 19:01:53 +00:00
iceweasel-oai
6b23635a7e Terminate Windows non-TTY processes on interrupt (#35655)
## Why

Windows non-TTY exec sessions reported interrupts as unsupported, so sending
Ctrl-C through `write_stdin` did not stop the running process.

## What changed

- Route interrupt requests for Windows non-TTY processes through their existing
  termination callback, including pipe-backed processes.
- Track whether driver-backed Windows sessions use a TTY so PTY interrupts keep
  their existing behavior.
- Consume the terminator after a successful interrupt to avoid invoking it again
  when the process handle is dropped.

## Testing

Added coverage for local and remote exec-server sessions, unified exec, pipe
fallbacks, and legacy Windows sandbox processes.

GitOrigin-RevId: 34504d01f091ef57bb961e98ad5a8d9f1acee4ee
2026-07-27 18:37:11 +00:00
viyatb-oai
462ed19a05 Enable network policy callbacks for remote exec (#35652)
## What changed

- Forward remote managed-network policy requests to the controller-side decider when Guardian review is enabled.
- Bound callbacks using the configured permission-hook and Guardian review timeouts, restore trusted execution attribution, and recheck live baseline policy before requesting a decision.
- Cancel pending decisions when the process or execution scope ends, and propagate EOF across the sandbox proxy bridge with half-closes.

## Testing

- Cover callback enablement, strict allowlist behavior, live policy updates, trusted attribution, and execution-scope cancellation.

GitOrigin-RevId: 83b47657c8c4546dfe98eec8b272833e96a46b7e
2026-07-27 18:07:31 +00:00
rka-oai
fbe65995bb Support model-owned token budget defaults (#35608)
## What changed

- Add token-budget settings to model catalog messages and apply them when the
  feature is enabled without explicit token-budget configuration.
- Keep explicit user settings authoritative, reject invalid catalog defaults,
  and preserve resolved defaults in exported config locks.
- Manage context-window guidance through world state so it updates once when
  the active model changes while retaining prior conversation history.

## Testing

- Cover catalog defaults, explicit overrides, disabled features, invalid
  values, config-lock replay, and model switching.

GitOrigin-RevId: 54544fefaa14b09f5ef5bad9967a13c52b87b0fe
2026-07-27 12:52:37 +00:00
jif
3bbf1fe757 Expose cached MCP tools before server startup (#35590)
## Why

Cached MCP definitions can be supplied to inference without waiting for the
server to finish initializing.

## What changed

- Publish cached tools while startup is still in progress, clearing their
  potentially stale read-only hint.
- Wait for the selected server to start before executing a tool call, then
  prepare the call against the refreshed live binding.
- Keep cached tools visible in a binding even when no live client is available,
  while rejecting attempts to prepare those calls.

## Testing

- Cover cached-tool visibility before startup and replacement with live tool
  metadata afterward.
- Verify cached definitions reach inference before MCP initialization and that
  calls unavailable in the live catalog return the expected model-visible
  error.

GitOrigin-RevId: 3aae8f474c344ccdc5e08fe321bbad21d85bffd1
2026-07-27 10:25:32 +00:00
sayan-oai
18f50c9e62 Track model and personality in world state (#35530)
## What changed

- Add model and personality sections to the persisted world-state snapshot.
- Generate model-switch and personality instructions through world-state diffs, including when prior state must be inferred during replay.
- Keep those instruction fragments in standalone developer messages instead of merging them with adjacent context updates.

## Testing

- Cover initial, unchanged, and changed model and personality states.
- Verify that model changes are recorded in rollout world-state items.

GitOrigin-RevId: 497e29cf38cac08e992e546df900f6f8b01120f9
2026-07-26 23:36:33 +00:00
Owen Lin
af7f6f4d34 Include item start times in completion events (#35363)
## What changed

- Add an optional `started_at_ms` field to `ItemCompletedEvent`, retaining
  compatibility with older persisted events that lack it.
- Track the first start timestamp for each in-flight item and attach it when
  emitting and persisting the completion event. If no start was recorded, use
  the completion timestamp as a fallback.
- Emit a complete start/completion lifecycle for subagent activity items.

## Testing

- Cover concurrent item timing, repeated starts, turn-boundary cleanup, the
  missing-start fallback, subagent activity, and persisted web-search events.

GitOrigin-RevId: e7cec9c4f1ef6ba67f287e81fb4d7d856fcf87a7
2026-07-25 16:06:54 +00:00
rka-oai
25b6fc9bbc Include code-mode tool names in Responses Lite metadata (#35271)
## What changed

- Add `code_mode_tool_names` to Responses Lite turn metadata, mapping each normalized code-mode identifier to its structured `ToolName`.
- Reserve the metadata key against client overrides and omit it from metadata exposed to external MCP servers.
- Keep non-Lite requests and the legacy top-level client metadata unchanged.

## Testing

- Cover HTTP and WebSocket Responses Lite requests, including switching from a non-Lite model.
- Verify reserved-key handling and external MCP metadata filtering.

GitOrigin-RevId: b678afba13d57a91e26f5895aa37238fbb4cb276
2026-07-25 01:05:33 +00:00
viyatb-oai
63fe5a6b71 Harden network approval cancellation and concurrency (#35267)
## What changed

- Scope pending network approvals to a turn and execution while still coalescing duplicate requests within one execution.
- Fail abandoned approval owners closed, cancel denied executions, resolve any waiting requests, and cancel in-flight Guardian reviews when their owner is dropped.
- Serialize session policy updates with approval caches so concurrent allow and deny decisions cannot leave enforcement and cached decisions inconsistent.
- Give user approval requests and permission hooks unique per-execution identifiers.

## Testing

- Cover approval deduplication boundaries, abandoned-owner cleanup, cancellation outcomes, replacement requests, and Guardian cancellation events.

GitOrigin-RevId: 11e184dd1c70294a99581b6ff0d4b6607d9ea1d9
2026-07-25 00:10:48 +00:00
Channing Conger
cba0e2701c Allow disabling the in-process code-mode host fallback (#35266)
## What changed

- Allow `features.code_mode_host` to use a configuration table with
  `disable_in_process_fallback`. When enabled, failure to start the standalone
  host is returned as tool output instead of falling back to embedded V8.
- Preserve the existing fallback behavior by default and continue accepting the
  boolean feature toggle.
- Limit displayed host paths in spawn errors to 512 bytes while retaining the
  executable-bearing suffix and valid UTF-8 boundaries.

## Testing

- Cover boolean and table-based feature configuration, fallback-disabled host
  failures, and bounded ASCII and UTF-8 error paths.

GitOrigin-RevId: ab3d014e79054c2f8beef9a658915f01cca197b2
2026-07-25 00:01:43 +00:00
jameswt-oai
0d2a0aa76b Track remote plugin IDs in skill invocation analytics (#35262)
## What changed

- Add `remote_plugin_id` to skill invocation facts and analytics event parameters.
- Propagate the ID for both explicit and implicit plugin skill invocations.

## Testing

- Cover explicit and implicit remote plugin skill invocations with analytics integration tests.

GitOrigin-RevId: 3e1d25b5ff88dcff9c2b6c9fe44bca97e8778221
2026-07-24 23:40:14 +00:00
Celia Chen
89a3b89c4c Route MCP auth discovery through runtime HTTP clients (#35239)
## Why

MCP authentication checks need to use the same HTTP routing as the MCP
transport so servers reached through configured proxies can be discovered
reliably.

## What changed

- Resolve OAuth discovery and authentication status through each server's
  runtime HTTP client for both local and managed environments.
- Keep local discovery capped at five seconds while allowing explicit login
  requests to retain their requested timeout.
- Resolve refreshed MCP configuration and its runtime context from the same
  snapshot.

## Testing

- Cover OAuth discovery through an environment proxy and macOS system proxy
  resolution.
- Cover proxied MCP startup and runtime refresh with updated authorization
  headers.
- Verify capped and preserved OAuth discovery timeout policies.

GitOrigin-RevId: 461fb1d4786e547df8b1e6b2215a8ac40438a3aa
2026-07-24 20:04:23 +00:00
Rasmus Rygaard
99744cfe04 Avoid persisting non-local threads for hook transcripts (#35221)
## Why

Hooks can only consume a transcript path when the thread has a local rollout.

## What changed

- Resolve the local rollout path before materializing the transcript.
- Return no transcript path for non-local thread stores without persisting them.
- Continue materializing lazy local rollouts before passing their path to hooks.

## Testing

Added session and hook tests covering both non-local thread stores and lazy local rollouts.

GitOrigin-RevId: c742984d146f7a3e1048b848198198fc7a64f4de
2026-07-24 17:41:39 +00:00
Owen Lin
05f000263b Support paginated thread forks (#35220)
## Why

`thread/fork` rejected threads using paginated history, so they could not use the same fork workflow as legacy threads.

## What changed

- Create paginated forks by referencing a frozen source-history prefix while persisting only child-owned records in the new rollout.
- Support latest, `lastTurnId`, and `beforeTurnId` boundaries, including inherited lineage, model-context reconstruction, interruption markers, and approval-reviewer inheritance.
- Make paginated reads and occurrence search traverse referenced history while excluding source records added after the fork.
- Coordinate fork preparation with archive and delete operations, and materialize compressed rollouts before they become fork references.

## Testing

Added app-server and thread-store coverage for boundary selection, active turns, inherited reads and search, compressed lineage, and concurrent source lifecycle operations.

GitOrigin-RevId: 66052d69517d7fb97a3b7817ab77a39c5ad995fd
2026-07-24 17:31:55 +00:00
jif
5f6a2c3adb Make the Apps recovery exposure test deterministic (#35196)
## Why

The Apps MCP background retry could complete before the test inspected the
initial sampling request, making the recovery timing nondeterministic.

## What changed

- Add a test-server gate that can hold and explicitly release the next
  successful Apps MCP initialization.
- Use a dedicated MCP mock server so the held initialization does not block
  model responses or app discovery.
- Assert that recovery uses exactly two initialization attempts and that Apps
  guidance and the deferred namespace appear only after the gate is released.

GitOrigin-RevId: deb21d4b41f353c3f84428616769af9faa1a0487
2026-07-24 14:41:21 +00:00
jif
1a817bb95d Wait for reloaded worker completion in the resume test (#35175)
## Why

The follow-up request assertion can run before the lazily reloaded worker has
finished handling its task.

## What changed

Poll the reloaded worker's status with a two-second deadline, then inspect the
recorded request after the worker reports completion.

GitOrigin-RevId: 4d53cdc5e5ed53009b4445385f8e835e19be7b8b
2026-07-24 13:04:23 +00:00
felixxia-oai
5dd992acd3 Route extension warnings to app-server threads (#35168)
## Why

Extension warnings need a stable thread target even when they are emitted outside an active turn.

## What changed

- Add `ExtensionWarning` and a dedicated `ExtensionEventSink::emit_warning` path with an explicit thread ID and optional turn ID.
- Deliver extension warnings as thread-scoped app-server `warning` notifications, preserving listener ordering and waiting briefly for a subscriber when no listener is active.
- Move skills warnings to the new path, limiting provider catalog warnings to four messages of 256 bytes each.

## Testing

- Cover warning routing, ordering, UTF-8-safe truncation, subscriber fallback, and invalid thread IDs.
- Verify skills warning bounds and app-server delivery of executor catalog budget warnings.

GitOrigin-RevId: 4dcb1ba7f17c0edb1a9d548f9568e0c734bffc15
2026-07-24 12:28:29 +00:00
jif
f201c30c52 Reconnect MCP servers on explicit refresh (#35151)
## Why

Runtime updates reuse unchanged MCP connections, so an explicit
`RefreshMcpServers` operation could leave existing server connections intact.

## What changed

- Mark explicit MCP refreshes to rebuild connections for every configured
  server on the next runtime replacement.
- Preserve the reconnect request if that replacement is cancelled before it
  finishes.
- Continue reusing connections for ordinary runtime updates.

## Testing

Update the transient Apps startup recovery test to wait for both turn
completion and the MCP server's ready event before checking the recovered tool.

GitOrigin-RevId: cb9fd978b3c07543058a2393a154fb70911531de
2026-07-24 10:22:58 +00:00
jif
ef2d3edb95 Prewarm MCP runtime updates in the background (#35144)
## Why

Changes to MCP inputs can require rebuilding the runtime before the next model
step. Start that work eagerly so the step is less likely to wait for it.

## What changed

- Add a per-session worker that prewarms dirty MCP state after configuration,
  authentication, or explicit refresh changes.
- Coalesce queued refreshes and always rebuild from the latest session state,
  while keeping exact model-step refreshes as the correctness path.
- Stop and join the worker during session shutdown.

## Testing

- Verify rapid refreshes skip superseded configuration and publish the latest
  state.
- Verify MCP-relevant policy changes mark the runtime for refresh.

GitOrigin-RevId: 045ed406caff97dcbb483bc183fd16eae0c7d7ad
2026-07-24 09:40:10 +00:00
TAFOYA-OAI
81da9deb06 Allow hosts to customize wait_for_environment descriptions (#35106)
## What changed

- Add `WaitForEnvironmentToolConfig` as thread extension data for overriding the
  model-visible tool and `environment_id` descriptions.
- Preserve the default descriptions when no override is provided or when the
  configured descriptions exceed the input or serialized tool-spec limits.
- Keep `wait_for_environment` availability gated by the deferred executor
  feature independently of whether a host override is present.

## Testing

- Cover default, custom, oversized, and feature-disabled tool configurations.
- Verify the custom descriptions in the deferred-environment integration flow.

GitOrigin-RevId: 6b49a73a434becd99ea5df911be53f3706a17c0a
2026-07-24 06:03:36 +00:00
Ahmed Ibrahim
3947f0d0c3 Avoid duplicating deferred sources in tool search (#35065)
## Why

Deferred tool world state already advertises the available tool sources, so
repeating them in the `tool_search` description adds redundant context.

## What changed

- Omit the source listing from `tool_search` when
  `DeferredToolWorldState` is enabled while preserving the tool discovery
  instructions.
- Include the source-listing mode in the tool search handler cache key so the
  description is rebuilt when the feature state changes.

## Testing

Added coverage for source omission, cache invalidation when the feature is
toggled, and the resulting request payload.

GitOrigin-RevId: f7dc0c4f3351a7c7daadec936b26a080202730bc
2026-07-24 01:23:49 +00:00
Ahmed Ibrahim
1d4b58f32d Track deferred tool namespaces in world state (#35063)
## What changed

- Add the disabled-by-default `deferred_tool_world_state` feature, which exposes deferred tool namespaces and their descriptions to the model in a `<tools>` world-state section.
- Emit added and removed namespace updates as tool availability changes, bound the rendered context size, and persist nonempty state across thread resumes.
- Omit empty tool state while retaining deferred tool discovery through `tool_search`.

## Testing

- Cover initial, unchanged, removed, recovered, empty, and resumed namespace state, along with description truncation and rendered-size limits.

GitOrigin-RevId: 867e599666dc3569eb0789ba78aaa40254253a6f
2026-07-24 01:20:04 +00:00
jif
091e4a5d7c Preserve refreshed Apps tools across MCP runtime updates (#35028)
## Why

After a remote plugin install refreshes the Apps tool catalog, a later MCP
runtime publication must not restore the catalog from the previous connection.

## What changed

- Rebuild the MCP runtime with fresh connections when hard-refreshing Apps
  tools, using the latest desired runtime configuration.
- Refresh the Apps catalog on the newly published connection so subsequent
  runtime updates retain it.

## Testing

Extend the remote plugin install test to verify that both newly available and
missing Apps tools remain consistent after an unrelated runtime configuration
refresh.

GitOrigin-RevId: 5b675d53d56379ab67fab09512fc2ad0ffcb8535
2026-07-23 23:10:00 +00:00
Kyle Brown
84fa68b429 Attribute command executions to trusted plugin scripts (#35020)
## What changed

- Resolve shell and unified-exec commands against the trusted plugin roots loaded for each turn.
- Add optional `pluginId` and safe plugin-relative `scriptPath` fields to command execution items and legacy execution events, and propagate them through app-server notifications.
- Include the attribution in command execution analytics while rejecting absolute, unsafe, and unattributed script paths.

## Testing

- Cover attribution for cached curated and remote plugin scripts from command execution through core and app-server events.
- Verify analytics serialization and unsafe-path filtering.

GitOrigin-RevId: 02fac3a233284ccfc6642fa502a95f1881dba83d
2026-07-23 22:31:53 +00:00
felixxia-oai
2c92af09cf Warn when skill catalogs exceed their context budget (#34997)
## Why

Skill catalog rendering can shorten descriptions or omit enabled skills to fit
the model context budget. Surface these reductions so users know when the
model-visible catalog has lost detail.

## What changed

- Emit a warning with the omitted skill count whenever entries do not fit.
- Warn when description shortening averages more than 100 characters per skill.
- Deduplicate executor catalog warnings across repeated world-state builds in a
  turn.

## Testing

- Cover the description-shortening threshold and omission warning text.
- Verify warnings through extension and production-turn catalogs, including
  per-turn deduplication.

GitOrigin-RevId: bd7fc3482e5dfd8c79072f772a2f54aa502478d9
2026-07-23 19:44:12 +00:00
Celia Chen
265cd2e100 Initialize execution environments with the final HTTP policy (#34995)
## Why

The TUI must inspect the default execution environment before loading its final
configuration. Initializing the environment manager at that point can give
startup services the bootstrap HTTP policy instead of the effective policy after
managed requirements are applied.

## What changed

- Split environment discovery from manager construction so callers can inspect
  the default environment without starting remote connections.
- Build the environment manager after final configuration loading and pass its
  resolved `HttpClientFactory` through all construction paths.
- Add shared test support for managers that use the legacy default HTTP policy.

## Testing

- Cover connection-free environment discovery and explicit HTTP policy
  propagation.
- Verify TUI startup services use the final managed `respect_system_proxy` value.

GitOrigin-RevId: 928fa31e6b4bcfbe1a121cade2f351427fdfa0f4
2026-07-23 19:24:41 +00:00
Adam Perry @ OpenAI
c769a05340 Honor the configured SQLite home across state consumers (#34994)
## Why

Codex and SQLite data can use separate home directories, but state consumers
could reconstruct database paths from the Codex home instead of consistently
using the resolved SQLite configuration.

## What changed

- Pass `SqliteConfig` through the core, rollout, state runtime, and thread store
  instead of passing a directory and rebuilding the configuration downstream.
- Use that shared configuration for state, logs, memories, goals, and paginated
  thread-history database access, including integrity checks and cleanup.
- Reject state database handles whose SQLite configuration does not match the
  requesting store.

## Testing

Add coverage with separate Codex and SQLite homes that verifies startup
backfill, thread listing, and paginated history all use the configured SQLite
directory.

GitOrigin-RevId: 1de1cdd1d6ff1d70bbb6c360c8352e6543fb8ebf
2026-07-23 19:19:35 +00:00
sayan-oai
74e9d7efc4 Allow omitting MCP tool prefixes per server (#34991)
## What changed

- Accept a table form of `features.non_prefixed_mcp_tool_names` with an
  optional `server_names` list while preserving the existing boolean form.
- Omit the legacy `mcp__` namespace prefix only for tools from selected MCP
  servers. When no server list is provided, the enabled feature continues to
  omit the prefix for every server.
- Cover configuration resolution, tool normalization, and an MCP stdio
  round trip with selected servers.

GitOrigin-RevId: bdfb7ac54226de5051f06610e2c6b78b23912ef0
2026-07-23 18:54:55 +00:00
jif
e19e65317a Reuse MCP connections across runtime refreshes (#34952)
## Why

Refreshing MCP runtime state should not restart an unchanged, ready server or
relist its tools.

## What changed

- Reconcile refreshed MCP configuration against the published connection set
  and reuse connections whose transport, environment, authentication, OAuth
  credentials, and client capabilities are unchanged.
- Keep tool filters, timeouts, metadata, and plugin provenance in the published
  server view so those settings can change without reconnecting.
- Update elicitation authority in place for reused connections, and reconnect
  when connection-defining inputs or live OAuth credentials change.

## Testing

Added coverage for unchanged-server reuse, view-only and elicitation-policy
updates, connection identity changes, OAuth credential changes, and avoiding
redundant tool listing.

GitOrigin-RevId: f04f5db5fbdde127b6a14f6aa9673112c0b557e7
2026-07-23 14:55:31 +00:00
jif
e497325a6a Centralize thread MCP state in McpRuntime (#34930)
## What changed

- Make `McpRuntime` own the published MCP configuration, connections, elicitation routing, and selected capability roots for a thread.
- Capture immutable MCP bindings for model steps and tool calls so in-flight work keeps a consistent connection set and approval authority while refreshed state is published atomically.
- Mark MCP state dirty when relevant configuration, plugins, environments, authentication, or elicitation capabilities change, then rebuild it before the next sampling request or out-of-band MCP operation.
- Separate config reloads from server invalidation: `ReloadMcpConfig` applies resolved MCP inputs, while `RefreshMcpServers` requests reinitialization from the thread's latest state.

## Testing

- Cover refreshed state visibility for existing turns, stable step bindings, current approval authority, cancelled refresh retries, resource-client reconciliation, and Apps recovery between sampling requests.

GitOrigin-RevId: 59eabb1aa8dc083426bd18ef4d3630508f376401
2026-07-23 11:27:34 +00:00
rka-oai
4462b9deef Allow disabling the multi-agent wait tool (#34887)
## What changed

- Add a default-on `features.multi_agent_v2.wait_agent_enabled` setting.
- Omit `collaboration.wait_agent` from the tool plan when the setting is disabled, independently of `features.current_time_reminder.sleep_tool`.

## Testing

- Cover configuration parsing and tool exposure with both clock sleep states.

GitOrigin-RevId: c2f34c5edd5bc191d6a5ac41d7bbb80708da1202
2026-07-23 06:28:27 +00:00
Boyang Niu
44d76c6a6d Wake sleeping threads for queued agent mail (#34852)
## Why

An idle thread with an outstanding durable sleep must resume when agent work
arrives, even when that message would normally remain queued without triggering a
turn.

## What changed

- Treat any pending mailbox message as wake-up work while a durable sleep is
  attached to the thread.
- Keep requiring `trigger_turn` for idle threads that are not durably asleep.
- Cover waking a sleeping root thread from queue-only agent mail and persisting
  the message in thread history.

GitOrigin-RevId: e361ac1b104436d4d63aebfe5e2422691a1cc139
2026-07-23 01:04:01 +00:00
Won Park
9d82334302 Use Guardian model limits for review sessions (#34847)
## Why

Parent context-window and auto-compaction overrides may describe a different
model than the one selected for Guardian review.

## What changed

- Clear `model_context_window` and `model_auto_compact_token_limit` when the
  effective Guardian model differs from the parent model, allowing the review
  model's own limits to apply.
- Preserve those overrides when Guardian uses the same effective model.

## Testing

Add unit coverage for both model-selection paths and verify that a Guardian
rollout records the selected review model's context window.

GitOrigin-RevId: ebc399f4eba37c7f279fd0d258154c00d45e2d00
2026-07-23 00:04:37 +00:00
sayan-oai
0f9fb40fa9 Allow custom providers to opt into standalone web search (#34846)
## What changed

- Add the `supports_standalone_web_search` model-provider setting, defaulting to `false`, and preserve it in remote thread configuration.
- Enable the standalone `web.run` tool for opted-in custom Responses providers when web search is enabled and the runtime provider supports it.
- Send standalone search requests through the custom provider's endpoint and authentication.

## Testing

- Cover opt-in, default-off, disabled-search, and unsupported-provider behavior.
- Verify custom-provider search request routing and authorization through the app server.

GitOrigin-RevId: 7c5f96b0ce924ad2b9715c45bfc635e89fc39cff
2026-07-23 00:02:15 +00:00
sayan-oai
0da13c6c99 Track multi-agent mode in world state (#34845)
## Why

Multi-agent mode instructions are durable model context and need to survive
history changes without re-emitting unrelated setup hints.

## What changed

- Add a `multi_agent_mode` world-state section that diffs, retains, and restores
  the effective mode instructions.
- Persist mode changes in world-state snapshots while keeping the legacy
  `TurnContextItem.multi_agent_mode` field for reading older rollouts.
- Keep initial mode instructions after the root-agent usage hint so the active
  mode takes precedence, and bound custom mode text before snapshotting it.

## Testing

- Add snapshot coverage for mode transitions, retained history, and custom-text
  truncation.
- Verify live mode changes preserve instruction ordering, avoid duplicating the
  usage hint, and record both modes in world state.

GitOrigin-RevId: 96b9964d6e5299b07a011c559b68e3d948a49226
2026-07-22 23:57:24 +00:00
Ahmed Ibrahim
d7e8f4c3dc Preserve user input when MCP startup is interrupted (#34839)
## Why

Interrupting a turn while MCP tools were still starting could abort before the
submitted user input was recorded in conversation history.

## What changed

- Build and retain the MCP tool list and tool router as part of each step
  snapshot, using the turn cancellation token during tool discovery.
- Record turn hooks and submitted input when cancellation occurs during startup
  prewarming, pre-sampling compaction, or first-step capture.
- Reuse the captured router for sampling, compaction, and prompt debugging so
  advertised and executable tools share the same request-scoped view.

## Testing

Add coverage that interrupts each affected MCP startup phase and verifies that
the user prompt remains in history before the turn-aborted marker.

GitOrigin-RevId: 6e96c6814357a55545d69b580e28f35933cfadf7
2026-07-22 22:50:13 +00:00