Commit Graph
2388 Commits
Author SHA1 Message Date
Charlie Marsh 35eaf3ffb0 Avoid redundant TUI redraws while streaming (#34049)
## What changed

- Redraw assistant and plan stream tails only when a completed line changes the visible tail.
- Cache the first reasoning header and update the status indicator only when its visible state changes, while restoring the cached header if the indicator is recreated.
- Keep regular commit ticks able to clear stale stream tails.

## Testing

- Add coverage for unchanged partial deltas, changed newline-delimited tails, reasoning-header redraws, recreated status indicators, stale plan tails, and history-line draw scheduling.

GitOrigin-RevId: 9016175f97ef2db2edc2fd5ba13a4d731dc2d98c
2026-07-18 18:19:39 +00:00
Charlie Marsh 028edf8c1e Avoid resending the model for reasoning shortcuts (#34047)
## What changed

Update normal-mode reasoning shortcuts to emit only an
`UpdateReasoningEffort` event instead of reapplying the current model alongside
the new effort.

Extend the shortcut tests to verify that both increasing and decreasing
reasoning effort leave the model unchanged.

GitOrigin-RevId: cf5206a3a8e0a0bf66ecc2d0bfcc1ba44c98fead
2026-07-18 18:05:04 +00:00
Charlie Marsh 537e69ab66 Render streamed Markdown incrementally (#34045)
## Why

Streaming TUI responses repeatedly rendered the entire accumulated Markdown source for each committed delta, including blocks whose output could no longer change.

## What changed

- Retain rendered output for completed top-level Markdown blocks and rerender only the final mutable block as new source arrives.
- Track block boundaries during the existing Markdown parser pass and map them through table-fence normalization.
- Preserve canonical full rendering when source-wide state may affect earlier output, including reference link definitions and inline visualizations, and when the width or render mode changes.
- Append raw-mode lines directly while preserving blank lines.

## Testing

Added coverage that compares incremental output with full rendering across paragraphs, headings, lists, block quotes, code fences, tables, HTML blocks, links, visualizations, render-mode changes, and normalized table fences.

GitOrigin-RevId: 748171c4ed58923329b59c48ea3c2afa4819ec88
2026-07-18 18:00:51 +00:00
Anais Killian 2895d82b5e Let users remember the working directory for resumed sessions (#33950)
## What changed

- Add `tui.resume_cwd` with `current` and `session` modes for resume and fork flows.
- Let users persist either mode directly from the working-directory prompt, while preserving one-time choices when no preference is configured.
- Apply the preference consistently during startup and in-app resume, honor explicit `--cd` overrides, and reject unsupported or unavailable directory choices with a clear error.

## Testing

- Cover configuration parsing and persistence, prompt behavior, startup and in-app flows, session metadata fallback, and remote workspace constraints.

GitOrigin-RevId: 7bf144c4b8c55bdb868cc8a71caf397c7740451a
2026-07-18 03:58:20 +00:00
nhamidi-oai 23899f7cb6 Forward audio inputs to the Responses API (#33932)
## Why

Audio variants were available in the user-input protocol but were replaced with unsupported-input placeholders instead of being sent to the model.

## What changed

- Serialize audio data URLs as `input_audio` content and convert local `wav`, `mp3`, `m4a`, `webm`, and `ogg` files to labeled data URLs.
- Validate and canonicalize base64 audio before requests, enforce the 50 MiB input limit, and replace invalid, unsupported, or oversized audio with explanatory text.
- Preserve audio attachments when mapping response items back to user-message events and document the app-server input variants.

## Testing

- Add unit coverage for local-file conversion, data URL validation, size and format errors, event mapping, and attachment extraction.
- Add client tests that verify data URL and local audio payloads sent to the Responses API.

GitOrigin-RevId: f72cd6b6e43ab12757eeb47621b1d670594ac7d9
2026-07-18 00:26:24 +00:00
Felipe Coury f896ab9f25 Render inline visualization links in the TUI (#33925)
## Why

Assistant-authored inline visualizations need a terminal fallback that lets users open generated artifacts in a browser.

## What changed

- Recognize `::codex-inline-vis{file="..."}` directives in assistant Markdown and replace them with browser links during streaming, finalized history rendering, and local transcript previews.
- Materialize visualization fragments in sandboxed viewer documents with a content security policy, while restricting artifacts to HTML files within the thread's visualization directory and limiting their size.
- Show an explicit unavailable message for invalid or missing artifacts, hide incomplete streaming directives, and preserve directive text in code blocks and user Markdown.
- Add a trusted file-link path for generated viewers without enabling arbitrary `file:` links in Markdown.

## Testing

Add coverage for directive rewriting, streaming and replay, artifact validation, sandboxed viewer generation, trusted terminal hyperlinks, and literal preservation.

GitOrigin-RevId: a666b4ebc82bb5798ad45bd137fd815d538e1de2
2026-07-17 23:19:12 +00:00
nhamidi-oai 97dbd01a3d Add audio variants to user input protocols (#33923)
## What changed

- Add remote and local audio variants to core and app-server user inputs, including generated JSON and TypeScript schemas.
- Preserve audio fields when converting app-server inputs and response content into thread items.
- Keep unsupported audio out of model requests, TUI rendering, text extraction, and truncated tool output, using explicit text placeholders where audio is submitted as a model input.

## Testing

- Cover app-server media conversion, unsupported-input placeholders, TUI omission, and tool-output truncation.

GitOrigin-RevId: 16152bf3af674575ce569764a8b472e032e7569d
2026-07-17 23:14:37 +00:00
Eric Traut e98765c212 Allow selecting path-backed agents in the TUI picker (#33922)
## Why

Opening the agent picker stopped after adding status history whenever path-backed subagents were present, so those agents could not be selected from the picker.

## What changed

- Continue into the picker after rendering status for path-backed subagents.
- Skip duplicate liveness refreshes for path-backed threads and display non-primary agents by their canonical path when available.

## Testing

- Add a snapshot test that opens the picker for a path-backed agent and verifies that selecting it emits `SelectAgentThread` for the expected thread.

GitOrigin-RevId: 1668bb7817ce4e13c91d85c4d7ddab31c04c97b3
2026-07-17 23:11:07 +00:00
Eric Traut d4982d0a33 Preserve sub-agent liveness in the agent picker (#33921)
## Why

Opening the agent picker could clear a successful spawn hint before the new
sub-agent had emitted a turn event, making a running agent appear stopped.

## What changed

- Treat active turns and matching completion events as authoritative liveness
  transitions while leaving an empty event store unchanged.
- Remember terminal liveness so delayed activity cannot revive a stopped agent;
  only a new turn can mark it running again.
- Ignore `Interacted` activity when deriving agent liveness.

## Testing

Added coverage for empty stores, stale and current completion events, completed
snapshots, delayed activity, and subsequent turns.

GitOrigin-RevId: 462539d8134a5d3520dbd41edb44b3251f50ead5
2026-07-17 23:07:40 +00:00
Charlie Marsh 7ed19a9758 Batch persistent history reads during reverse search (#33905)
## Why

Reverse search fetched persistent history one entry at a time, making a deep or unsuccessful search require a lookup for every older entry.

## What changed

- Keep the newest-entry probe lightweight, then scan older persistent history in bounded batches.
- Cache batch results by absolute offset and preserve continuation cursors across repeated searches.
- Ignore stale responses, retry failed batch reads a bounded number of times, and restore the draft without reporting a false “no match” state when history is unavailable.

## Testing

- Cover batch continuation, caching after query changes or cancellation, stale metadata, retry exhaustion, and thread routing.
- Verify that scanning 1,024 entries uses one single-entry lookup and eight batch lookups.

GitOrigin-RevId: efc791fcbd5290050af703dd31c5c21b33240e23
2026-07-17 21:16:07 +00:00
Eric Traut 50b8213385 Support ChatGPT-branded Desktop app builds (#33901)
## Why

The Desktop app can use Codex or ChatGPT branding while retaining stable platform identities. CLI discovery and TUI handoff should not depend on a single display name or hardcoded executable path.

## What changed

- On macOS, search for both `ChatGPT.app` and `Codex.app`, and accept only bundles with the `com.openai.codex` identifier.
- On Windows, detect installs by their package app ID and resolve the `codex` protocol executable from the AppX manifest before handing off a TUI session.
- Use “Desktop app” consistently in CLI and TUI user-facing text.

## Testing

Add coverage for selecting a ChatGPT-named Codex bundle and rejecting the classic ChatGPT bundle.

GitOrigin-RevId: b84a56eb6e960712152e1a9b023ab530ec9a354a
2026-07-17 20:46:18 +00:00
brisebois-oai bc5c9161b4 Expose plugin installation interstitial requirements (#33896)
## What changed

- Add nullable `mustShowInstallationInterstitial` metadata to app-server
  `PluginSummary` responses.
- Preserve the remote service value through catalog, installed-plugin cache,
  list, read, and share-list paths.
- Return `null` for local plugins and remote responses that omit the field so
  clients can fail closed when the policy is unavailable.

## Testing

- Cover `true`, `false`, and missing values across remote summary paths and
  app-server plugin endpoints.

GitOrigin-RevId: db79702ee2bfa800a9910d64d933bcabecb3ce70
2026-07-17 20:02:51 +00:00
Abhinav 7bd44085e1 Add SessionEnd hooks for thread teardown (#33895)
## What changed

- Add the `SessionEnd` hook event to hook configuration, protocol schemas, analytics, and the hooks browser.
- Run matching hooks for root threads during shutdown, including app-server archive, delete, idle unload, and graceful shutdown. Flush the transcript first and provide the session ID, transcript path, working directory, and `reason: "other"`.
- Keep teardown bounded: hook output is advisory, the default timeout is one second, configured timeouts are capped at three seconds, and async hooks run synchronously with a warning.

## Testing

- Cover transcript availability, matcher selection, timeout normalization, ignored control output, subagent exclusion, archive/delete ordering, and graceful shutdown of multiple loaded threads.

GitOrigin-RevId: 5d19a658677a137caf836ed5042dcb43f5eb6d1a
2026-07-17 19:58:56 +00:00
charlesgong-openai b99cc315fd Report CLI as the external agent config import source (#33883)
## Why

The TUI import request used the selected migration source as the identifier for
the product initiating the import, conflating two distinct protocol fields.

## What changed

Set `source` to `cli` for imports initiated by the TUI while continuing to pass
the selected adapter through `migrationSource`.

GitOrigin-RevId: 7b00728464cb1d4e478ac4aa6b18f7254d2e5152
2026-07-17 18:24:26 +00:00
jif 1fc15cc9a9 Remove unused TUI collaboration mode indicators (#33872)
## What changed

Remove the unused `PairProgramming` and `Execute` footer indicator variants and their label and styling branches. Keep `Plan` as the only `CollaborationModeIndicator` rendered by the TUI.

GitOrigin-RevId: 5f3e6c8ff50a04d41dd5fc342cf1347a7e4f78fe
2026-07-17 16:59:25 +00:00
jif f57467275c Remove the redundant borrowed line wrapping helper (#33870)
## What changed

Remove `word_wrap_lines_borrowed` and use the general `word_wrap_lines` API for
borrowed line slices. Drop the duplicate helper-specific tests while retaining
coverage of borrowed iterator wrapping through the general API.

GitOrigin-RevId: aa55a6180705a676bf82ea66c9ba0fe15d00a5fe
2026-07-17 16:39:16 +00:00
jay a50e822398 Confirm usage-limit resets before redemption (#33845)
## Why

Selecting a usage-limit reset from the picker immediately started redemption,
leaving no opportunity to verify the choice.

## What changed

- Open a separate confirmation popup before redeeming a selected reset, with
  `No, go back` selected by default.
- Show backend-provided reset titles and descriptions in the picker and
  confirmation, with generic fallback copy when those details are absent.
- Ignore duplicate or stale confirmation and redemption events, while retaining
  the idempotency key needed to retry a failed redemption.

## Testing

- Added coverage for confirmation, cancellation, backend copy, duplicate and
  stale events, successful redemption, and retry behavior.

GitOrigin-RevId: 828945f99f06e8c73941fd864e4aa9ac52729f98
2026-07-17 15:28:19 +00:00
Felipe Coury 3f0669dbd6 Make parent-owned sub-agent threads read-only in the TUI (#33841)
## Why

Multi-agent V2 spawned threads are controlled by their parent and reject direct
app-server input. The TUI should expose that ownership instead of presenting an
input flow that the server will reject.

## What changed

- Add the experimental `Thread.canAcceptDirectInput` capability for loaded
  threads and populate it from the same policy used to validate `turn/start`
  and `turn/steer`. Stored, unloaded threads report `null`.
- Carry the capability through TUI thread discovery, selection, startup, and
  resume flows, with a compatibility fallback for older app servers.
- Present parent-owned threads as view-only, preserve drafts and queued input,
  block agent-directed commands and settings shortcuts, and keep local
  navigation and inspection commands available.

## Testing

- Cover V1 writable and V2 view-only spawned threads through selection and
  resume.
- Cover composer submission paths, queued and initial input preservation,
  allowed navigation commands, settings shortcuts, and the view-only UI.

GitOrigin-RevId: 495ad051249e5577fb0b0c1cc8c40a0998d04918
2026-07-17 15:14:47 +00:00
Adam Perry @ OpenAI d3fc1950a9 Extract TUI approval request payloads into structs (#33684)
## What changed

Give command, permissions, patch, and MCP elicitation approvals dedicated
request structs, and update TUI routing and rendering to use the wrapped
payloads.

GitOrigin-RevId: ffee4058dd27505be2a11de3758ac12bb707b6b8
2026-07-16 20:44:28 +00:00
jif 21c37fb374 Honor configured model defaults for spawned agents (#33631)
## What changed

- Apply `agents.default_subagent_model` and
  `agents.default_subagent_reasoning_effort` when a spawn request does not
  provide explicit values, including agent job workers.
- Allow full-history forks to use configured defaults or explicit model and
  reasoning-effort overrides while retaining the parent conversation context.
- Preserve the selected model and reasoning effort when an agent role does not
  override them.

## Testing

- Cover configured defaults, explicit override precedence, full-history forks,
  role application, and agent job workers.

GitOrigin-RevId: b1efa8c9abeee82355088fceef57560433144595
2026-07-16 16:08:43 +00:00
jif 9ff47868eb Expose spawn agent types only when roles are configured (#33572)
## Why

The `agent_type` argument is only useful when agent roles are configured. Avoid
advertising an inapplicable override in the model-visible `spawn_agent` schema.

## What changed

- Include `agent_type` in the V1 and V2 spawn tools only when configured roles
  are available.
- Clarify that `agent_type` is an explicit override and document its interaction
  with context forking.
- Remove the unused `agents.support_agent_type` configuration field.

## Testing

- Add coverage for hiding `agent_type` without roles and exposing it when a role
  is configured.

GitOrigin-RevId: 32e0f123b15f317e9cdb71774029375bc073d9ad
2026-07-16 10:28:36 +00:00
jif 03bb3b1236 Unify multi-agent settings under agents (#33550)
## What changed

- Add `agents.enabled` as a user override for multi-agent tools while keeping an enabled `features.multi_agent_v2` authoritative.
- Rename the shared spawned-thread limit to `agents.max_concurrent_threads_per_session`, retain `agents.max_threads` as an alias, and apply the setting to both multi-agent backends.
- Add reserved subagent model, reasoning effort, and agent-type settings to the config surface and persist all resolved agent settings in config locks.
- Show the resolved `[agents]` values in TUI debug-config output.

## Testing

- Cover config loading, legacy alias normalization across merged layers, backend-selection precedence, V2 concurrency, and debug output.

GitOrigin-RevId: 2957c954a2e1aef51592768dbbccd56c4bf8f118
2026-07-16 09:00:51 +00:00
Eric Traut 2edad72de3 Track prompt cache write token usage (#33454)
## What changed

- Parse `cache_write_tokens` from response input token details and carry it through token usage aggregation.
- Expose `cache_write_input_tokens` in protocol, app-server, exec, and TypeScript SDK usage events, defaulting it to zero for compatibility with older payloads.
- Report cache-write usage in analytics, metrics, traces, and rollout data alongside existing cache-read usage.

## Testing

- Add coverage for response parsing, usage event output, aggregation, analytics, metrics, and telemetry fields.

GitOrigin-RevId: 634e4fbe3086a8923c0ee13b622573e7d9d221bd
2026-07-16 00:22:53 +00:00
charlesgong-openai 7d1218a997 Add external agent memory migration (#33444)
## What changed

- Add a feature-gated `MEMORY` migration item to the app-server protocol and TUI.
- Discover project memory Markdown files, preserve their project scope, and copy selected projects into the Codex memory extension workspace.
- Detect changed, renamed, and removed source projects, report per-project import failures, and enqueue memory consolidation after workspace changes.

## Testing

- Cover memory discovery, selection, synchronization, scope validation, feature gating, protocol results, and TUI rendering.

GitOrigin-RevId: 9b17b2e9a639a064dba8aaffbec6345ae419018e
2026-07-15 22:49:52 +00:00
charlesgong-openai 1c4af96394 Add Cursor support to setup import (#33426)
## What changed

- Detect and import supported Cursor settings, sandbox permissions, MCP servers,
  project instructions, hooks, agents, commands, plugins, and recent chat
  sessions.
- Update the `/import` flow to check Claude Code and Cursor, prompting for a
  source when both have importable data.
- Add `migrationSource` to the app-server detect and import requests so each
  operation uses the selected adapter, while retaining `source` for import
  attribution and backwards compatibility.

## Testing

- Add coverage for Cursor config conversion, hooks, plugins, session discovery
  and conversion, app-server imports, and TUI source selection.

GitOrigin-RevId: a65a1511b6c1c2f9e3e0cfe4f816bb435807282e
2026-07-15 21:03:49 +00:00
jif 38b064c31b Render TUI prompts before submitting user turns (#33373)
## Why

Starting a user turn can wait on remote work. Show the submitted prompt immediately instead of leaving the input invisible during that wait.

## What changed

- Queue optimistic prompt history before app-event submissions and render a frame before starting the turn.
- Preserve the existing submit-failure behavior for direct submissions.

## Testing

- Verify that an initial prompt is added to history before its user-turn event is submitted during session replay.

GitOrigin-RevId: 57f30c6e0067127e6b082a206f7d154fcfef8d7d
2026-07-15 16:24:09 +00:00
Owen Lin da61f7d8e1 Enable paginated thread history in app-server (#33364)
## What changed

- Allow `thread/start` to select experimental `historyMode: "paginated"` when the thread store supports turn and item pagination.
- Resume paginated threads with bounded model context and require `excludeTurns: true` instead of loading full history.
- Return `turnsBackwardsCursor` and `itemsBackwardsCursor` from `thread/resume` so clients can hydrate durable history through `thread/turns/list` and `thread/items/list` while newer records arrive through live notifications.
- Reject operations that still require full history, including `initialTurnsPage`, `thread/read` with `includeTurns: true`, `thread/rollback`, and detached review.
- Make item cursors independent of the optional `turnId` filter.

## Testing

- Cover paginated thread start, cold and live resume, backwards cursor hydration, metadata reads, unsupported operations, and stores without pagination support.

GitOrigin-RevId: c42f9b268e29d049843330f474fa3ecde12f5b8a
2026-07-15 15:29:13 +00:00
sayan-oai 3afbd8dd45 Report selected environment connection transitions (#33251)
## What changed

- Track connected and disconnected states across initial remote exec-server connections and reconnection attempts.
- Emit experimental `thread/environment/connected` and `thread/environment/disconnected` app-server notifications for each thread selecting the environment. Each payload identifies the thread and environment; current state is not replayed when a thread starts.
- Stop forwarding connection events when an environment selection is removed or replaced.

## Testing

- Cover connection, disconnection, reconnection, shared-environment notifications, and replacement of a selected environment.

GitOrigin-RevId: 5dd767372363c4a2a8319fc16164be117d5bd20c
2026-07-15 05:21:13 +00:00
Charlie Marsh fca51f6daf Render TUI composer tabs as single-column spaces (#33239)
## Why

Tabs in composer text could render at a different width from the cursor and
wrapping calculations, causing misaligned cursors and unexpected line breaks.

## What changed

- Replace tabs with single-column spaces for wrapping and rendering while
  preserving the original editable text and byte ranges.
- Apply the same display representation to base text, styled elements, and
  highlighted ranges.

## Testing

Add coverage for cursor alignment, rendered output, and wrapping of text that
contains tabs.

GitOrigin-RevId: 06d8489621d2f8b0823c7a004079d152dd0cab66
2026-07-15 04:17:40 +00:00
Charlie Marsh b556ce3fec Fix skill completion around bound mentions with suffixes (#33237)
## What changed

- Use `$`-mention boundary rules when deciding whether a skill mention followed by a suffix is already bound.
- Fall back to the editable skill token on the left when the token on the right is a bound mention such as `$bound/path` or `$bound.config`.

## Testing

- Add completion-target coverage for path and configuration suffixes.
- Add a composer snapshot covering the skill popup fallback for a bound path suffix.

GitOrigin-RevId: bf72237dfd56cfe6f590a3fab10c2bfe03b088a8
2026-07-15 04:13:44 +00:00
Charlie Marsh b6f1cfa3f3 Disambiguate skill mentions from shell parameters (#33232)
## Why

Skill mentions and shell parameters both use a `$` prefix. Numeric and special
shell parameters should not open or displace completion popups, while loaded
skills can legitimately have digit- or hyphen-leading names.

## What changed

- Classify `$` queries as skill candidates, shell variables, definite shell
  parameters, or ambiguous shell-like names.
- Offer completion for an ambiguous name only when it fuzzy-matches a bindable
  loaded mention, reusing the filtered catalog when the popup opens.
- Keep definite shell forms such as `$1`, `$12`, `$-`, and `$_` out of mention
  completion and preserve completion targets elsewhere in the composer.

## Testing

Added unit and snapshot coverage for positional and special parameters,
digit- and hyphen-leading skills, uppercase shell variables, unbindable
qualified skills, and competing completion targets.

GitOrigin-RevId: 8bb64cb5ca0fa8233c7fadb11a53678d57eb814c
2026-07-15 04:04:17 +00:00
Felipe Coury d88db19144 Preserve thread context when retrying or editing turns (#33211)
## What changed

- Add experimental `beforeTurnId` support to `thread/fork` for copying history strictly before a turn, including an in-progress turn.
- Use before-turn forks for TUI backtracking and safety retries so the replacement prompt retains thread context instead of recreating the branch from the preceding turn or a new thread.
- Add experimental `deferGoalContinuation` support so safety-retry forks can inherit an active goal while waiting for the replacement turn before automatic continuation resumes.
- Hide duplicated nested-review prompts when replaying history or selecting a prompt to edit.

## Testing

- Cover before-turn truncation, fork validation, active-goal inheritance, TUI safety retries, backtracking, and nested-review replay.

GitOrigin-RevId: 4915d85ae1929a0b8c40f3ed7dca29c7a5bdcdf3
2026-07-15 02:35:49 +00:00
Felipe Coury 9cddda7556 Retry safety-buffered turns on a forked thread (#33207)
## Why

Retrying a safety-buffered turn by rolling back the active thread rewrites the
source conversation and requires the TUI to repair its local transcript state.

## What changed

- Interrupt the buffered turn, then fork after the preceding completed turn and
  submit the prompt on the new thread with the faster model and low reasoning
  effort.
- Start a new thread when the buffered request is the conversation's first turn.
- Preserve committed steering input in the retry, leave the source thread
  intact, and restore the prompt alongside any existing draft if branching
  fails.
- Do not offer the retry action for side conversations or stale and in-progress
  turns.

## Testing

Added coverage for retries with prior context, first-turn retries, committed
steering input, branch failures, existing composer drafts and attachments, and
side conversations.

GitOrigin-RevId: adb49da8236e9212ef0082e033e6f715986b5cd9
2026-07-15 02:03:46 +00:00
Felipe Coury 77a3f4e80f Preserve in-flight state when restoring thread input (#33203)
## What changed

- Add an explicit restore mode for thread input snapshots and use it when replaying thread snapshots.
- Preserve the pending-steer interrupt flag alongside running-turn and queued-input state when restoring an in-flight turn.
- When in-flight state is not preserved, clear stale running flags and move pending steers ahead of already queued follow-ups while retaining their history records.

## Testing

- Expand TUI tests to cover both restoration modes, including sleep-inhibitor state, pending-steer ordering, history records, and queued submission.

GitOrigin-RevId: f4e8b2bdf065ef6c6644b7f0ea9cf32c8a9af619
2026-07-15 01:47:39 +00:00
Felipe Coury 469ce0db51 Branch conversations when editing earlier TUI prompts (#33201)
## What changed

- Fork the conversation immediately before the selected prompt instead of rolling back the current thread in place, preserving the original conversation.
- Reopen the selected prompt in the new conversation with its images, text elements, and mention bindings intact.
- Start a fresh conversation when editing the first prompt, show a dedicated continuation notice, and restore the prompt with an error if branching fails.

## Testing

- Cover branching before first and later prompts, source preservation, prompt restoration, hidden review prompts, mid-turn steering, in-progress turns, stale transcript entries, and mention bindings.

GitOrigin-RevId: 15473535b3f9733b0300711a498969e6d389db79
2026-07-15 01:36:44 +00:00
Felipe Coury 70a0b1eef8 Keep interrupted prompts in conversation history (#33198)
## What changed

- Leave an output-free interrupted prompt in the transcript and open a blank
  composer for the user's next instruction.
- Use the normal interruption notice for both `Esc` and `Ctrl-C` interrupts.
- Track safety-buffering prompts separately so failed retries can still restore
  the prompt, including after switching between threads.

## Testing

- Cover output-free `Esc` and `Ctrl-C` interrupts, failed safety-buffer retries,
  and restoration of safety-buffer state from thread snapshots.

GitOrigin-RevId: 30b368d00dfdb981d06d4c95ce3f252389b7917c
2026-07-15 01:07:29 +00:00
stefanstokic-oai 4df8027a97 Honor workspace spend controls in rate-limit handling (#33187)
## Why

Sparse and out-of-order rate-limit updates can omit account metadata or let an
older full read overwrite a newer workspace hard stop. Credit availability also
does not always include a displayable balance.

## What changed

- Propagate the backend's `spendControlReached` state through rate-limit
  snapshots and the app-server protocol, preserving it across sparse updates.
- Keep workspace hard-stop classifications for error routing and ignore stale
  full-read results after a newer hard-stop notification.
- Base TUI warnings and model-switch prompts on credit availability and hard-stop
  state, and show `Credits: Available` when a finite balance is hidden.

## Testing

Added coverage for spend-control mapping, snapshot merging, out-of-order reads,
workspace error routing, warning and prompt behavior, and credit status display.

GitOrigin-RevId: 18b09d493d5a620a7c079fb721ec50b38dd5b04c
2026-07-14 22:43:26 +00:00
charlesgong-openai 3fae30dd85 Preserve plugin install failure subtypes during imports (#33182)
## What changed

- Add `subErrorType` to external agent config import failures and carry it through progress and completion notifications, persisted import histories, and analytics.
- Expose plugin store failure subtypes from `PluginInstallError` so manual installs and imported plugins report details such as `failed_to_copy_plugin_file` while failures without a subtype remain `null`.
- Keep existing persisted import records compatible by defaulting the new field when it is absent.

## Testing

- Cover store I/O subtype extraction, analytics serialization, persisted import histories, and migration notification fixtures.

GitOrigin-RevId: ec1a85623fc826cbd7cfe9f55c2dd2bc86665937
2026-07-14 22:21:27 +00:00
Sergio Mattei c38c30ef51 Migrate GPT-5.4 uses to GPT-5.6 variants (#33173)
## What changed

- Hide `gpt-5.4` and `gpt-5.4-mini` from model selection and direct existing users to `gpt-5.6-terra` and `gpt-5.6-luna`, respectively.
- Use Terra for memory consolidation and Luna for memory extraction and rate-limit switch prompts.
- Keep Amazon Bedrock GPT-5 catalog entries visible when their bundled model metadata is hidden.

## Testing

- Add coverage that all Amazon Bedrock GPT-5 models remain visible and update TUI expectations for the new model choices.

GitOrigin-RevId: fd69c8d5fb6b510c77204df6b7ac3f07e67cded2
2026-07-14 21:50:19 +00:00
pakrym-oai 5d325ba223 Move sleep items to the extension-owned lifecycle path (#33159)
## What changed

- Define `SleepItem` in `codex-extension-items` and carry `clock.sleep` events through `TurnItem::Extension`.
- Preserve sleep persistence, thread-history reconstruction, and the app-server's `type: "sleep"` schema while reusing the extension-owned type.

## Testing

- Add serialization coverage for the `clock.sleep` extension wire shape and its protocol wrapper.
- Update sleep lifecycle and thread-history tests to exercise the extension-owned item.

GitOrigin-RevId: 34bb33ed9b90a09bf4744aafdb56e019c717a168
2026-07-14 21:01:54 +00:00
Adam Perry @ OpenAI 0396f99cf1 Preserve special filesystem subpaths as wire strings (#33107)
## Why

Special filesystem subpaths can contain relative or foreign-platform path
spellings. Treating this wire text as a host-native path can reinterpret it.

## What changed

- Store special filesystem subpaths as strings in the core permissions model.
- Represent app-server subpaths as `LegacyAppPathString` and convert them at
  the protocol boundary without changing their spelling.
- Add `LegacyAppPathString::from_string` for callers that already own legacy
  app-server path text.

GitOrigin-RevId: 2214f03aa997fd0e6eb2ab60d425304bb4bd6132
2026-07-14 16:40:13 +00:00
rakan-oai fca8c00f11 Fix TUI status visibility around streamed output (#33105)
## What changed

- Hide the working-status indicator when finalized assistant output is committed to the transcript, including single-line final answers.
- Restore the indicator when image generation begins during a running task after its streamed preamble has been flushed.

## Testing

- Add snapshot coverage for a single-line final answer and for image generation following a single-line preamble.

GitOrigin-RevId: e294a11cda3f0ce46f2bbed1be2a1380c9c73085
2026-07-14 16:29:54 +00:00
rakan-oai effd58d750 Preserve streamed output during capped history replay (#33093)
## Why

Stream consolidation can replace transcript cells while initial history replay is buffering capped display rows, leaving those rows stale and omitting the finalized output.

## What changed

- Discard buffered rows when required stream reflow occurs during capped initial replay and rebuild the capped tail from the canonical transcript after replay finishes.
- Schedule the rebuild through the resize reflow path so it waits for an active transcript overlay to close.

## Testing

Added coverage for consolidated Markdown output during capped initial replay, both with and without an active transcript overlay.

GitOrigin-RevId: 1c184ff561a50362daf11c1c629be59882f27a4a
2026-07-14 15:27:45 +00:00
Shijie Rao d7ba5ff955 Always confirm before enabling full access (#32989)
## Why

Full access significantly increases the risk of data loss, leaks, or unexpected behavior, so users should explicitly confirm each time they select it.

## What changed

- Always open the full access confirmation when user-reviewed approvals are active, regardless of `notices.hide_full_access_warning`.
- Remove the persistent "don't ask again" option and its acknowledgement events.

## Testing

- Update the TUI permission tests and confirmation popup snapshot to cover repeated confirmation.

GitOrigin-RevId: 0ee827332441e13d9445349ed6a5a92dc8fef4b2
2026-07-14 06:55:29 +00:00
Dylan Hurd 1c9f890c05 Expose exact per-response usage in raw app-server events (#32985)
## Why

Clients that account for individual upstream Responses API calls need the exact
usage for each completion rather than accumulated or estimated thread usage.

## What changed

- Add the opt-in `rawResponse/completed` app-server notification with the
  `threadId`, `turnId`, `responseId`, and upstream `usage` payload.
- Emit the transient event for normal turns and compaction requests when
  `experimentalRawEvents` is enabled. The event is not persisted or replayed,
  and `usage` is `null` when the upstream response omits it.
- Export the notification in the app-server schemas and document its behavior.

## Testing

- Cover exact token breakdowns for turn and compaction completions.

GitOrigin-RevId: 49040a060bf1784c1ff1dd62112efb4a778428c4
2026-07-14 06:39:42 +00:00
stevenlee-oai fb350d1e7d Attach connector caches to diagnostic uploads (#32891)
## What changed

- Include the active Codex Apps tools cache and connector directory cache, when available, in diagnostic uploads that include logs.
- Resolve cache paths from the current authentication context and use stable attachment filenames.
- List both optional cache files in the upload consent dialog.

## Testing

- Add coverage for selecting existing active cache files, including a directory cache without an account ID.
- Update consent dialog snapshots to include the optional attachments.

GitOrigin-RevId: 1d4ffbf2bcb96653f03dc25f91d80dd65038d585
2026-07-13 22:50:28 +00:00
charlesgong-openai bc8222b8d9 Prepare external agent migration for source adapters (#32884)
## What changed

- Add an optional `source` selector to `externalAgentConfig/detect`, while preserving the existing behavior for omitted, `null`, and unrecognized values.
- Pass `claude-code` as the source for TUI detection and import requests.
- Move source-specific migration behavior behind an adapter boundary and consolidate session migration into `codex-external-agent-migration`.

## Testing

- Cover explicit, omitted, and unknown detection source values with app-server protocol tests.
- Add unit coverage for the extracted migration and hook helpers.

GitOrigin-RevId: 63bd3dcb485f3ad7bd996022db4e351506aeea77
2026-07-13 22:15:55 +00:00
Charlie Marsh bbe93d3e5f Persist slash-command popup dismissal (#32858)
## What changed

- Make `Esc` dismiss the slash-command popup immediately without changing the draft or interrupting a running task.
- Keep the popup closed while the first-line command token is unchanged, and reopen it after the token is edited.

## Testing

- Cover dismissal while idle and while a task is running.
- Add a snapshot confirming that the dismissed popup remains hidden.

GitOrigin-RevId: f0ee84af080181e8d92c435f474ded1c8cb5b457
2026-07-13 19:08:11 +00:00
jif 92938d880e Restrict spawned-agent models to the active backend (#32751)
## Why

Model overrides for `spawn_agent` must be compatible with the multi-agent backend used by the current turn.

## What changed

- Carry each model's multi-agent backend metadata into `ModelPreset`.
- Filter the advertised `spawn_agent` model overrides for multi-agent v2 and reject overrides assigned to another backend.
- Limit error suggestions to picker-visible, backend-compatible models.

## Testing

Added coverage for hiding incompatible models from the tool description and rejecting them during spawn validation.

GitOrigin-RevId: 22c12aba67df46e9743a74f019b72a1b8b76b308
2026-07-13 09:52:27 +00:00
Felipe Coury 769a5de257 Make advanced reasoning selection explicit in the TUI (#32746)
## Why

`Max` and `Ultra` consume usage limits faster than standard reasoning levels, so they should not be selected accidentally while navigating the normal effort scale.

## What changed

- Move `Max` and `Ultra` behind a `More reasoning…` entry with a dedicated warning and descriptions.
- Keep the reasoning shortcuts from silently increasing into advanced efforts.
- Apply `Ultra` to the active conversation without changing defaults for new threads, while preserving it across mode switches and thread resumes.
- Record applied thread settings in thread metadata, including explicit clearing of reasoning effort, so resumed threads restore their latest model settings unless the user supplied an override.

## Testing

- Add TUI coverage for the advanced picker, shortcuts, Plan mode, configuration defaults, and resumed conversations.
- Add app-server and thread-store coverage for persisting, clearing, and restoring model and reasoning settings.

GitOrigin-RevId: 6708c7c2e8d38f491bf63000ea34f83476afdfe6
2026-07-13 09:40:51 +00:00