Commit Graph
5366 Commits
Author SHA1 Message Date
Won Park 26cb4d73e2 Add extra policy configuration for Guardian reviews (#47125)
## What changed

- Add `auto_review.extra_policy` and the managed `guardian_extra_policy` requirement to supply policy text alongside the resolved tenant policy. Nonblank managed values take precedence; blank values are ignored.
- Render the additional text through `{{ extra_policy }}` in Guardian reviewer templates and append it to the tenant policy for Guardian v2 classification before truncation.
- Preserve placeholder-like text inside supplied policies literally.

## Testing

Add coverage for configuration precedence, blank values, template substitution, and classifier prompts, plus a scenario verifying that managed tenant and extra policies reach the Guardian reviewer together.

GitOrigin-RevId: 180d8d716c63fe96a92ec5bfbd22db4ddccd4f1f
2026-09-21 23:06:36 +00:00
Krish Chainani 4a8cfe6bb7 Pass thread IDs to attachment uploads (#47121)
## Why

Attachment stores need the receiving thread ID to support thread-based placement.

## What changed

Add `thread_id` to `UploadRequest` and pass the session's thread ID through image preparation for messages and tool outputs. Include the ID in debug output while continuing to redact attachment bytes.

## Testing

Extend the image rollout test to assert that a new image uploaded after resume carries the resumed session's thread ID. Update the debug-output test for the new field.

GitOrigin-RevId: f81e3bd761dca704064287177b8ecd7175662f07
2026-09-21 22:58:49 +00:00
rhan-oai 5aa4939be4 Support model-catalog overrides for Code Mode tool messages (#47118)
## What changed

- Add `tools.code_mode` catalog messages for `exec`, `wait`, deferred-tool guidance, and shared MCP TypeScript definitions.
- Render `{{ default_exec_yield_time_ms }}` and `{{ image_helper }}` in `exec` descriptions while preserving runtime tool declarations and the freeform grammar.
- Resolve `wait` descriptions and parameter schemas independently, falling back to bundled parameters for invalid or unsupported schemas.
- Use the active model's Code Mode messages, including after mid-turn model changes. Missing overrides retain bundled defaults; empty text overrides suppress the corresponding text.

## Testing

Add coverage for literal template substitution, runtime section preservation, independent `wait` overrides and fallback behavior, mid-turn model changes, and a yielded cell completing through `wait` with catalog messages.

GitOrigin-RevId: e542a0cd47a7138a414871192cee47790ed1214e
2026-09-21 22:49:17 +00:00
Jesse Du 3fd5160cd6 Honor the configured product SKU in remote plugin requests (#47116)
## Why

Remote plugin requests always sent `OAI-Product-Sku: codex`, ignoring the existing `apps_mcp_product_sku` setting.

## What changed

Pass `apps_mcp_product_sku` through plugin configuration and use it for authenticated remote plugin requests, including discovery, search, installation, and sharing. Keep `codex` as the default and include the SKU when comparing remote service configurations.

## Testing

Extend app-server plugin listing and core agent-turn tests to check default and configured SKU headers. Update the CLI worktree test to wait for the user prompt's model request, skipping background title generation requests.

GitOrigin-RevId: 508c9ef9aa3e41b87c92383c3088eb1eb9227fd8
2026-09-21 22:30:43 +00:00
Jeremy Rose 23ae65bb06 Persist thread creator identity in rollouts and SQLite (#47113)
## What changed

- Capture optional `creator_user_id` and `creator_account_id` from authentication when creating a thread, including forks.
- Carry these fields through thread storage, rollout metadata, and a SQLite migration. Leave them absent when unavailable or when reading older threads.
- Preserve recorded creator values across resume and metadata updates. On revert, recover missing rollout values from SQLite before writing replacement metadata.

## Testing

Add coverage for ChatGPT and API-key sessions, resume under another account, forks using current authentication, metadata extraction and upserts, and repeated reverts after creator fields are removed from a rollout.

GitOrigin-RevId: 9839fa42f9392f12226002e2c27d05d5656f5695
2026-09-21 21:22:01 +00:00
Eddie Chen 6a601c00da Preserve originating turn metadata for yielded skill calls (#47106)
## Why

Code Mode callbacks can retain skill tools after another turn becomes active. Looking up the active turn when a delayed skill invocation completes can lose access to the originating turn's metrics and metadata.

## What changed

- Capture and retain the originating `SkillTurnMetrics` when constructing skill analytics.
- Expose turn analytics metadata through the turn extension store and carry it into skill telemetry.
- Add optional turn metadata to `TrackEventsContext` and pass it from app, skill, and plugin usage call sites.

## Testing

Add a regression test that yields a Code Mode cell, starts another turn, and releases both skill reads through a shared barrier. Assert that each `skill_invocation` event retains its originating `turn_id`.

GitOrigin-RevId: aa629dd5f84563d558aa6a86bfbdfc356f1b98e4
2026-09-21 20:34:46 +00:00
Celia Chen 142360dac8 Honor configured proxies for realtime WebSocket connections (#47101)
## Why

Realtime WebSockets connected directly, bypassing the configured proxy policy for Voice's WebRTC sideband.

## What changed

Pass the configured `HttpClientFactory` into `RealtimeWebsocketClient` and connect through the shared `WebSocketConnector`. Add support for supplying an existing Rustls configuration to preserve custom CA handling and Windows platform trust.

## Testing

Add an integration test that enables `respect_system_proxy`, starts a WebRTC conversation, and verifies that the sideband establishes its session through an HTTP `CONNECT` proxy and closes successfully.

GitOrigin-RevId: d974c9275d7fe29f388d56a9d5d8ce0c483eb8d0
2026-09-21 20:05:21 +00:00
andrewgu-oai deb0a08f24 Update model catalog descriptions and GPT-5.6-Sol priority (#47085)
## What changed

- Describe GPT-5.6-Sol as a reliable agentic workhorse for everyday tasks and change its catalog `priority` from `6` to `4`.
- Describe GPT-5.5 as a proven previous-generation model for coding and general work.
- Refresh model picker, migration prompt, and agent tool snapshots to reflect the catalog updates.

GitOrigin-RevId: b39f51c22862b8cef585ed76f3973c9f4b670c27
2026-09-21 18:36:13 +00:00
peilin-openai ac98537678 Track cumulative MCP attribution across requests and thread history (#47081)
## What changed

- Record each MCP source and its first turn, including connector and plugin identifiers when available. Cover direct and Code Mode calls, including returned errors and results that are not printed.
- Persist cumulative attribution checkpoints and restore them across compaction, resume, and forks, including forks limited to recent turns.
- Attach fresh attribution to Responses API `client_metadata` under `mcp_attribution`, outside model-visible content. Restrict transmission to allowed OpenAI HTTPS destinations for both HTTP and WebSocket requests.
- Report `attribution_error` for legacy history without checkpoints, malformed or conflicting attribution, and serialized attribution exceeding 16 KiB.

## Testing

Add coverage for source deduplication, checkpoint persistence and restoration, recent-turn forks, direct and Code Mode calls, destination filtering, and the serialized size limit.

GitOrigin-RevId: fd285e152ca9e24bfa000debb20013709d67a86e
2026-09-21 18:19:07 +00:00
sayan-oai 62ea6d41e8 Serialize environment updates and cancel removed pending attachments (#47077)
## Why

Concurrent credential refreshes could restore a removed environment by overwriting the selection list with stale state. Unpolled snapshot futures could also keep pending configuration alive after an environment was removed.

## What changed

- Protect environment selections with a mutex and update them in place to serialize selection changes, configuration refreshes, and connection listener setup.
- Capture only selection metadata and resolution futures in snapshots so they do not retain pending configuration senders.

## Testing

Add regression tests for removal during credential refresh and cancellation while an unpolled snapshot is held. Strengthen the pending attachment integration test to check that `wait_for_environment` returns the expected environment ID and `ready` status.

GitOrigin-RevId: c6f933e8d3031b05335ddcfed00ab400aa5bad2a
2026-09-21 17:53:03 +00:00
jif e51aacad60 Include attributed previews in agent message board notifications (#47075)
## Why

Message board notifications exposed only post and thread IDs, requiring a read to see any post content.

## What changed

Deliver notifications as `agent_message` items with author and recipient attribution. Include a `CHANNEL_POST` payload with the sender, channel, message and thread IDs, and up to 150 characters of post text. Direct agents to `read_post` when the preview is truncated, and retain recognition of legacy user-role notices.

## Testing

Update the model-context scenario to assert the notification's author, recipient, and preview payload, and update the idle-agent scenario to check for the new notification format.

GitOrigin-RevId: e0e2794be82e38bba47f41fb4fc8128eb5e47619
2026-09-21 17:29:13 +00:00
Anthony Tafoya f3037cafd3 Refresh host-supplied cloud skills at turn startup (#47074)
## What changed

- Replace the built-in orchestrator skill provider with a host-supplied cloud provider, using `cloud` authority and `c` root aliases in skill tools and prompts.
- Add `cloud.skills.enabled`, defaulting to true but requiring a supplied provider. Keep `orchestrator.skills` accepted as a legacy no-op setting, and remove the app server's automatic orchestrator provider registration.
- Discover cloud skills once per turn during cancellable startup. Serve catalog snapshots to prompts and tools without triggering discovery or retries.
- Scope cached catalogs and resources to authentication state. Preserve them on refresh failures within the same scope, invalidate them when that scope changes, and reject late discovery or read results from replaced cache generations.
- Reuse executor discovery catalogs only when successful discovery inputs and bundled-skill settings match.

## Testing

Add coverage for per-turn refresh, skill removal, same-account failures and reconnects, authentication changes, and stale in-flight results. Update configuration and tool tests for cloud authority, provider gating, and resource reads without an executor.

GitOrigin-RevId: c57e38ec7dcc880c0d4c8a2995adfd3e28301079
2026-09-21 17:28:14 +00:00
jif 20cdcb0156 Wait for thread idle in Guardian context budget tests (#47073)
## Why

`TurnComplete` precedes active-turn cleanup, so injecting follow-up history immediately afterward can race with cleanup.

## What changed

Register the `ThreadIdle` lifecycle contributor in `review_preserves_user_instructions_until_request_budgeting` and wait for the thread to become idle after the initial and follow-up turns.

GitOrigin-RevId: 1ae6c80593a71d331c5c6ddf85bbe10822a68afe
2026-09-21 17:25:25 +00:00
felixxia-oai 3483294596 Preserve delivered messages through post-tool hook failures (#47039)
## Why

Guardian can lose a confirmed User Messaging message from its parent context when a `PostToolUse` hook blocks the result or is cancelled. The message has already been sent and remains relevant to interpreting the user's authorization.

## What changed

Capture confirmed message text after input-rewriting hooks in shared per-call state before awaiting post-tool processing. Attach that evidence to the response metadata even when dispatch returns a blocked or aborted result, while keeping post-tool hooks cancellable. Calls cancelled before delivery confirmation contribute no message evidence.

## Testing

Extend Guardian subagent authorization coverage to verify retained messages after post-tool hook blocking and cancellation, and their absence when cancellation precedes delivery confirmation.

GitOrigin-RevId: 9abb7959980eada20d0fb5c0b3a4a8669e4cd0a3
2026-09-21 14:14:21 +00:00
Charlie Marsh 3ead673946 Defer extension tool history materialization until first access (#47035)
## Why

Extension tool calls eagerly copied and converted conversation history even when the tool never read it.

## What changed

Retain a shared invocation-time snapshot and defer conversion to raw response items until `ConversationHistory::items()` is called. Cache the result across clones with `LazyLock`, and keep debug formatting from triggering materialization. Release unrelated history metadata when capturing the shared items.

## Testing

Extend the extension executor test to verify that history first read after a later turn still reflects the invocation-time snapshot, in both legacy and paginated history modes. Update the history API test to check that shared items preserve their envelopes.

GitOrigin-RevId: c737b765b7e4889735dc78e12d685d36e854570b
2026-09-21 13:56:17 +00:00
felixxia-oai f585f13a12 Preserve ordered assistant context in Guardian reviews (#47030)
## Why

Guardian's retained root context appended assistant messages after user evidence and omitted questions sent through User Messaging. This could leave subagent authorization reviews with missing or misplaced conversational context.

## What changed

- Record assistant messages and function calls in the same order sequence as accepted user inputs, then merge retained review context by recorded position while prioritizing user evidence within the message budget.
- Capture bounded User Messaging text after input hooks when a send succeeds, and match it to the original call for assistant context.
- Label assistant context without a recorded position explicitly and clear parent assistant and tool positions when forking agent history.
- Clarify that recorded order does not establish delivery order or pair ordinary replies with questions; assistant messages remain untrusted context.

## Testing

Add coverage for hook-rewritten messages, failed or unconfirmed sends, queued replies with delayed tool results, ordering across resume, and removal of inherited assistant positions from forked history.

GitOrigin-RevId: ac717cf0f5efe4b05c18f2d8370dd48453ac4e35
2026-09-21 13:30:55 +00:00
jif 73129716c2 Delete persisted message boards with their root threads (#47029)
## Why

Permanent thread deletion needs to remove persisted agent message board data even when the message board feature has been disabled.

## What changed

- Add a cleanup hook for single and batch thread deletion, invoked after reference and writer checks but before rollout removal so cleanup failures remain retryable.
- Remove the deleted roots' channels, posts, and subscriptions regardless of the current feature setting.
- Record board tombstones and check them within write transactions to prevent delayed writes from recreating deleted data.

## Testing

Add an app-server regression test that creates a board, archives its root thread, restarts with the feature disabled, and verifies that permanent deletion removes the persisted channels, posts, and subscriptions.

GitOrigin-RevId: 4ea71559a8df0814dffda23a056a9bbaf6e0a0cb
2026-09-21 13:28:02 +00:00
jif 8a62cc4dc1 Align message-board tools with the multi-agent namespace (#47028)
## Why

Message-board tools hardcoded the `collaboration` namespace and used a different namespace description from the multi-agent tools. This ignored custom namespace configuration and caused conflicts under strict tool collision checking.

## What changed

- Use `multi_agent_v2.tool_namespace` and the shared multi-agent namespace description for message-board tools, resolving the namespace at runtime startup.
- Support unnamespaced tool specifications when no namespace is supplied.
- Remove hardcoded `collaboration` prefixes from message-board notifications.

## Testing

Add app-server integration coverage for the default `collaboration` namespace and a configured `agents` namespace with strict collision checking enabled. Verify that both tool families are advertised together and that `get_channels` executes through the installed extension.

GitOrigin-RevId: fef7be51ea2a84bbdb6d3491606db442ed4e6ea3
2026-09-21 13:27:39 +00:00
jif 6149914a0e Wire agent message boards into persistent multi-agent runtimes (#47017)
## What changed

- Register the existing message-board tools with the app server through a lifecycle extension, gated on `agent_message_board`, multi-agent v2, and non-ephemeral sessions. The new feature flag is disabled by default.
- Bind tools to each agent's identity and share the SQLite-backed board across the agent tree and runtime resumes.
- Use the runtime clock for posts and deliver ID-only notifications to running agents, with tools to retrieve post contents. Skip inactive recipients without starting them or queuing notices.
- Emit a warning and leave board tools unavailable if initialization fails.

## Testing

Add runtime scenarios and a context snapshot covering feature gating without creating storage, posting and searching, active-only notifications, sharing with child agents, persistence across resume, and clock failure without channel creation.

GitOrigin-RevId: a81bd85cd372b0d122ba375ed1a1bfd3ba3a3b7c
2026-09-21 12:35:36 +00:00
jif 7d99ee82d7 Add agent inspection without restoring unloaded runtimes (#47010)
## Why

Agent inspection needs to distinguish registered but unloaded agents from missing identities and backend failures without restoring a runtime.

## What changed

- Add inspection returning `AgentInfo` with metadata, status, and configuration for loaded agents, or metadata for unloaded agents.
- Use inspection for configuration snapshots and to capture an agent's state before interruption.
- Add `AgentInfo` accessors and share V2 error mapping between interruption and messaging tools, preserving the distinction between invalid requests and a dropped thread manager.

## Testing

Extend the V2 reload test helper to assert that inspecting a registered, unloaded agent returns `AgentInfo::Unloaded` and leaves its runtime unloaded.

GitOrigin-RevId: fa897264ff3ff3ec6cc76259d8482be55dec0c0a
2026-09-21 11:50:27 +00:00
felixxia-oai ebc05da3bd Decouple tool restrictions from session identity with ToolPolicy (#46999)
## Why

Tool allowlists alone cannot express the reviewer's sandbox and shell restrictions, which previously depended on session identity. Threads need to supply these restrictions explicitly at startup.

## What changed

- Replace `AllowedTools` with `ToolPolicy`, combining an optional allowlist with managed-sandbox requirements, unified-exec requirements, and control over additional-permission arguments.
- Capture the policy once at startup and apply it during tool registration and construction, including hosted tool filtering. Later extension-state changes cannot relax it.
- Supply the reviewer policy explicitly while retaining the fallback for reviewer sessions without a supplied policy. Explicit policies take precedence over session identity; ordinary defaults preserve existing tool setup.

## Testing

Update tool-planning tests to use explicit policies and add startup coverage for additional-permission schemas, ordinary defaults, reviewer fallbacks, explicit-policy precedence, and policy capture despite later extension-state changes.

GitOrigin-RevId: 71e561d76ea24d961f5b29c7c619bdb1356c216a
2026-09-21 10:40:40 +00:00
jif 3938a27c1d Route agent delivery through captured send requests (#46994)
## What changed

Replace `LocalAgentControl::deliver_message` with `send(SendRequest)`, accepting both user input and agent messages with captured resume configuration and turn options. Resolve target references relative to the caller's registered identity and return recipient metadata and a submission ID in `DeliveryReceipt`.

Migrate the V2 messaging tools to the new entry point and use receipt metadata for activity events. Preserve recipient reload behavior, non-waking queue-only messages, and rejection of follow-up tasks targeting the root agent.

## Testing

Update the cold-resume and sibling-reload tests to exercise `SendRequest` while checking instruction inheritance.

GitOrigin-RevId: 8fd330b8a9c3510483110ed05c4c9d3d616db237
2026-09-21 10:11:53 +00:00
teddywyly-oai a6fdb11eda Preserve metadata in native user verification requests (#46952)
## Why

Native `openai/userVerification` requests need to carry optional `_meta` to clients for extension-specific presentation.

## What changed

- Accept optional metadata objects with the same validation as MCP elicitation.
- Restore metadata from the MCP request context, excluding `progressToken`, and forward it through `mcpServer/elicitation/request`.
- Update protocol types, schemas, and documentation while retaining support for requests without metadata. Challenge bytes and acceptance proofs remain unchanged.

## Testing

Add coverage for metadata validation, transport context restoration, and protocol round trips. Extend MCP integration tests to check that verification metadata reaches the client.

GitOrigin-RevId: 5d04004244cf33effac675c19e543157c48d1504
2026-09-21 07:01:52 +00:00
Eric Traut a86631502d Add independent TUI rendering toggles for Mermaid, math, and tables (#46938)
## What changed

Add `tui.rendering.mermaid`, `tui.rendering.math`, and `tui.rendering.tables`, all enabled by default and independent of animation settings. Disable individual renderers to display their source instead of diagrams, Unicode math, or formatted tables.

Apply preferences to streaming and completed responses, startup previews, and session changes. When table rendering is disabled, preserve pipe syntax, cell markup, and enclosing Markdown fences. Keep HTML clipboard formatting independent of terminal rendering preferences.

## Testing

Add coverage for individual defaults, source preservation, nested table fences, session settings, and clipboard behavior. Verify incremental rendering and emitted output match completed rendering across all eight toggle combinations.

GitOrigin-RevId: 48d765eac20a82881eed94f186bf5b025ff4f0db
2026-09-21 03:38:46 +00:00
Rennie c45ea25ffb Allow subagents to request MCP elicitation input (#46877)
## Why

MCP requests requiring user input previously failed in subagents with guidance to ask the parent agent, blocking browser sign-in, form input, and interactive tool approval in the child thread.

## What changed

Remove the root-only MCP elicitation guard and `allow_user_interaction` plumbing so subagents can surface prompts and wait for responses under the existing approval policy and automatic review rules. Connector authentication can now return retry guidance after acceptance or preserve the original failure when declined.

Keep legacy tool approvals through `request_user_input` restricted to the root thread.

## Testing

Update unit and integration coverage for subagent prompt resolution, form responses, connector authentication acceptance and decline, automatic approval, strict review, and approval-policy updates on reused connections. Update the browser sign-in scenario snapshot to show the subagent continuing after an accepted response.

GitOrigin-RevId: c226fc6dfde724ed22b91dc04dd32bbc15245bee
2026-09-20 19:42:18 +00:00
Eric Traut a2de8fedcc Move fullscreen transcript control to TUI configuration (#46849)
## What changed

Use `tui.fullscreen_transcript` to opt into the fullscreen transcript, including scrolling, selection, and search. It defaults to `false`; `--no-alt-screen` and `tui.alternate_screen = "never"` still take precedence.

The new preference controls both the first frame and application startup. Boolean CLI overrides for it are allowed during daemon startup. The old `features.transcript_v2` flag is deprecated and ignored, with a notice directing users to the new setting; it does not migrate into or override the preference.

## Testing

Add coverage for default terminal scrollback, fullscreen persistence through startup, alternate-screen restrictions, daemon override validation, and independence from the deprecated flag. Update existing history and activity tests to use the new preference.

GitOrigin-RevId: 4117bf1ee548fa8d101a594f9506673d87c74c15
2026-09-20 16:59:00 +00:00
Eric Traut bba48e5ce8 Add independent controls for TUI visual effects (#46832)
## What changed

Replace `tui.whimsy` with `[tui.effects]` preferences for `starfield`, `shimmer`, `welcome`, `effort`, `progress`, and `title`. Each defaults to `true` and remains subordinate to the `tui.animations` master switch.

Wire the preferences into composer effects, welcome artwork, status and loading text, progress indicators, and terminal-title animations. For example, disable shimmering text while keeping progress animations:

```toml
[tui.effects]
shimmer = false
```

Keep retired `tui.whimsy` entries loadable but ignore their value. Update the configuration schema to expose the new preferences.

## Testing

Add and extend coverage for independent shimmer and progress effects, master-switch precedence, welcome and starfield controls, terminal-title blinking, and strict configuration loading with the retired setting.

GitOrigin-RevId: 28b37ba52872133b8954543cabe9ff424147f1c5
2026-09-20 16:16:46 +00:00
Eric Traut df7f717c85 Add transcript search and per-activity detail controls (#46734)
## What changed

- Add incremental, case-insensitive literal search across transcript details, loading older history as needed. Use `F3` to start Find, or `/` in the transcript pager, and navigate matches in either direction. Closing Find restores the previous presentation and reading position.
- Add clickable activity detail controls and `F4` keyboard focus for inspecting individual activity groups in the owned transcript. Preserve expansion state as live activity becomes history.
- Expose configurable `global.find_transcript`, `global.focus_activity`, and `pager.find` bindings under `tui.keymap`. Let new defaults yield to existing custom bindings and show available completions for pending chords.

## Testing

Add regression coverage for Unicode matching, bounded scanning, paginated and changing history, selection during search, composer input isolation, activity controls, and custom shortcut conflicts.

GitOrigin-RevId: 5bcbcdfbca7c5c296c635ec9b079ccd7a908e336
2026-09-20 00:06:25 +00:00
Charlie Marsh daed4b9755 Split shell snapshot credential tests into focused cases (#46715)
## What changed

Extract shared proxy setup into `credential_snapshot_proxy()` and split POSIX startup protection and inherited credential alias checks into separate tests, each with its own temporary directory and proxy. Preserve the existing assertions.

GitOrigin-RevId: 1799526c7c649c9bacd30a8cc4fa7038e70f192d
2026-09-19 20:41:55 +00:00
ningyi-oai ed0ee704b4 Recover executed tool call metadata under recorder capacity pressure (#46712)
## Why

Orphaned output mappings and pending calls from finished cells can exhaust recorder capacity, preventing fresh code mode calls from attaching complete executed tool call metadata.

## What changed

Reclaim output mappings without remaining cells when the mapping limit is reached. Under cell or pending-call pressure, evict finished cells without output mappings, invalidate their retained completion markers, and release their pending-call count. Preserve the cell being registered and keep late records until capacity pressure requires cleanup.

## Testing

Add regression coverage for preserving existing cells and late partial records under mapping pressure, and an integration test verifying that a fresh code mode call carries its executed calls, cell ID, and completion marker after orphaned mappings fill the recorder.

GitOrigin-RevId: 8894d1283a962088fbf8cad60078cc0cd07aaf17
2026-09-19 20:31:30 +00:00
Eric Traut a5290028a2 Extend server version notices to prerelease and local clients (#46673)
## Why

Server version notices previously required both versions to be stable releases, leaving prerelease and local clients without notices about differing background services.

## What changed

- Use semantic version parsing to distinguish older servers from version mismatches.
- Compare stable clients against older releases, including prereleases. Compare prerelease clients by precedence within the same release line and report other release lines as different.
- Report differing versions for local clients (`0.0.0` or versions with build metadata). Ignore malformed versions.
- Show the corresponding `older than` or `different from` notice and `<` or `≠` overview indicator, while preserving `/daemon` guidance and the `show_server_version_notice` setting.

## Testing

Add version-policy tests and notice snapshots covering prerelease ordering, local builds, mismatches, and malformed versions. Add daemon tests for notice suppression and manual update guidance without scheduling an update.

GitOrigin-RevId: 29df4713a7dbcbddcf30d56995a8496e7e8d0c6a
2026-09-19 17:03:26 +00:00
jif ed12cc75d3 Keep Guardian reviews on the applied instruction snapshot (#46580)
## Why

Shared thread instructions can change after an action is generated but before Guardian reviews it. Polling the live provider during review can give the reviewer different instructions from those applied to the action.

## What changed

Initialize Guardian reviewers with the user and thread instructions captured in the review session reuse key, keeping the review tied to the applied snapshot.

## Testing

Add a regression test that updates and removes shared instructions between action generation and review in a running descendant thread. Verify that the worker picks up each change, Guardian uses the applied instructions, and instruction changes create new reviewer sessions even while ancestor threads remain idle.

GitOrigin-RevId: 4980762bc7b6646a1691a43be93c71a7dc611ec6
2026-09-19 02:31:40 +00:00
vinh-gpt e24ac448b3 Allow thread instruction providers to share updates with subagents (#46577)
## Why

Subagents inherit applied instruction snapshots, so later provider updates do not reach running descendants. Hosts need an explicit way to share current thread instructions across an agent tree.

## What changed

- Add `ThreadInstructionsProvider::share_with_subagents()`, defaulting to `false`. Opted-in descendants refresh instructions at their next model-request boundary.
- Retain shared providers across root unloads and descendant reloads. Let a resumed root replace the provider for surviving descendants, or preserve their last shared instructions when it supplies a non-sharing provider.
- Keep providers scoped to their root tree and preserve snapshot-only instructions for root forks and isolated sessions, including Guardian reviews.

## Testing

Add coverage for child and grandchild instruction updates and clearing, provider replacement after root restart, lazy descendant reloads, default snapshot inheritance, and isolation between roots and Guardian sessions.

GitOrigin-RevId: 44c9fb7fe9ae1f96156bdf3c47ab6c4a81bd65e9
2026-09-19 02:15:20 +00:00
Anthony Tafoya 394dadb93d Add turn-start cloud plugin discovery to the MCP extension (#46572)
## What changed

- Support an optional cloud provider alongside executor plugins, refreshing its thread-scoped catalog at each regular turn when plugins are enabled.
- Use cloud connector metadata for app attribution without starting cloud-declared MCP servers.
- Scope cached catalogs to authentication and Apps availability. Retain the previous catalog on discovery failure within the same scope, clear stale catalogs on auth changes, and reject results completed under outdated credentials.
- Add a cancellable regular-task startup phase that reconciles MCP before discovery and reapplies contributor state afterward without invalidating resource caches.

## Testing

Add regression coverage for per-turn refresh, empty catalogs, discovery failures, plugin disabling, auth changes during discovery, MCP reconciliation and cancellation, and cloud app attribution alongside executor MCP tools.

GitOrigin-RevId: 8469eb109ea316e21cbc4122c52ad8000caeef03
2026-09-19 02:07:58 +00:00
sayan-oai 5685183570 Use captured environment state for permissions and daemon recovery (#46568)
## Why

When a selected environment is unavailable, permission fallbacks can use the turn's initial environment and workspace roots. Daemon recovery can also miss a local environment that finishes starting after the turn begins.

## What changed

- Resolve fallback permissions from thread defaults using the captured selection's workspace root URIs, including when setup is starting or has failed.
- Apply this resolution to Guardian reviews, permission instructions, and sandbox context selection.
- Capture daemon recovery from the latest step inputs and refresh environment readiness before checking recovery eligibility.

## Testing

Add regression tests for Guardian resolving project-root restrictions against an unavailable captured environment's workspace and for daemon recovery including a local environment that finishes starting during a turn.

GitOrigin-RevId: c76d83d786fdc9c444b78ecbc335b02a20805c58
2026-09-19 01:56:57 +00:00
Abhinav 3bb0a530d1 Add system proxy fallback for login and startup requests (#46562)
## Why

Login and enterprise configuration bootstrap can fail when their endpoints are reachable only through the system proxy, before cloud configuration can enable `respect_system_proxy`.

## What changed

- Enable `features.system_proxy_fallback` by default, honor managed feature requirements, and prevent project configuration from changing it.
- Retry account discovery and cloud configuration GETs through the system proxy after connection failures or timeouts, bounding the initial request and body read to five seconds.
- Retry OAuth authorization-code exchange only on connection failures before any redirect, with a ten-second connection timeout. Reuse the successful client for the subsequent API-key exchange to avoid changing routes.
- Increase workspace discovery and cloud configuration timeouts to 15 and 20 seconds, respectively, to accommodate fallback.

## Testing

Add coverage for proxy-only browser login through the first completed turn, including cloud configuration enabling `respect_system_proxy` without a restart. Cover stalled GET bodies, preserved request headers, disabled fallback, managed requirements, and project configuration restrictions. Verify that OAuth HTTP errors, redirects followed by connection failures, and failures after sending the POST do not trigger proxy retries, while successful redirects remain supported.

GitOrigin-RevId: 854eeeac186bb4865218ce645019c1e4bff85425
2026-09-19 01:37:14 +00:00
andrewgu-oai 888be42a20 Support explicit provider model catalog URLs (#46561)
## Why

Providers need to serve Codex model metadata independently of their inference endpoint. A custom inference `base_url` alone should not opt API-key sessions into remote catalog discovery.

## What changed

- Add `model_catalog_url` to provider configuration and thread-config serialization. Fetch the full catalog URL with provider authentication, headers, query parameters, and `client_version`, while preserving inference routing.
- Require an explicit catalog URL for API-key discovery with a custom base URL. Keep default OpenAI discovery on the Codex backend, and apply `api_key_model_discovery` gating to provider API keys and cached catalogs.
- Include the catalog URL in cache identity so different catalogs do not share cached metadata.
- Limit explicitly configured catalog responses to 1 MiB, reject redirects, and suppress URL and response diagnostics that could expose credentials.

## Testing

Add coverage for catalog configuration round-trips, query encoding, authentication and header reuse, cache identity and discovery gating, oversized responses, and redirect rejection without credential forwarding. Add an integration test verifying that catalog model metadata and instructions reach conversation requests.

GitOrigin-RevId: 7f6ac5eec257278685e1867a6bcebae6514a365a
2026-09-19 01:36:53 +00:00
sayan-oai c2a924fc4a Fix stale environment config in the network approval test (#46560)
Remove the obsolete `windows_sandbox_private_desktop` field from the
`EnvironmentConfig` initializer in the active-turn environment fallback test
so it matches the current struct definition.

GitOrigin-RevId: 4441dc8ed3d4bfcd4c1de093e829c065d323f41a
2026-09-19 01:35:38 +00:00
jif e416eadf7f Encapsulate rollout budget accounting in LocalAgentControl (#46559)
## What changed

Replace direct access to the shared rollout budget with controller methods for
recording token usage, retrieving pending reminders, and marking reminders as
delivered. Move the `SessionBudgetExceeded` check into the controller and update
session and guardian callers, preserving reminder acknowledgment after insertion
into conversation history.

## Testing

Replace the shared-budget pointer assertion with a behavioral check: recording
25 output tokens in a reviewer session leaves 75 tokens in the parent session's
budget reminder when the initial budget is 100 tokens.

GitOrigin-RevId: 003bc2b56e526787c1864c09729bbad1006e243d
2026-09-19 01:34:59 +00:00
sayan-oai cd2f9ca692 Fix active-turn environment selection lookup (#46557)
Read `initial_environments` in `active_turn_environment_selections` to
return the environment selections captured at turn start.

GitOrigin-RevId: 445b52508733ef971eb6d2d7eea2b2f019542d5f
2026-09-19 01:27:48 +00:00
sayan-oai c7828dd010 Keep step settings and approval environments consistent (#46556)
## Why

Background processes can outlive their launching turn. Their approval reviews need the originating environment's filesystem restrictions, even when the active turn uses a different environment. Remote restrictions must also be resolved using executor paths rather than the local filesystem.

## What changed

- Capture settings and environment selections together in `StepInputs`. Preserve the captured selection during active model updates while allowing environment startup to finish.
- Carry environment IDs into Guardian network and `execve` requests, and use the owning process's environment with current review settings. Refresh environment readiness for network requests that fall back to the active turn.
- Resolve remote denied paths and globs using the executor's policy context. Decline automatic approval when the request's environment is unavailable or an explicitly denied temporary directory cannot be resolved.

## Testing

Add regression coverage for active model updates retaining their environment while the next turn adopts a new selection, background approvals using their owning environment, newly ready network environments, and remote denied paths and globs, including Windows paths and missing temporary-directory metadata.

GitOrigin-RevId: b620d4b030c597a4f430fe0500864fa5469db3d4
2026-09-19 01:27:26 +00:00
viyatb-oai 328feb0c29 Track executor registrations across connection refresh and recovery (#46555)
## Why

An executor can renew its registration while retaining its Noise identity. Connection refresh must distinguish registrations even when their keys match, and a stale registry lookup must not retire a session that recovery has already renewed.

## What changed

- Track the installed session's registration and expose it through `Environment::cached_executor_registration_id()` without connecting. Publish registration changes only when the new connection is installed.
- Require both registration and executor key to match before refresh reuses a session. Retry stale lookups and prevent recovery from installing a connection after retirement.
- Pin session recovery to the original Noise key while allowing registration renewal to preserve the session and running processes.
- Expose `CodexThread::active_turn_environment_selections()` so hosts can authorize steering against the active turn's selections, including starting and failed environments, independently of later settings updates.

## Testing

Add regression coverage for registration replacement, renewal with a running process, stale refresh lookups, missing sessions, and rejection of changed Noise keys. Extend active-turn tests to check selection snapshots across settings updates, deferred startup, and turn completion.

GitOrigin-RevId: 4395bc6c57f137691887e6585f52dcc5b958101c
2026-09-19 01:27:02 +00:00
iceweasel-oai a633ebc124 Always use private desktops for legacy Windows sandboxes (#46554)
## What changed

- Remove the private-desktop opt-out from elevated and unelevated Windows sandbox launches.
- Remove `windows.sandbox_private_desktop` and its managed requirement and API fields. Warn users to remove the obsolete setting.
- Require a private desktop name when launching through the Windows sandbox wrapper and command runner.

## Testing

Add coverage for the obsolete-setting migration warning and update wrapper tests to verify a live private desktop is passed and a missing desktop name is rejected.

GitOrigin-RevId: c7135f8d211aac8d812180691c2c1e433d77cde4
2026-09-19 01:21:32 +00:00
jif c6f5d9e9b5 Return LiveAgent records from agent listing (#46553)
## What changed

Return thread IDs, metadata, and status from `LocalAgentControl::list_agents` using the shared `LiveAgent` type. Move conversion to `ListedAgent` into the tool handler, preserving the `list_agents` response fields and the thread ID fallback for agents without a path.

GitOrigin-RevId: c935cf96ab2a370645a4b74e3306540fc2d168a5
2026-09-19 01:21:09 +00:00
jif 7a15548c6a Move child completion routing into the agent controller (#46552)
## What changed

Have `Session` capture terminal child state in an `AgentTurnOutcome` and delegate delivery to `LocalAgentControl`. Move parent notification and completion activity routing into `agent/control/completion.rs`, so routing no longer takes the child's live `TurnContext`.

Preserve best-effort, queue-only parent delivery, completion activity for the initiating agent, and result tracing only after successful delivery.

GitOrigin-RevId: e06871d92c9ca8660de29f50356cf7c37f7e5199
2026-09-19 01:19:55 +00:00
jif c026e7a622 Expose a backend-independent agent control contract (#46547)
## What changed

Add a public, object-safe `AgentControl` trait and request/response types for coordinating an agent tree independently of where its threads run. Define contracts for lifecycle operations, message delivery, status observation, execution admission, usage accounting, shared configuration, and guardian evidence.

Move shared agent types out of the local controller and export them from `codex-core`. Let `AgentExecutionGuard` own a backend-provided reservation while preserving the local limiter's release-on-drop behavior. Include `root_thread_id` in `GuardianRootSnapshot` to identify the source of authorization evidence.

## Testing

Add tests for reservation release when a guard is dropped or a turn is cancelled, and extend the guardian authorization test to assert the root thread identity. Check trait object safety at compile time.

GitOrigin-RevId: 9385c9fbfd189f08429539fd89061ef8c9efe0d9
2026-09-19 01:03:55 +00:00
Henry Levy 7e0463b568 Skip skill discovery when injecting items into initialized threads (#46546)
## Why

Recording response items in an initialized thread builds a turn context without starting a turn. Running host skill discovery for that context is unnecessary.

## What changed

Use a dedicated context build mode that skips host skill discovery for history injection. Preserve full discovery for initial context creation, startup prewarming, and execution. If compaction clears the reference context during preparation, rebuild a full context before initializing history.

## Testing

Add a regression test verifying that initial injection discovers skills, subsequent injection records items without discovery, and a real turn still discovers skills and sends the selected skill body and both injected messages to the model.

GitOrigin-RevId: 4a64e04eb0f21698f9b47160bfcfe5b6d6a68554
2026-09-19 01:03:32 +00:00
Henry Levy 49e248d4c3 Add opt-in compaction after final responses (#46541)
## What changed

Add `model_post_turn_compact_threshold_percent` to trigger compaction after a final response when context usage reaches the configured percentage of the usable window or an existing auto-compaction limit. Accept values from `0` to `100`; omitted or zero disables the feature.

Skip post-turn compaction when input is pending, the turn is cancelled, or token-budget mode is enabled. Disable it for approval reviewers to avoid delaying approval completion, and record a distinct `PostTurn` analytics phase.

Buffer local post-turn summaries until compaction succeeds and require a nonempty assistant summary before replacing history. Log compaction failures without failing the completed turn, while still propagating interruptions and turn aborts.

GitOrigin-RevId: b616994175829bd83b5d7974f95dabb042a39a89
2026-09-19 00:52:56 +00:00
Adam Perry @ OpenAI d5b29951ac Centralize retry decisions and delays in CodexErr (#46540)
## What changed

Replace `is_retryable()` with `retry_delay(retry_count)`, which returns `None` for terminal errors and a delay for retryable errors. Prefer server advice when present; otherwise use exponential backoff with jitter. Keep `server_retry_delay()` for callers that need only the server-provided delay.

Route sampling and remote compaction errors through the shared response stream handler, which now checks retryability and obtains the delay together. Preserve server-only retry timing when the retry budget is exhausted.

## Testing

Add coverage for attempt-dependent backoff, zero-duration server advice, and terminal errors that remain non-retryable despite server advice. Update API mapping and provider tests to use the combined retry API.

GitOrigin-RevId: 903f92935e71dea043afe1fad8ccb9389471aa75
2026-09-19 00:46:30 +00:00
papayo-oai b244e9bafe Add a command-start callback for tool lifecycle extensions (#46539)
## What changed

Add `ToolLifecycleContributor::on_command_start` with `CommandStartInput` carrying the resolved command, working directory, selected executor's filesystem, and lifecycle context. Await contributors after command hooks and environment resolution so they can prepare the filesystem before `exec_command` runs, including calls from code mode.

Reserve process IDs only after preparation completes so cancelled preparation does not consume an ID. Keep deterministic process IDs from being reused after removal.

## Testing

Add tests for direct and code-mode calls that verify callbacks receive hook-rewritten commands and the executor's working directory, filesystem preparation completes before execution, and interrupted preparation prevents execution without consuming a process ID. Add a regression test for deterministic process ID reuse after removal.

GitOrigin-RevId: d10bcafcc583a6e3e8b5924d004806727e3763bb
2026-09-19 00:46:06 +00:00