Commit Graph
12144 Commits
Author SHA1 Message Date
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
Benjamin Carlsson 6107b9886c Avoid duplicate assistant messages when resuming Cloud threads (#60335)
## Why

After Cloud thread history is replayed in the TUI, notifications for the same completed assistant items can render their text again.

## What changed

Track completed assistant items rendered from Cloud history by turn and item ID, and ignore subsequent starts, text deltas, and completions for those items. Apply this tracking when resuming threads and replaying thread snapshots, while allowing unfinished items and new turns to continue streaming.

## Testing

Extend the Cloud resume picker test to cover repeated notifications for completed messages, continued streaming in an active turn, and responses in a later turn. Retain coverage for queued user message reconciliation without resubmission.

GitOrigin-RevId: 1a829a2964586d876339c7c759022e4d366c8b2e
2026-11-09 03:01:00 +00:00
Benjamin Carlsson ffdf2daddb Suppress stale cloud stream disconnects after reopening a thread (#60327)
## Why

A queued cloud stream disconnect can outlive a successful reopen of the same conversation, causing an obsolete reconnect error to reach the TUI.

## What changed

Represent cloud reply stream losses with `AppServerEvent::ThreadStreamDisconnected` and filter queued losses superseded by a successful attachment to the same thread. Preserve losses for other threads and any newer disconnects; failed reopen attempts do not supersede pending losses.

Continue displaying current stream disconnects through the TUI's error notification handler.

## Testing

Add regression coverage for successful and failed reopens, disconnect ordering across threads, and TUI handling of disconnect events from the active and foreign backends.

GitOrigin-RevId: 640332b817970717fc816ab5a32bf658c01233bf
2026-11-09 02:31:46 +00:00
Benjamin Carlsson b9796386e5 Include older itemless Cloud failures in full transcripts (#60320)
## Why

Failed Cloud turns can contain an error without any items. Loading history through item pages alone can omit these older failures from the full transcript.

## What changed

- Add a `FullTranscript` hydration scope that fetches remaining Cloud turn metadata in pages of 100 after loading items.
- Deduplicate overlapping turn pages while preserving chronological order and already loaded items.
- Use the new scope for session transcripts while retaining `Complete` hydration for exports.

## Testing

Add a regression test covering older itemless failures, overlapping turn pages, repeated pagination cursors, transcript ordering, and item-only exports.

GitOrigin-RevId: 51183e35984aa0183d044061768555bb6f5d1189
2026-11-09 01:53:50 +00:00
Felipe Coury 8fcba7fae9 Improve side-chat discovery and navigation in the TUI (#60319)
## What changed

- Show latest user-prompt previews beneath saved side-chat titles, fetching previews only for visible entries when the chooser refreshes.
- Keep cached chats available during discovery, show loading and refresh status, and offer an inline retry action on failure.
- Preserve the selected chat across list updates and prevent asynchronous changes or held activation keys from opening an unintended entry. Account for preview rows in paging and mouse selection.
- Explain that side chats become available after the first main-chat message, and let `Ctrl+C` dismiss the chooser while preserving the main draft.
- Separate tabs with noninteractive gaps and improve hover styling for tabs, overflow arrows, and the add button.

## Testing

Extend integration tests and snapshots for discovery failures and retries, refreshed prompt previews, activation guards, variable-height paging, draft preservation, and tab hover states across light, dark, and fallback colors.

GitOrigin-RevId: 34423f5aeccb566682f7aa219f54ca5c7c8304fb
2026-11-09 01:52:42 +00:00
Benjamin Carlsson 25f4940d4a Defer executor readiness when prewarming a selected project (#60309)
## What changed

Set `deferred_environment` to `true` in cloud thread prewarm requests when a project is selected. Omit the field for default thread prewarming.

## Testing

Update the prewarm request encoding test to verify that only requests with a selected project include the deferred readiness flag.

GitOrigin-RevId: e10a646ebde9cc3acbdb01b304af0f73ecc1dbeb
2026-11-09 00:19:47 +00:00
Eric Traut 4e4767ffa7 Search task history from the command center (#60286)
## Why

Command center search only filtered tasks already loaded for browsing, leaving older tasks undiscoverable without manually loading more history.

## What changed

- Scan history on the active backend for case-insensitive matches in task names, previews, and working directories, using a separate paging cursor for each query.
- Add loading, retry, and `Show more matches` states. Cancel superseded searches and ignore stale results.
- Keep history matches separate from browse results and restore the previous selection when leaving search.
- Preserve the original task preview for search while displaying the latest prompt in task details.

## Testing

Extend discovery and command center tests to cover older history matches, fresh queries after browse pagination is exhausted, selection restoration, actions on search results, loading and retry states, and separate original previews and latest prompts.

GitOrigin-RevId: 9864ee006a14bd232e9cfd7ab2ee099c84667597
2026-11-08 19:35:45 +00:00
Charlie Marsh ee51bb132e Fix MCP startup tracking when attaching to shared app servers (#60280)
## Why

Clients attaching to a shared app server can miss startup notifications and have a different local MCP configuration. Waiting for locally configured servers can leave the TUI stuck in a busy state.

## What changed

- Track only reported MCP servers for shared app servers and subagents, settling startup once observed starts complete.
- Handle standalone terminal updates without reopening startup, while reporting failures and cancellations even when their starts were missed.
- Suppress duplicate diagnostics until an observed retry or notification lag, and include all received outcomes in each active round's summary.

## Testing

Add regression coverage for attachment before, during, and after startup; idle keyboard behavior after startup settles; terminal-only failures and cancellations; and repeated failures after retries or notification lag.

GitOrigin-RevId: e19f23c212f2f3cee1adeb5c3b94a508aa599242
2026-11-08 19:04:10 +00:00
Eric Traut 9ba7a3df52 Keep the agents overview open when there is no chat to return to (#60271)
## What changed

Only allow the cancel action to dismiss the agents overview when a chat is displayed or a startup thread is pending. Hide the `esc back` footer hint when there is no chat to return to, while retaining back hints for help and metadata editing.

## Testing

Add coverage for returning to a chat that is still starting and for pressing Escape in the overview after cancelling folder trust. Update snapshots and test setup to reflect whether a chat is available.

GitOrigin-RevId: af259330eb2a743fde449bbbd47c7f0eb6fa937e
2026-11-08 17:26:39 +00:00
Eric Traut a73fa8a869 Warn when a CLI model is absent from the ChatGPT model list (#60270)
## What changed

Show a startup warning when the active model matches the CLI model override but is missing from the ChatGPT model list, for ChatGPT accounts using the OpenAI provider. Suggest checking the spelling or choosing another model with `/model`, while preserving the selected model and submitting queued startup input.

Reuse the transcript-visible warning helper for this notice and existing usage warnings.

## Testing

Extend the startup test to check the warning text, preserved model selection, and queued input submission.

GitOrigin-RevId: bb1e8c415346bf271e25ef4e8571c13b4bc2c8c8
2026-11-08 17:17:51 +00:00
Sean Huang 748ab55ca7 Increase Bazel core unit test shards from 8 to 16 (#60206)
GitOrigin-RevId: d6188e178668c11ad212b907e420d32c2be25606
2026-11-08 05:59:11 +00:00
richardopenai c9b4267c37 Expose agent tree IDs and environment removal (#60190)
## What changed

- Add `CodexThread::agent_tree_id()` to identify a loaded agent tree. The root and native children share an ID; loading a new tree produces a new ID even when reusing a persisted thread ID.
- Add `EnvironmentManager::remove_environment()` to unregister an environment while preserving existing handles and the default environment ID.

## Testing

Extend tests to check tree IDs across child creation, forks, warm reuse, and cold reloads, and to verify environment removal and re-registration.

GitOrigin-RevId: 43944ed6766374508d9862cd5d333bc4cb67c338
2026-11-08 02:27:59 +00:00
Alex Kira c3936b4b8a Allow model overrides for incremental Code Mode tool messages (#60188)
## What changed

Add `exec_tools_update_hint` and `exec_tools_removed_definitions_header` to `model_messages.tools.incremental_tools` and use them when rendering Code Mode catalog updates and removals.

Overrides are literal strings limited to 512 UTF-8 bytes per field. Missing, null, or oversized values use the existing bundled wording. Empty strings omit the guidance while retaining changed definitions and removal keys. Wording changes alone do not trigger catalog updates.

## Testing

Extend unit coverage for defaults, null fields, independent fallback, and UTF-8 byte limits. Add scenario assertions and a snapshot covering custom and empty wording, model switches, catalog changes, and restoration after compaction.

GitOrigin-RevId: da9e00fdb5197a2b5fa39ce533ba87c76ff3e82c
2026-11-08 01:13:32 +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
Felipe Coury 8044c6867c Add keyboard and mouse navigation for sidebar tabs (#60181)
## What changed

- Add configurable `sidebar_up` and `sidebar_down` actions to cycle through tabs with wraparound while the sidebar has focus. Default leader shortcuts use `Shift-Tab` / `Tab`, `Up` / `Down`, and `k` / `j`.
- Support mouse-wheel tab switching over the tab strip and clickable overflow arrows when tabs do not fit.
- Show previous/next tab shortcuts in the leader HUD and keymap picker, and preserve pane zoom when switching tabs.

## Testing

Extend sidebar interaction tests and snapshots to cover overflow arrows, mouse-wheel navigation, leader shortcuts, repeated custom bindings, draft preservation, and scroll handling where the leader HUD overlaps the tab strip.

GitOrigin-RevId: 39ccb40f40560d1be850397f9597e765caa996a3
2026-11-07 23:18:39 +00:00
Benjamin Carlsson 1455fda735 Attach typed punctuation to completed skill mentions (#60180)
## Why

Skill completion inserts a trailing space, leaving unwanted whitespace when the next typed character is punctuation, such as `$rustdoc ,`.

## What changed

Replace the space inserted by skill completion when immediately followed by common closing punctuation, producing `$rustdoc,` instead. Support both skill mention pickers, including full-width punctuation and `》`, while preserving skill bindings.

Preserve existing draft whitespace and keep the separator for pasted text or punctuation entered after cursor navigation. Classify buffered punctuation as typing or a paste burst before deciding whether to remove the space.

## Testing

Add regression tests for punctuation, existing spacing, cursor navigation, and paste bursts, plus a snapshot covering `》`, recovery state, and preserved skill bindings.

GitOrigin-RevId: 8988add8092e8cb5f0618ef834590d52a81ad576
2026-11-07 23:00:32 +00:00
Alex Kira 5226f2fb4b Add metrics for incremental exec catalog updates (#60177)
## What changed

Count tool and namespace-instruction entry deltas in `codex.tools.exec_entry_updates`, tagged by `added`, `schema_changed`, or `removed`. Entry replacements count as `schema_changed`; full catalog declarations do not count as entry deltas.

Record rendered UTF-8 batch sizes in `codex.tools.exec_update_bytes`, including hints and framing but excluding full declarations and removal notices.

## Testing

Extend the namespace transition test to verify action counts, UTF-8 byte totals, and metric behavior when exec is hidden, restored, or unchanged.

GitOrigin-RevId: 22070b84230296d78a67b83641cbc02157d84419
2026-11-07 22:38:11 +00:00
Alex Kira aa9b9cc94e Test exec catalog preservation across session and compaction changes (#60173)
## What changed

- Cover incremental exec tool settings and catalog changes across resume, fork, tool mode switches, and compaction.
- Verify that adopting background compaction preserves live exec declarations, tool metadata updates, and retained conversation order after a model catalog refresh.
- Include an `exec` namespace in the top-level tool catalog ordering and snapshot round-trip test.

GitOrigin-RevId: 3df603b98a006abb55a5095b299080f036576242
2026-11-07 21:44:47 +00:00
psachdeva-oai 202b590e84 Preserve display instructions in answer moderation (#60172)
## Why

Recovered answer history needs presentation instructions alongside the moderation flag so clients can apply the intended display behavior.

## What changed

- Add optional `display` metadata with an `action` and optional `blockType`, `cyberTrustedAccess`, and `checkTrustedContacts` fields.
- Carry display metadata through final answers, legacy events, thread history reconstruction, and legacy rollout migration.
- Expose the metadata in the app-server protocol and update generated JSON schemas, TypeScript types, and Python SDK models. Missing display fields remain compatible with existing stored moderation data; the app-server emits absent optional values as `null`.

## Testing

Extend the final-answer moderation test to cover display metadata in answer items and legacy events. Add serialization coverage for missing display data, nullable fields, and preservation of an explicit `false` value.

GitOrigin-RevId: b798a2ecc53c2a94c7659ef3d9663b3143b70a1a
2026-11-07 21:31:08 +00:00
Alex Kira 33b3f80a09 Wire incremental exec tool updates into Code Mode sessions (#60163)
## Why

Changes to nested tools should update the model's catalog without repeating the full `functions.exec` declaration or rewriting retained context.

## What changed

Pass structured exec definitions through the tool router into the session's tool world state. Enable granular updates for Responses Lite in `CodeModeOnly` when both `IncrementalTools` and `IncrementalExecTools` are enabled.

Append changed tool definitions, namespace instructions, and removals as developer messages. Keep common exec instructions and shared types frozen until compaction, then install the latest full catalog.

## Testing

Add feature-gating coverage and a scenario snapshot covering tool additions and removals, namespace instruction changes, eager/deferred transitions, re-enabling tools, retained context, and catalog restoration after compaction.

GitOrigin-RevId: bbf850d4e5018388eeb4c09345d885d776962e09
2026-11-07 19:26:20 +00:00
Alex Kira 2bc8e7f545 Add support for incremental code mode tool definitions (#60157)
## What changed

Render stable entries for nested tool definitions and namespace instructions alongside the full `functions.exec` description. Add optional catalog tracking that emits complete replacements for added or changed entries and explicit notices for removed entries, while keeping the existing exec declaration unchanged.

Preserve entry hashes while exec is unavailable, then restore the full catalog and withdraw removed entries when it returns. Keep the existing snapshot format for ordinary tool catalogs.

This change provides the rendering and state support; runtime activation remains disabled.

## Testing

Add tests for definition rendering and namespace identity, batched additions and changes, removal notices, unchanged catalogs, and full catalog restoration after exec is hidden.

GitOrigin-RevId: f472bd3e8e770a8cad9663c72e290abe7d0473be
2026-11-07 18:24:25 +00:00
Felipe Coury 57e64682f8 Persist local workspace side chats and add tab close controls (#60152)
## What changed

- Save side chats as attachments to their parent conversation when local workspace history supports them, and let users reopen them from the sidebar after a restart.
- Show chat names or first-prompt previews in sidebar labels, and allow saved side chats to be renamed with `/rename`.
- Add tab close buttons, middle-click closing, and the configurable `close_sidebar_tab` shortcut, defaulting to `Ctrl-X W`. Closing a saved chat keeps it available in the picker; archiving removes it from Side chats.
- Confirm actions that stop running work, discard unsent input, or lose temporary history. Delete saved TUI side chats when deleting their parent conversation.

## Testing

Add coverage for reopening saved side chats after restart, archive handling, close confirmations, and preventing close-confirmation keys from accepting a replacement approval dialog.

GitOrigin-RevId: 3d47533d007286a7354660c08df13a83dd48d5d7
2026-11-07 17:31:27 +00:00
tongzhou wang 57a808a392 Preserve code mode dispatch errors in rollout traces (#60122)
## Why

Code mode requests can fail before a `CodeCellStarted` event. Suppressing their dispatch traces loses the caller-facing error in that case.

## What changed

Record dispatch lifecycles for code mode custom payloads, preserving their results independently of code cell events.

## Testing

Update the incompatible-payload regression test to use the code mode tool name and verify that replay retains the failed tool call and result payload even when no code cells were recorded.

GitOrigin-RevId: 687a36cd7ba55665ed7abc88c36732597e7fb025
2026-11-07 12:41:14 +00:00
tongzhou wang 43b4274f3f Buffer payload JSON reads during rollout trace replay (#60118)
GitOrigin-RevId: b0fbc478e19ceda1874d98ea50a39252a2951ed7
2026-11-07 12:32:02 +00:00
cooper-oai cce9d3228b Use runtime authentication for Analytics requests (#60101)
## What changed

- Honor `RuntimeAgentInstances` and the configured runtime auth mode for Analytics plan discovery and report requests to OpenAI endpoints.
- Share installation ID resolution and Codex runtime registration setup through `codex-runtime-agent-instance`.
- Preserve typed runtime authentication errors so expired credentials retain the “Sign in again to load Analytics” guidance.

## Testing

Add coverage for both runtime auth modes across regional and staging endpoints, fresh assertions for each request, sign-in guidance after bootstrap failure, redirect rejection, and invalid organization/project selectors.

GitOrigin-RevId: 50e0d959b3abd81ebe7a6a584e272f14cf52e504
2026-11-07 10:41:36 +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
rhan-oai c4f0e09912 Allow asynchronous model request budget checks (#60080)
## What changed

Make `ModelRequestContributor::budget_exhausted` return an `ExtensionFuture` and await budget checks before HTTP and WebSocket generation. WebSocket warmup continues to skip budget checks.

If the account changes during the post-connect budget check, rebuild the request setup and reconnect before sending the WebSocket request.

## Testing

Update tests to cover a pending budget check that resolves to exhaustion, warmup connection reuse, and an account switch while the post-connect budget check is awaiting completion.

GitOrigin-RevId: 462c74b86a46a4b2276f901c69187fc7cbc3ff81
2026-11-07 07:45:36 +00:00
rhan-oai f5ac7a757e Support asynchronous host service-tier reads and acceptance (#60075)
## What changed

Make `AgentServiceTier` reads asynchronous and have updates return a receipt for local acceptance. Await acceptance during root startup and settings updates outside state and registry locks, sharing the receipt with explicit same-tier retries.

Await shared-tier reads during child preparation, startup prewarm, and step capture. Allow cancellation while capturing a step, and keep host propagation independent of the acceptance wait.

## Testing

Extend the host-child WebSocket test to cover delayed acceptance, same-tier retries without duplicate updates, accessible settings while acceptance is pending, and tier inheritance during prewarm and subsequent steps.

GitOrigin-RevId: 0e2e1899834c37684e904c4a36e66344a0c6c7f3
2026-11-07 06:51:10 +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
Felipe Coury 0ed34eb9ce Ensure side-chat policy reaches the first model request (#60067)
## Why

An inherited turn can suppress a fork's configured developer instructions, leaving the first side-chat request without its developer policy.

## What changed

- Move shared side-conversation instructions and the history boundary into `codex-context-fragments`.
- Inject the developer policy before the user-role boundary when creating a TUI side-chat fork, while retaining the configured instructions.
- Distinguish attached and temporary policies, applying the worktree restriction only to temporary side chats.
- Add guidance to set up recurring monitors in the main chat or a new chat because temporary side chats cannot run scheduled updates.

## Testing

Add a TUI integration test that checks the first side-chat model request contains the policy and boundary. Add a core request-history snapshot covering an attached side chat that preserves inherited context, policy, and its prior answer after resuming from disk.

GitOrigin-RevId: 889cb317dc3327457cd9ef0879ec9f77dbfaeeba
2026-11-07 05:59:44 +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
Benjamin Carlsson e6bf88ae02 Support Cloud image messages and editable draft handoffs (#60061)
## Why

Cloud messages previously accepted only plain text, and switching a draft to Cloud waited for session preparation without processing composer input.

## What changed

- Support ordered text and image parts in Cloud submissions and user-message summaries, preserving attachment placeholders, image detail, and client message IDs.
- Accept inline data URLs and uploaded file IDs, including image-only messages. Reject invalid references and text spans locally, and cap encoded image requests at 3.75 MiB while retaining the existing plain-text limit.
- Keep the composer editable and redraw the TUI while Cloud prepares a conversation. Carry the latest draft, attachments, and Vim mode into the destination, retain drafts on failure, and prevent submission to the outgoing session during the handoff.
- Preserve buffered paste input and pending clipboard reads across the handoff, with connection and failure hints.

## Testing

Add regression coverage for image wire encoding, receipt identity, validation and size boundaries, draft editing during successful and failed handoffs, clipboard completion, Vim state, and attachment recovery after rejected submissions.

GitOrigin-RevId: 0cbcde0ab89ba961780b5f88456057e6b6a19cd5
2026-11-07 04:48:30 +00:00
cooper-oai d4a341bd52 Reauthenticate runtime requests before reusing WebSocket access (#60055)
## Why

An open WebSocket can remain usable after its runtime is paused. Runtime-authenticated requests need a fresh handshake to revalidate access before submitting more work.

## What changed

- Reconnect before each runtime-authenticated Responses request and skip speculative preconnection. Preserve turn routing when the runtime identity is unchanged.
- Open a fresh connection for each runtime-authenticated Guardian classification instead of prewarming or reusing pooled sockets.
- Preserve HTTP fallback for unsupported upgrades and connection failures, while propagating authentication, authorization, rate-limit, and policy errors.

## Testing

Add regression coverage for pause and unpause behavior, credential changes, fresh assertions, and Guardian HTTP and WebSocket transports in both runtime authentication modes.

GitOrigin-RevId: 9f650147260da5cbbf5bb23dfff0af095fff3955
2026-11-07 04:06:26 +00:00
evanz-oai 44ccf39457 Preserve model catalogs when starting child agents (#60049)
## Why

Child startup can lose remote model capabilities such as `tool_search` when the selected catalog is uninitialized or disk data is older than the parent's in-memory snapshot.

## What changed

- Initialize the final provider, auth, and originator catalog before resolving a child's startup model, then read it from memory.
- Preserve loaded catalogs, including empty responses and updates that failed to persist, without overwriting concurrent refreshes.
- Reuse catalogs across retry and WebSocket transport overrides while retaining routing and header distinctions.

## Testing

Add regression coverage for child tool search with warm, cold, and disabled caches; failed cache writes; concurrent refreshes; empty catalogs; and Guardian reviewer catalog reuse.

GitOrigin-RevId: 01d995a65b623cc7d6f26e2dc9b6e8cf380de782
2026-11-07 03:16:52 +00:00
karenwong-openai 358e464528 Allow plugin starter prompts up to 512 characters (#60048)
## What changed

Raise the per-entry limit for plugin `interface.defaultPrompt` from 128 to 512 characters, retaining the maximum of three prompts. Update the protocol documentation and generated schemas and bindings to reflect the new limit.

## Testing

Update manifest coverage to accept a 512-character Unicode prompt and reject an over-limit prompt. Adjust the discovery warning test to use a 513-character prompt.

GitOrigin-RevId: 0ba3ceb253edf22a583f774492934b7c9b5ac231
2026-11-07 03:08:46 +00:00
viyatb-oai b7d2321ef7 Derive MCP network policy and preserve saved denials (#60046)
## Why

Stale saved grants or malformed rules can cause valid network denials to be discarded. A failed rule write can also leave the in-memory policy inconsistent with native enforcement.

## What changed

- Add a helper to derive MCP network policy from controller and environment policies, permission profiles, approval settings, and saved rules. Preserve managed restrictions and conservatively deny traffic that requires review, request hooks, or DNS checks the metadata cannot express.
- Retain valid saved denials when grants violate managed constraints or a rule batch is malformed.
- Serialize runtime updates and persistence, publishing denials before the write so they remain effective if saving fails. Publish saved grants after a successful write.
- Extract validation of listener settings for running proxy updates.

## Testing

Add coverage for policy composition, mixed-executor local binding, native proxy denial parity, stale grants, malformed denials, failed persistence, and compatibility with trusted MCP servers without policy negotiation support.

GitOrigin-RevId: ef00632acb48a51fc582f18d20a3e713f953a191
2026-11-07 03:06:33 +00:00
viyatb-oai a90c808408 Centralize Windows sandbox filesystem override resolution (#60042)
Add `WindowsSandboxFilesystemOverrides::resolve` to select the elevated or
restricted-token resolver, and use it in core, exec-server, and direct-spawn
sandbox preparation. Pass the child environment through to the elevated
resolver.

Replace the exported unsupported-sandbox reason helper with a test-local
wrapper around the shared resolver.

GitOrigin-RevId: f1d404356a4f680ce81123bc8284508f27d4d6ab
2026-11-07 02:46:41 +00:00
Eric Traut 11ca3f7531 Require explicit project trust in non-interactive runs (#60041)
## What changed

Keep untrusted project configuration and MCP servers disabled in exec runs, even with `--sandbox workspace-write`, and warn when project configuration is disabled.

Add `--trust` to `codex exec` and `codex review` to save project trust for the current and future chats, including MCP commands outside the sandbox. The grant persists with `--ephemeral`, refuses explicitly untrusted projects, and cannot be combined with `--ignore-user-config`.

Pass the working directory as a configuration default so embedded server startup does not implicitly grant trust. Preserve the selected `--oss` provider across configuration reloads.

## Testing

Extend CLI parsing and MCP integration coverage for explicit trust, persistence across ephemeral runs, disabled project configuration with write access, and rejection of conflicting or explicitly untrusted settings.

GitOrigin-RevId: b57f4f8829f98d77c5487fa8405c7f29b5d70d0c
2026-11-07 02:39:03 +00:00
Alex Kira 762f87d5bb Restrict legacy incremental tools to Amazon Bedrock providers (#60040)
## What changed

Gate `incremental_tools_legacy` on the `amazon-bedrock` and
`amazon-bedrock-runtime` provider IDs instead of the OpenAI provider for regular
Responses requests. Responses Lite continues to use `incremental_tools`.

## Testing

Expand the tool catalog update scenarios to cover both Bedrock provider IDs with
legacy incremental tools enabled and disabled. Update the regular Responses tool
removal scenario to use the Bedrock provider.

GitOrigin-RevId: ad0ff31975166a2a7fdcee6fefc272ecc79dd448
2026-11-07 02:37:50 +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
Charlie Marsh 7ccf78dec4 Preserve MCP sharing discovery when deferring cached stdio startup (#60037)
## Why

Subagents reusing cached MCP tool definitions were forced to use the legacy protocol, preventing connection sharing from being negotiated on first use.

## What changed

Keep stdio protocol discovery enabled during deferred startup while allowing dormant subagents to advertise cached legacy tools. Track modern discovery separately from catalog updates so discovery clients reject older legacy catalogs while legacy clients can still reuse them. Keep modern tools out of the legacy catalog when joining pooled connections.

## Testing

Add coverage for deferred subagents negotiating sharing on first use and reusing the same server process, while a legacy sibling retains cached definitions without starting its server. Extend cache coverage to ensure older legacy fetches cannot undo modern discovery.

GitOrigin-RevId: 5f8f4deb22cfb81a08c05ff3fcd7ba5c9199551c
2026-11-07 02:26:13 +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
Eric Traut 738ef9f3bb Omit sensitive process inputs from spawn trace logs (#60034)
## Why

Command arguments and environment variables can contain credentials. Logging them when spawning a child process can expose those credentials in trace output.

## What changed

Replace argument, `arg0`, and environment contents in `spawn_child_async` trace logs with argument and environment counts and a flag indicating whether `arg0` is overridden. Keep the program, working directory, network sandbox policy, and stdio policy in the trace.

## Testing

Add a regression test that captures trace output and verifies that argument, `arg0`, and environment canaries are omitted while the program path remains visible.

GitOrigin-RevId: c317e7dcc6fd8b4eafb6fcfe98dc8634807c813d
2026-11-07 02:01:23 +00:00
Joe Savona cfc11eb483 Allow extension status content to use multiple footer rows (#60032)
## Why

Extension status content was limited to one row, clipping multiline text and content that wraps at narrow terminal widths.

## What changed

Measure extension status content at the available width and reserve up to four rows in both shared and separate status layouts. Account for mode indicators and warnings, and remeasure when content or available width changes.

Extra status rows yield to the draft and other composer surfaces when vertical space is limited. An unfocused composer keeps a single dim status row.

## Testing

Add regression coverage for resizing, wrapping beside mode indicators and warnings, hyperlink preservation, limited vertical space, cursor placement, footer overrides, focus changes, theme updates, and reasoning effort changes.

GitOrigin-RevId: 6a637b5cf6f34684639a92d920da4795c90abb6f
2026-11-07 02:01:00 +00:00
Joe Savona 5c7a1602c8 Unify TUI status line layout for extension content (#60031)
## What changed

- Use the same status renderer for shared footer rows and separate status lines, allocating extension content the width left by the mode indicator.
- Measure extension content with `measure_natural()` instead of rendering it at maximum width.
- Skip reasoning effort status transitions for extension content and clear an active transition when extension content replaces the status line.

## Testing

Add regression coverage for matching shared and separate layouts across terminal resizing, natural width measurement, viewport clipping with hyperlinks, and skipping effort transitions when switching between native and extension content.

GitOrigin-RevId: 4ffc52ec6374f3c2b4995c0472bee25aa15ae7a0
2026-11-07 01:59:44 +00:00
Joe Savona 7cdb219883 Render UI trees directly into terminal buffers (#60029)
## What changed

Use a shared layout traversal to measure prepared UI trees and paint text directly into terminal buffers. Add natural and viewport-constrained size measurement, and use direct rendering for extension footer content.

Preserve wrapping, styles, and terminal hyperlinks while clipping at grapheme boundaries and leaving overflow ellipses unlinked.

## Testing

Add coverage for size measurement in terminal cells, wide characters at clipping boundaries, and zero-width text around overflow ellipses. Update rendering tests to check painted buffer contents and hyperlinks.

GitOrigin-RevId: 828c45d3400f9e3dfce9a7bd812d1cc0ea51642f
2026-11-07 01:52:20 +00:00
Joe Savona f8df49a196 Reuse prepared UI trees for footer rendering (#60028)
## Why

Footer width measurement and rendering each prepared the same UI tree again.

## What changed

- Prepare footer extension content once and share the owned `PreparedUiTree` through `Arc`.
- Resolve colors against the active theme at render time, caching each color resolution within a render pass.
- Share leaf text buffers across prepared chunks instead of copying their slices.

## Testing

Add a test verifying that chunks from a clean text leaf retain slices of the original buffer. Update existing UI tree rendering tests to use the owned prepared representation.

GitOrigin-RevId: daba035c291338f3e0036e9ad4f2fd26f56a3910
2026-11-07 01:51:55 +00:00
Joe Savona 66a56b17a1 Keep configured status lines on the native renderer (#60027)
## Why

Enabling `tui_extensions_status_line` routed configured status lines through a plain-text extension renderer and hid the “Use theme colors” option in the status line picker.

## What changed

Always use the native status line renderer for configured items and their live picker previews, preserving theme colors and pull request links regardless of the extensions flag. Always expose the theme color option in the picker, and clarify that the flag enables experimental MCP status line providers.

## Testing

Update coverage to require native status line content across extensions flag changes and exercise the live picker preview with the flag enabled. Retain checks for pull request hyperlinks and color preference preservation.

GitOrigin-RevId: bce7df5696c2bd3583d3ef99c43e7a2014e17294
2026-11-07 01:51:31 +00:00