Commit Graph
2665 Commits
Author SHA1 Message Date
sayan-oai c9bbed2dae Support environment updates in app-server settings APIs (#60655)
## What changed

Add experimental `environments` fields to `turn/settings/update` and `thread/settings/update`. Turn updates apply to later steps of the running turn; thread updates apply to future turns. Omission or `null` preserves the selection, while `[]` clears it. Providing `cwd` in a thread update without an environment list selects the defaults for that directory.

Include the ordered environment selection in `thread/settings/updated`. Wait for Core to accept thread settings updates before returning success, and return rejections as request errors.

## Testing

Add integration coverage for attaching, replacing, preserving, and clearing environments; rejected updates; and the distinction between later steps and future turns.

GitOrigin-RevId: bfebeda57c676be94427aeb0c567c0b94fd9c387
2026-11-10 20:35:28 +00:00
Keyan Zhang c37fd5665f Allow sampling in-progress turns with thread/sample (#60620)
## Why

`thread/sample` previously required the source's latest turn to finish before it could be sampled.

## What changed

Add `allowInProgressTurn`, defaulting to `false`, to sample a snapshot of the latest turn while the source continues running. The requested turn must still be the latest, but source history changes during sampling no longer invalidate the result when this option is enabled.

For an in-progress snapshot, include a context note explaining that the source was not stopped and pending tool calls may appear as `aborted` in the copy. Suppress the copy's default interruption message.

## Testing

Add coverage for sampling running turns in legacy and paginated history modes, including pending tool calls and mid-turn compaction. Verify that the source continues independently and that finished-turn samples retain their existing context.

GitOrigin-RevId: 771b979bf677e4ff0686476bfaf21aff92f7e7ac
2026-11-10 16:31:52 +00:00
Brent Traut 77fde36ae1 Allow searching persisted attached threads (#60574)
## Why

Title and content searches exclude attached threads, preventing clients from finding their saved conversations alongside ordinary threads.

## What changed

- Add `includeAttachedThreads` to `thread/list` and `thread/search`. For `thread/list`, require a non-empty `searchTerm` and preserve the usual provider and source filters.
- Expose `attachedToThreadId` on thread responses to identify the owning parent independently of fork and subagent lineage.
- Support inclusive searches through SQLite and filesystem fallback, repairing missing database entries with saved thread names during title searches.

## Testing

Add regression coverage for opt-in title and content searches, attached-parent metadata after restart, default search filters, filesystem searches without SQLite, and discovery and repair of unindexed title matches.

GitOrigin-RevId: ac12ec3c730ad7f1722bdf8e21600d17f12017f0
2026-11-10 11:17:06 +00:00
Eric Traut f988a5f0da Preserve inherited previews for paginated thread forks (#60559)
## Why

Reference-backed forks can lack a local opening user message, causing them to disappear from thread listings or lose their inherited preview when a new turn is written. Compaction can also remove the opening message from the model context used to prepare a fork.

## What changed

- Persist inherited previews and preserve them when recording new turns and merging thread-list metadata.
- Include reference-backed forks with inherited history in thread listings before their first local message.
- Recover opening previews from transcript history within the requested fork boundary when compaction omits them from model context.
- Use the shared `user_message_preview` helper when deriving previews from rollout items.

## Testing

Extend thread-fork integration tests to check previews in listings before and after a new turn, after reopening, and when forking at a boundary after compaction.

GitOrigin-RevId: 5962cf71ea7104f07c9013cc77259b105e4c60d7
2026-11-10 08:52:02 +00:00
Charlie Marsh c875667eb8 Reuse installed Git objects when upgrading marketplaces (#60528)
## What changed

Use eligible installed marketplaces as Git clone references to avoid fetching objects already available locally. Limit fetch negotiation to the recorded installation commit so local branch revisions are not advertised, and use `--dissociate` to keep the upgraded checkout self-contained.

Enable reuse only with Git 2.20 or newer and a recognized release version. Fall back to a fresh clone if reference cloning fails, and retain existing ref and sparse-checkout behavior.

## Testing

Add coverage for installation-commit negotiation, exclusion of local branch revisions, self-contained object stores, fallback with older or unknown Git versions and shallow references, and Git release parsing.

GitOrigin-RevId: 8d0f6a4bed7e7e2a3136e3912ba2f92150be9354
2026-11-10 05:20:44 +00:00
dpatel-oai 86a5522ded Preserve first-party catalog display order in app-server model lists (#60525)
## What changed

Return first-party provider models in catalog order while retaining priority-based default selection and existing filtering. Apply this ordering only to provider-origin catalogs for the OpenAI provider using Codex backend routes or `model_catalog_url`. Bundled, configured, and third-party catalogs retain priority ordering.

## Testing

Add coverage showing that catalog display order can differ from priority order while the recommended model remains the default. Update custom-provider coverage to verify priority ordering with a reversed catalog response.

GitOrigin-RevId: 9c2361e070ba424c092a282ca7f1cf9952d270b3
2026-11-10 05:08:19 +00:00
ioanbudea-OAI ab541fb990 Encapsulate thread metadata construction (#60524)
## What changed

Move `ThreadMetadataBuilder` into its own module, make its fields private, and replace direct field assignments with fluent `with_*` methods. Initialize `updated_at` and `recency_at` from the creation time and default the approval mode to `OnRequest`.

Update `apply_rollout_items` to accept a boxed `ThreadMetadata` seed, keeping callers' async frames small while preserving existing database fields except for the seed rollout path. Add `build_thread_metadata` to use the state runtime's configured provider, and use `thread_id_from_rollout_path` directly for the doctor's filename fallback.

GitOrigin-RevId: a27e4c6b22832e902922dbdd60d7f5c11b4a1a83
2026-11-10 04:56:49 +00:00
Eric Traut 39b42aaacd Handle unfinished tool calls in restored history (#60519)
## Why

Forked and recovered sessions can restore a tool call before its output has been recorded. Missing outputs for these calls should be treated as interrupted work rather than an error.

## What changed

Track the restored history's sequence cutoff so custom tool and local shell calls in that history can receive synthetic `aborted` outputs without reporting a missing-output error. Keep the existing checks for newly recorded calls and clamp the cutoff when history is replaced.

## Testing

Extend the active-turn fork test with a pending `apply_patch` call and verify that the fork's model input includes its `aborted` output.

GitOrigin-RevId: d989fa0991db72f0f8fa8a6d5de403fb307c40c7
2026-11-10 04:11:29 +00:00
ccui-oai 0811df3976 Treat inference hook denials as terminal errors (#60511)
## Why

An explicit denial from a workspace inference hook should stop the request, including retries and compaction model fallback.

## What changed

Recognize `inference_hook_denied` provider errors and preserve the provider's message, with a fallback when none is supplied. Expose the distinct `inferenceHookDenied` error through the app-server protocol and generated schemas and SDK types. Treat the denial as non-retryable during turns, compaction, and guardian review.

## Testing

Add coverage for terminal denials over HTTP, SSE, and WebSocket, error serialization and persistence in `thread/read`, and compaction failures that preserve token usage and history without retrying or falling back to another model.

GitOrigin-RevId: 2ebd480f01e52f4e6bd3db8a0f92d5814d18ccb1
2026-11-10 03:21:26 +00:00
Joe Savona 3cd64c8d7c Preserve MCP trace context when tracing is disabled (#60506)
## Why

MCP requests need to retain inbound W3C trace context even when no OpenTelemetry tracing layer is installed.

## What changed

- Carry validated request trace context through app-server MCP tasks, connection startup, and resource listing tasks, while preferring active span context.
- Forward fallback `traceparent` and `tracestate` headers for MCP HTTP requests, including discovery and initialization.
- Use HTTP trace headers as a fallback for exec-server RPC calls when active span context is unavailable.

## Testing

Add an app-server integration test that disables trace exporting and verifies that `mcpServer/resource/read` forwards the inbound `traceparent` and `tracestate` to the MCP server.

GitOrigin-RevId: c886a55ce0a3992f1b2e04614efec80a20cb4b49
2026-11-10 03:01:14 +00:00
Charlie Marsh aa39ded153 Trace MCP refresh causes and plugin metadata changes (#60505)
## What changed

- Track and log `McpRefreshReason` values for runtime refreshes, including invalidations received during thread startup and forced refreshes. Restore claimed reasons when a refresh is cancelled before publication, while preserving concurrent invalidations.
- Correlate installed-plugin metadata invalidations with downstream MCP refreshes using a shared change ID. Log changed field names by plugin ID, additions, removals, and reordering without logging field values.
- Record whether background installed-plugin bundle updates were requested by startup, plugin listing, or installation.

## Testing

Add coverage for metadata change attribution across membership changes and reordering, and for retaining refresh causes across cancellation and concurrent invalidation.

GitOrigin-RevId: 3d4485ccfcc1d8788eb9909a060ac200c467af13
2026-11-10 02:45:30 +00:00
jameswt-oai 6aa88f9946 Remove the Xcode 26.4 MCP elicitation compatibility workaround (#60488)
## What changed

Route MCP elicitations through the standard handling paths for Xcode 26.4 clients. Remove the client-specific auto-deny flag and the synthetic acceptance of session elicitation requests without dispatching them to the client.

Simplify `request_mcp_server_elicitation` to return the optional response directly, and remove telemetry guards that depended on whether the workaround bypassed dispatch.

GitOrigin-RevId: ab540dcd67f8fa6d16c69bc7629f436e4b5aa73a
2026-11-10 01:30:43 +00:00
Alex Kira 08ae615122 Enable untrusted context tool outputs by default (#60487)
## What changed

Mark `untrusted_as_tool_output` as stable and enable it by default. Untrusted additional context, such as browser information and goal objectives, now reaches the model as `function_call_output` items in the `agent` namespace instead of user messages. Setting `features.untrusted_as_tool_output = false` preserves the message format.

## Testing

Update core, app-server, TUI, and Python SDK test expectations for the default output format. Cover context persistence, deduplication, goal continuation, and explicit opt-out behavior.

GitOrigin-RevId: 30828351e2ed584928f6055b6dcf276d8288c0fb
2026-11-10 01:30:08 +00:00
smurching-oai d8c42ecf8f Add device authorization to app-server gateway OAuth (#60486)
## What changed

- Advertise `supportsDeviceAuth` in `account/gatewayOAuth/read` and accept `deviceAuth: true` in `account/gatewayOAuth/login`.
- Return a device prompt with `verificationUrl`, `userCode`, and `loginId` before approval, then notify the initiating connection of success or failure with the matching `loginId`.
- Reuse or refresh saved credentials when possible, returning `prompt: null` without another device authorization. Update protocol schemas, generated bindings, and documentation.

## Testing

Add an integration test covering the device prompt, correlated completion notification, capability reporting, and token refresh without another device grant.

GitOrigin-RevId: 6ecc38c9baadcfda3272654ed71e4aaa431421bf
2026-11-10 01:28:45 +00:00
Dmitriy Kovalenko caae161dd0 Keep thread storage available when diagnostic logs fail (#60466)
## Why

Failure to open the diagnostic logs database should not disable thread storage or database-only history listing. Thread deletion must still preserve saved conversations when diagnostic log cleanup cannot complete.

## What changed

- Allow state initialization to continue after non-corruption errors opening the logs database, while preserving corruption recovery.
- Report the original diagnostic database error after tracing is installed in the TUI and app server, and return it from log operations.
- Reject thread deletion before destructive cleanup when diagnostic storage failed to initialize.
- Continue periodic cleanup of legacy logs when the current logs database is unavailable.

## Testing

Extend coverage for unavailable log directories, database-only history listing, startup diagnostics, deletion preserving saved conversations, corrupt log headers, and periodic legacy log cleanup during a diagnostic storage outage.

GitOrigin-RevId: a5184580ae6c39ed0c4eefa8cb48ee7731a991c3
2026-11-09 23:22:08 +00:00
cooper-oai ac37f98c73 Reset app-server turn summaries when a turn starts (#60434)
## Why

An error recorded before a turn starts can cause a successful turn to be reported as failed.

## What changed

Reset `TurnSummary` on `TurnStarted`, preserving the new turn's `started_at` timestamp while clearing accumulated errors, command start times, and the last agent message.

## Testing

Extend turn completion tests to cover clearing an error recorded before turn start and retaining an error recorded during the turn.

GitOrigin-RevId: 19989b55d20df7b9a265bd0a1dfb3f00b6e8a9c5
2026-11-09 19:28:34 +00:00
smurching-oai 6222faa3c4 Enable model catalog discovery with gateway OAuth (#60414)
## Why

Custom providers with gateway OAuth and an explicit model catalog should be able to discover models without an API key or API key model discovery enabled.

## What changed

- Enable catalog refreshes for custom gateway providers when `model_catalog_url` and `base_url` have the same origin.
- Reuse gateway credentials without starting an interactive login during catalog refreshes.
- Keep an unrelated saved API key from making gateway catalog discovery depend on the API key discovery setting.

## Testing

Add an app-server test for discovering a gateway catalog after OAuth login with no API key. Update coverage for catalog invalidation after gateway credentials require login, including across manager restarts, with API key discovery disabled.

GitOrigin-RevId: b133c428cb45a9037e4b2ef13ff2f9473ed96636
2026-11-09 16:37:22 +00:00
Brent Traut d2b4d63e95 Allow deferring plain-text MCP output in thread item listings (#60390)
## What changed

Add experimental `deferOutput.mcpToolCall` support to `thread/items/list` requests scoped to a `turnId`. Successful, completed MCP calls with nonempty, unannotated plain-text results can return empty `result.content` with `outputDeferred: true`. Clients can retrieve the saved output through `thread/items/read`; connector identity remains on the listed item.

Keep rich results, JSON or fenced text, app UI results, and built-in `codex_app` results inline. Preserve plain-text output when creating bounded previews of oversized MCP results so those previews remain eligible for deferral. Reads return the saved preview when output exceeds the 64 KiB history limit.

## Testing

Extend thread history integration coverage for independent and combined command/MCP deferral, experimental capability gating, excluded result types, connector identity, oversized previews, and retrieval of deferred items.

GitOrigin-RevId: 5c160b30a4eac2a9b70e3fa65b6dbd83e935338b
2026-11-09 12:54:12 +00:00
Dylan Hurd 8703d32bd0 Treat goal objectives as untrusted context (#60342)
## What changed

- Pass goal objectives as untrusted `goal_objective` context instead of embedding them in continuation instructions. Direct the model to use `get_goal` if the objective is missing or truncated.
- Inject newly created objectives into their originating active turn without dropping unrelated client context. Render them as tool outputs when `UntrustedAsToolOutput` is enabled.
- Queue additional context together with automatic turn input so both reach the first model request.

## Testing

Extend app-server coverage to verify that model-written objectives appear as tool outputs at creation and continuation, without duplicating them in user messages. Update steering and Python SDK tests to check objective preservation and delivery alongside continuation instructions.

GitOrigin-RevId: 6f44f6d6c895bb4dc378c9cf84d6470ccc885c67
2026-11-09 03:58:05 +00:00
alexsong-oai d960b36694 Allow creating custom providers during sign-in (#60186)
## Why

Custom-provider sign-in previously required a saved gateway configuration and stopped at an error when none existed.

## What changed

- Add “Create a custom provider or gateway” to the sign-in picker, reusing the settings form and provider-write handling.
- Return to the picker after saving, highlight the new provider, and require explicit selection before setting it as the default and completing sign-in.
- Preserve entered fields after validation failures and keep the focused field or Save action visible in short terminals.
- Use consistent custom-provider and gateway wording across sign-in, settings, and validation messages.

## Testing

Add onboarding tests and snapshots for an empty picker, creation, validation retries, short-terminal rendering, and explicit default selection. Extend app-server coverage for rejecting the reserved `ollama-chat` provider ID.

GitOrigin-RevId: 339ac5807c5eecdae08df4dbd89874ea7c764d35
2026-11-07 23:51:58 +00:00
cooper-oai efdacaf46f Stop retrying terminal runtime authentication denials (#60096)
## Why

Invalid assertions and paused or revoked runtime instances cannot recover through request retries or credential refresh. Permanent refresh-token failures also need to retain their sign-in error instead of becoming retryable stream errors.

## What changed

- Recognize terminal runtime denial codes in `401` and `403` response bodies and identity error headers, preserving HTTP diagnostics while stopping retries.
- Skip credential recovery for runtime denials in runtime-enabled model providers and backend requests, while preserving recovery for ordinary credential expiration.
- Propagate permanent refresh-token failures through runtime authentication as `RefreshTokenFailed` errors.

## Testing

Add coverage for body and header denials, preserved HTTP diagnostics, provider-scoped credential recovery, and cached permanent refresh failures. Complete-turn tests verify that runtime denials stop without retries or refreshes while expired credentials recover in both runtime authentication modes.

GitOrigin-RevId: 33f6f707454130e97e13f3b53e29d2c484602152
2026-11-07 09:48:46 +00:00
cooper-oai 4be90eb069 Fetch account security reminders through app-server (#60082)
## Why

Security reminder requests need to use app-server's active authentication and HTTP runtime, with results bound to the login that fetched them.

## What changed

- Add `account/securitySetup/read`, returning an optional notice with account and user IDs, plus generated protocol schemas and bindings.
- Fetch reminders in app-server only for a matching saved ChatGPT login. Return `notice: null` for ineligible, unavailable, or timed-out reads, and discard results when the login changes during the request.
- Route TUI reminder reads through the new method while retaining notice validation and identity checks. Unsupported servers produce no reminder.

## Testing

Add coverage for shared runtime use across restarts, ineligible authentication modes, and login changes during a fetch. Update TUI coverage for unavailable, unsupported, and mismatched notices.

GitOrigin-RevId: 426fee7ce98df17970957c06876881bc5b005196
2026-11-07 08:11:37 +00:00
cooper-oai f4275a2a2e Use runtime authentication for remote-control requests (#60073)
## Why

Remote-control enrollment, refresh, and client-management requests used ChatGPT bearer authentication without resolving the configured runtime authentication mode.

## What changed

Pass the app server's runtime auth slot and mode into remote control, and resolve authentication and HTTP client policy for each request. Supported OpenAI destinations use fresh runtime assertions in `dual_header` or `assertion_only` mode, while custom destinations retain bearer authentication.

Wait for runtime authentication to initialize and reject unsupported OpenAI origins or mismatched registered accounts. Pairing continues to use its server token.

## Testing

Add transport and app-server integration coverage for both runtime auth modes, fresh assertions, shared runtime registration, network policy enforcement, account validation, redirect credential handling, and pairing token preservation.

GitOrigin-RevId: 5401cf565630ab84eaba71ff6040ac27f7b92461
2026-11-07 06:32:12 +00:00
cooper-oai 1c414e0d65 Use thread runtime auth for Guardian Decisions and memory quota checks (#60064)
## Why

Guardian Decisions requests used bearer keys directly, bypassing runtime authentication. Memory startup quota checks used the app-level auth manager instead of the thread's provider auth context.

## What changed

- Bind Decisions credentials to runtime authentication and use route-aware HTTP clients with sensitive header protection. Preserve workload identity credentials, reuse the saved-login runtime binding, and isolate explicit API key bindings.
- Select the staging Decisions endpoint when the ChatGPT environment is staging.
- Use the thread's `ProviderAuthContext` for memory startup and quota checks, preserving account-bound network policy and applying runtime authentication.
- Keep custom destinations independent of runtime assertions.

## Testing

Add regression tests for dual-header and assertion-only authentication, fresh Decisions assertions, saved versus explicit credential isolation, workload identity, staging routing, redirect header protection, and memory quota authentication with custom destinations.

GitOrigin-RevId: 27bc7821a1cad1f5d1d2a71680527ea91ace95db
2026-11-07 05:50:00 +00:00
Charlie Marsh af9a98b074 Add opt-in lazy startup for cached stdio MCP servers (#60039)
## Why

Regular chats start MCP servers eagerly even when cached tool definitions are available and the servers go unused. Allow those chats to use the cached catalog and defer eligible stdio servers until first use.

## What changed

- Add the disabled-by-default `mcp_lazy_stdio_startup` feature and expose it through experimental feature configuration.
- Defer cached stdio servers in regular chats when enabled, while keeping servers that require a live startup connection eager. Required servers with `startup_readiness = "catalog"` may defer; explicit reconnects remain eager.
- Announce the full eager startup batch before terminal statuses and exclude dormant servers from the initial startup summary. Update TUI tracking so deferred servers can report startup independently in later rounds.

## Testing

Add scenario coverage for a cached server staying dormant during unrelated work, starting on first use, and refreshing tool definitions and visibility. Cover required live startup, eager event ordering, experimental feature configuration, and TUI status handling.

GitOrigin-RevId: 74075fcd4f26c8c79b5901b6a8cb03fdb9e35a7f
2026-11-07 02:28:44 +00:00
Charlie Marsh fb2b06a829 Surface MCP server startup errors when preparing cached tool calls (#60038)
## Why

A cached MCP tool can remain advertised after its server fails to start. Calling it previously returned a generic unavailable-tool error, hiding the startup failure from the model.

## What changed

Propagate preparation errors through MCP tool calls and recorded approval preparation, preserving the error chain and adding the server name to startup failures. Keep the unavailable-tool error for tools that are missing, filtered, or no longer visible to the model.

## Testing

Update the executor capability downgrade test to require the credential resolution startup error in the model's tool output and assert that the host token is absent.

GitOrigin-RevId: 434074eb748165b2fe19de3a40046835f26992df
2026-11-07 02:28:22 +00:00
cooper-oai 0c58612c3c Fix authentication for git-attribution settings requests (#60035)
## Why

Git-attribution settings requests need to honor runtime authentication for their destination. Repeated authorization failures after a credential refresh must also let world-state contribution finish.

## What changed

- Use the thread's `ProviderAuthContext` credentials and runtime authentication when available.
- Bind the settings client's network policy to the authenticated account and select authentication through the runtime-aware backend client.
- Stop policy resolution after an unsuccessful settings lookup or timeout instead of restarting it when credentials changed during recovery.

## Testing

Add app-server coverage for `dual_header` and `assertion_only` authentication with default and custom destinations, including attribution instructions in model input. Add a regression test verifying that repeated `401` responses trigger only one credential refresh and omit attribution instructions.

GitOrigin-RevId: 4824bde7d9ec11c241f1caebc754d203dbb0480c
2026-11-07 02:09:31 +00:00
felixxia-oai 2f742f5885 Disable bundled skills in the prompt-prefix comparison test (#60017)
GitOrigin-RevId: d2a606620debc2ed043215b79f672d0d85acf2f1
2026-11-07 00:54:03 +00:00
cooper-oai 10cf2b9ea2 Honor managed runtime authentication modes and expand coverage (#60014)
## What changed

Allow `requirements.toml` to pin `features.runtime_agent_instances.mode` to `dual_header` or `assertion_only`. Apply the required mode when no explicit mode is configured and reject conflicting explicit settings, while preserving legacy boolean requirements.

Document experimental runtime authentication configuration, credential lifecycle, and bootstrap authentication behavior.

## Testing

Add coverage for managed mode defaults and conflicts, runtime reuse and rotation across account requests and restarts, fresh assertions on Realtime and MCP reconnects, and Realtime destination and environment restrictions.

GitOrigin-RevId: bcf9502178f477c1e8232386f1f3e360bf23d667
2026-11-07 00:18:36 +00:00
dand-oai 01ab354312 Expose ChatGPT user IDs in account/read responses (#60004)
## What changed

Add a nullable `userId` to `GetAccountResponse`, populated from the same authenticated account snapshot as the rest of the response. ChatGPT and personal access token sessions return the canonical ChatGPT user ID when available; API-only and signed-out sessions return `null`.

Update the cloud client, generated schemas, TypeScript and Python types, and account identity documentation. Default missing IDs to `None` when deserializing responses from older app servers.

## Testing

Extend account response tests to check ChatGPT and personal access token user IDs, null IDs for other providers and signed-out sessions, and ID changes when switching providers with saved ChatGPT credentials.

GitOrigin-RevId: 7ad3da3cfc835c4d08d03c8e91b06cd7e007d874
2026-11-06 22:27:47 +00:00
cooper-oai 44f1b0e867 Apply runtime authentication to realtime connections (#60003)
## Why

Realtime connections bypassed runtime authentication and reused captured authentication headers for sideband handshakes. They need to honor the selected credential source and its transport policy across call creation, retries, and reconnects.

## What changed

- Use runtime authentication for realtime WebSocket connections, WebRTC call creation, and sideband attachment when enabled for supported OpenAI destinations.
- Resolve authentication on every WebSocket handshake, preserving credential ownership and request scope while generating fresh assertions. Reject authentication failures without falling back to bearer authentication.
- Keep call creation and sideband attachment bound to the selected credentials and account network policy, including when inference uses a different provider.
- Avoid runtime initialization for local marketplace and MCP operations, plugin commands that do not use the remote catalog, and model debugging with a configured catalog.

## Testing

Add coverage for fresh handshake credentials on retries and reconnects, credential and account changes, runtime authentication modes, destination validation, and registration failures.

GitOrigin-RevId: 57e53122912fa78a524427b0f51013f76f9f7681
2026-11-06 22:27:23 +00:00
ioanbudea-OAI 2889d8e1bf Normalize turn context permissions to a required profile (#59963)
## What changed

Make `TurnContextItem.permission_profile` required and remove its legacy `sandbox_policy` and `file_system_sandbox_policy` fields. Normalize older histories into a permission profile during deserialization, preserving the restrictive fallback for malformed filesystem rules.

Keep legacy compatibility fields in rollout serialization so older readers remain usable. Update turn recording, metadata extraction, and permission checks to consume the profile directly.

## Testing

Add coverage for legacy normalization, profile-only serialization, missing permissions, and malformed filesystem rules. Extend rollout round-trip fixtures to cover deny rules and filesystem roots from another platform.

GitOrigin-RevId: 27515fec60cccbac5806b98fb71f54e311a09701
2026-11-06 19:29:06 +00:00
provencher-oai 4980f9585a Narrow openai-docs to product Q&A and first-time API setup (#59944)
## What changed

Refocus `openai-docs` on Codex and ChatGPT Work behavior and first-time API integrations. Skip API questions about existing integrations, action requests, and tasks fully answered by supplied text or data. Retain model migration guidance when users explicitly invoke `$openai-docs`.

Replace the broad routing workflow with guidance to check available tools and settings, consult documentation for the relevant product surface, and verify recent changes through the changelog and linked client changes or tests.

Update the skill's display metadata and affected skill catalog snapshots to match.

GitOrigin-RevId: 0a0e9abbee9975ebd30917b7477f475096f2c86b
2026-11-06 17:09:54 +00:00
jif ad1dbba32d Scope file change approval cancellation to the requesting turn (#59910)
## Why

A delayed file change approval cancellation could interrupt a later turn, even when the original approval was no longer pending.

## What changed

Send `Op::CancelPatchApproval` with the approval ID and requesting turn ID from the app server. Resolve cancellations only for a matching pending approval and interrupt its requesting turn only if it is still active. Route legacy `Op::PatchApproval` abort decisions through the same pending-approval handling.

## Testing

Add a regression test that cancels an approval, then replays that cancellation while a second turn has a pending approval with the same call ID. Verify that the second approval succeeds and its turn remains active.

GitOrigin-RevId: 4c833ccd0f33c2df4e9dfb25e2729ab19b6c879f
2026-11-06 13:21:43 +00:00
jif f49ae52079 Recompute the approval reviewer when switching models (#59893)
## Why

Switching away from a model that requires automatic review should restore the user's requested approval reviewer instead of retaining the model's enforced reviewer.

## What changed

Recompute the reviewer from the requested preference and model requirements when the model changes without an explicit reviewer update, unless the session uses a trusted guardian reviewer. Preserve an explicit automatic-review preference across subsequent model switches.

## Testing

Extend the app-server settings regression test to cover restoring user review after leaving a protected model and retaining an explicit automatic-review choice across repeated model switches.

GitOrigin-RevId: a5672d1ebe94c2fac201ad460b4789d11df03b1a
2026-11-06 12:04:44 +00:00
psachdeva-oai ddd1812a51 Carry targeted moderation decisions on final-answer messages (#59842)
## What changed

Read `final_answer_moderation` metadata and attach `moderation: { moderated: boolean }` to the completed final-answer message only when its item ID matches. Apply this in both normal and plan modes, and reset the pending decision when a new response starts.

Preserve the answer's native item ID and moderation flag through legacy events and history reconstruction. Combine text parts into one legacy event when a moderation decision is present.

Expose nullable moderation data on app-server agent messages and update the JSON schemas, TypeScript types, and Python models.

## Testing

Add an integration test for moderation on completed answers and their legacy events. Extend protocol conversion tests to cover populated moderation data and serialization as `null` when absent.

GitOrigin-RevId: f286b67731a84b3daf5d10b7644f2e31b62f0e53
2026-11-06 07:43:44 +00:00
Eddie Chen a037e65ead Preserve client metadata through queued submissions (#59826)
## Why

Queued inputs previously stored and dispatched without the submitting client's Responses API metadata, losing attribution such as `client_type` when the queued turn started.

## What changed

- Accept `responsesapiClientMetadata` when adding or updating queued submissions and expose it on returned queue items.
- Persist metadata with the input and forward it when starting a selected item or dispatching an idle queue, including after restoration.
- Preserve existing metadata when an update omits it or supplies an empty map; replace it when a non-empty map is supplied.
- Keep stored inputs readable by older queue workers and update generated protocol artifacts.

## Testing

Extend queue service and app-server tests to cover metadata round trips, preservation and replacement on edits, compatibility with older readers, and forwarding during selected, idle, and restored dispatch.

GitOrigin-RevId: 508043b1d3d0298c9af2be8e05b6999de46596a1
2026-11-06 05:10:44 +00:00
cooper-oai faeb379646 Bind runtime auth to the provider's selected credential source (#59823)
## Why

Runtime authentication must use the credential selected by the model provider. Explicit API keys and command credentials need independent ownership so cached connections and in-flight work cannot cross credential sources.

## What changed

- Register and reuse runtimes per credential source, supporting explicit provider keys and command credentials without falling back to saved login credentials.
- Track `AuthOwner` by credential manager and owner generation across WebSocket state, compaction, and scoring.
- Preserve cached identity and runtime registration state during credential-source outages or failed storage reloads. Require a successful auth reload before logout revokes credentials.
- Reject requests whose production or staging environment differs from runtime registration, including model catalog requests.

## Testing

Add regression coverage for credential selection and runtime reuse, owner isolation, source outages, failed reloads and logout recovery, and environment mismatches.

GitOrigin-RevId: 7bab55e0ea502593393df10046309fd8502edbd0
2026-11-06 04:33:14 +00:00
Abhinav aece559654 Allow provider selection for gateway OAuth reads and logins (#59819)
## Why

Gateway OAuth reads and logins previously used only the current provider, preventing clients from authorizing another configured provider without changing the default.

## What changed

- Add optional `modelProvider` params to `account/gatewayOAuth/read` and `account/gatewayOAuth/login`, preserving current-provider behavior for omitted or null params and selectors.
- Validate explicit providers against current managed policy without changing the default or any thread's provider.
- Retain readiness state across providers and send `account/gatewayOAuth/changed` notifications for every configured provider sharing the changed credential.
- Update protocol schemas, TypeScript types, Python models, and documentation.

## Testing

Add coverage for non-default provider login, retained readiness when alternating providers, notifications for shared credentials without starting login, and legacy TypeScript request compatibility.

GitOrigin-RevId: cfd472c322b821fe36b8c133a8de774f4ba48534
2026-11-06 04:02:11 +00:00
alexsong-oai 6eb51a438a Retry gateway credential exports after unauthorized responses (#59816)
## Why

Cached gateway command credentials need to be refreshed when the gateway rejects them with a `401`.

## What changed

Clear the cached `credential_export` token after an inference HTTP `401` or a WebSocket upgrade rejected with `401`, then rerun the command for one retry. Preserve subsequent primary authentication recovery if the retry is also unauthorized, and document the behavior.

## Testing

Add integration coverage for using a new exported token, reporting an invalid export, recovering primary authentication after the gateway retry, and stopping after a second unauthorized WebSocket upgrade.

GitOrigin-RevId: 3397476dbfd3bec1bd44f90657c4f9e17bb7df67
2026-11-06 03:51:12 +00:00
Owen Lin 2f02d8461d Support update-boundary paging across forked thread histories (#59793)
## Why

Item reads with an update boundary previously rejected forked thread histories and only supported an exclusive lower bound on update ordinals.

## What changed

- Add `before_updated_at_ordinal` as an exclusive upper bound, mutually exclusive with `after_updated_at_ordinal`.
- Allow update-filtered and update-ordered item reads across parent and child segments, applying segment bounds and preserving cursor pagination in both directions.
- Require an update boundary for update-order sorting and reject either boundary when using an item anchor or item-ID filtering.

## Testing

Extend thread-store tests to cover upper-bound filtering, descending cursor pagination, forward and backward paging across forked lineages, mutually exclusive boundaries, and ordinals outside SQLite's integer range.

GitOrigin-RevId: 63f7e18fb24a89a41ff8e570cf65963622519a25
2026-11-06 02:21:38 +00:00
alexsong-oai b1263c593d Support credential export commands for gateway authentication (#59787)
## What changed

Allow `model_providers.<id>.gateway_oauth.credential_export` to supply a gateway access token instead of browser OAuth. Run the configured command on first use, cache its token in memory, and deliver it through the configured header or cookie. Export failures surface directly, and command-backed providers do not require an OAuth session.

Require mutually exclusive OAuth and exporter settings, same-origin model catalog access, and rejection of HTTP redirects for command-backed gateway credentials. Share the bounded, timeout-controlled command runner with AWS credential export.

## Testing

Add tests for inference and model listing without OAuth, token caching and recovery after invalid output, preservation of primary authentication, and rejection of mixed OAuth/exporter configuration.

GitOrigin-RevId: e3dbfd8823b1992045f1c1efd56ec98ee17e07a5
2026-11-06 02:00:39 +00:00
Abhinav daa69c411c Allow selecting a configured provider in model/list (#59776)
## Why

Clients need to list models for a configured provider other than the app-server's startup default.

## What changed

Add an optional `modelProvider` parameter to `model/list` and expose it in the generated schemas and client types. Explicit selections use provider definitions loaded at startup and respect current managed provider requirements. Unknown providers return a structured `modelProviderNotConfigured` error.

Use a temporary catalog when selecting another provider, preserving the default catalog and its disk cache while retaining runtime authentication. Requests without a selector keep the existing provider and caching behavior.

## Testing

Add coverage for provider selection, preservation of the default catalog and disk cache, unknown-provider errors, managed requirement enforcement, and runtime authentication for temporary catalogs.

GitOrigin-RevId: 6092df9f6141810c6ac215a8e1fb601f77e54747
2026-11-06 01:10:49 +00:00
Alex Zamoshchin 08e4f43c9a Stop prefetching plugin discovery at app-server startup (#59768)
## What changed

- Remove startup prefetching of remote catalogs, featured plugins, and recommendations while retaining installed-plugin refreshes and bundle downloads.
- Fetch featured plugin IDs on demand, concurrently with marketplace fetching when listing the remote global catalog, and reuse the cached results.
- Retire `plugin_discovery_prefetch` as an ignored compatibility flag and remove forced background catalog refreshes.

## Testing

Update app-server tests to verify that startup downloads installed bundles without discovery requests and that two `plugin/list` calls share one featured-plugin fetch.

GitOrigin-RevId: aa10474f3429102d624c83472e81ec85e3b470ae
2026-11-06 00:23:38 +00:00
cooper-oai 219ab4043e Use runtime authentication for OpenAI MCP and app requests (#59749)
## What changed

- Select fresh authentication for each HTTP operation on eligible OpenAI MCP connections while preserving the connection's credential source and account network policy. Stop redirects when requests carry runtime assertions.
- Pass the owning thread's authentication and runtime context through app discovery, connector metadata, and trusted-access requests. Include the runtime authentication mode in MCP connection and tool-cache identities.
- Give resumed actors analytics clients bound to their own authentication context, and serialize stored-credential reloads with token refresh while preserving host-provided credentials.

## Testing

Add coverage for fresh request assertions, revoked account policies, redirect handling, resumed-actor isolation, and MCP uploads in dual-header and assertion-only modes.

GitOrigin-RevId: f06900a6db61cd6cf53c3aa8075afeec4d5706d9
2026-11-05 22:03:29 +00:00
Omer Strulovich 0327a3ec34 Prioritize filename matches in fuzzy file search (#59709)
## Why

Matches in parent directory names can crowd matching filenames out of limited search results. For example, searching for `ViewModel` should keep `ChatViewModel.kt` visible even when many directories are named `viewmodel`.

## What changed

- Rank basename matches before applying the result limit for single positive fuzzy queries without path separators.
- Prefer exact filenames, then the strongest exact directory match, then other matching filenames. Leave additional directory matches ranked by their paths.
- Compute highlight indices from the basename for promoted results and return scores that reflect the new ranking.
- Rank snapshots in resumable time slices so new queries and cancellation can interrupt the work.

## Testing

Add regression coverage for filename matches surviving the result limit, exact file and directory priority, path queries, and resuming partial rankings. Update app-server score expectations while preserving highlight indices.

GitOrigin-RevId: 41b3420581b4f6490859e809245370b737889544
2026-11-05 17:34:20 +00:00
ioanbudea-OAI 86ac091659 Preserve turn configuration in Guardian scoring and approvals (#59642)
## Why

Guardian scoring and cached approvals need to use the requesting turn's captured policy even when the live thread configuration changes. Newly tightened mandatory review requirements must still prevent cached approvals.

## What changed

- Pass captured turn configuration through tool lifecycle and approval review inputs, and use it to resolve Guardian policy and classifier instructions.
- Apply current reviewer and model requirements before scoring and cached approval, including rechecking restrictions after collecting score authorization.
- Count computer-use JavaScript execution attempts even when background scoring is disabled, so a synchronous call consumes the initial-call allowance.
- Retain runtime configuration snapshots when applying agent role overrides, and share Guardian policy text resolution between configuration loading and runtime publication.

## Testing

Add and extend regression coverage for captured policy instructions, reviewer restrictions, stale cached evidence, and a synchronous computer-use call followed by an adaptive turn.

GitOrigin-RevId: 24ed4a1b6ce1733ad775790f30e440da614f9cd6
2026-11-05 11:41:09 +00:00
Brent Traut e7f32cf192 Add experimental command output deferral to thread item listings (#59601)
## What changed

Allow experimental clients to request `deferOutput: {"commandExecution": true}` in `thread/items/list` for a specific `turnId`. Completed commands with a recorded completion time, exit code zero, and nonempty saved output return `outputDeferred: true` and `item.aggregatedOutput: null`. Clients can retrieve the complete output through `thread/items/read` using the turn and item IDs.

Keep full output by default and for listings across turns. Make conversion from `ThreadItemEntry` to `ThreadItem` fallible so Rust consumers detect deferred output instead of treating an incomplete item as complete.

## Testing

Add integration coverage for experimental capability gating, default and disabled options, command status and output eligibility, listings across turns, deferred-item conversion, and full output retrieval by item ID.

GitOrigin-RevId: d6bfac34bb68f7e3b327fd5553270ed6d0fe87cf
2026-11-05 08:10:44 +00:00
cooper-oai 388aee4b26 Use runtime authentication across backend request paths (#59572)
## What changed

- Share the harness runtime identity with analytics delivery and turn-cost queries, and resolve request authentication together with its account-bound transport policy.
- Add runtime authentication to ChatGPT request helpers and `codex cloud`, including environment discovery. Resolve environment credentials for each request and honor CLI configuration overrides when loading cloud authentication.
- Preserve custom-backend authentication, validate runtime destinations, and keep cloud requests from following redirects.
- Forward only organization and project selectors from model-provider headers to API-key analytics requests.

## Testing

Add regression coverage for runtime request signing, credential refresh, account and resource selection, redirect credential handling, custom destinations, and cloud credential-store overrides.

GitOrigin-RevId: 75f33961ee6482881e9ff9817e99d977f31b65b8
2026-11-05 05:09:32 +00:00
aagrawal-oai 529d965d80 Add ChatGPT token stdin authentication to exec-server (#59569)
## What changed

- Add `--chatgpt-token-stdin` for remote HTTPS registration and optional `--chatgpt-account-id`, which must match the token's account claim when present. Read a bounded, newline-terminated token from a pipe without persisting it to `auth.json`.
- Load managed configuration using the supplied account, enforce account restrictions, and preserve configured policy-server authentication. Skip ChatGPT policy lookup only for known plans that do not require managed configuration.
- Allow `--exit-on-stdin-close` to cancel pending policy loading, and redact the registration bearer from registry diagnostics.
- Reject incompatible stdin credential options, including flags placed on opposite sides of `forward`, and disallow ChatGPT token stdin authentication with `forward`.

## Testing

Add coverage for account-claim validation, policy selection, policy-server sign-in requirements, shutdown during policy loading, credential flag conflicts, and bearer redaction.

GitOrigin-RevId: b6b50565e1f150b96edf3cee796909a991f1b47f
2026-11-05 04:25:19 +00:00