Commit Graph

8374 Commits

Author SHA1 Message Date
pakrym-oai
4d4879ac10 Reduce environment sandboxing to permission profiles 2026-07-20 13:44:00 -07:00
pakrym-oai
2e5153cf4b Make sandbox settings environment-owned 2026-07-20 12:11:25 -07:00
Felipe Coury
bd92b056dd Ignore inherited ACEs when refreshing Windows write roots (#34392)
## Why

An inherited `FILE_DELETE_CHILD` grant can make a write root look stale, but
`SET_ACCESS` cannot replace an ACE inherited from an ancestor. Treating that
grant as explicit causes unnecessary ACL refresh attempts that cannot converge.

## What changed

- Add explicit-ACE filtering to the Windows DACL permission checks.
- Refresh a write root only when `FILE_DELETE_CHILD` is present in an explicit
  allow ACE, while retaining effective-permission checks for required rights.
- Ignore inherited stale rights when deciding whether `SET_ACCESS` must repair
  an allow ACE.

## Testing

Add a Windows regression test covering a write root that inherits
`FILE_DELETE_CHILD`, verifying that repeated refresh checks leave its explicit
write ACE unchanged.

GitOrigin-RevId: d0df9429efcf299da3ff3c1bce92942684803293
2026-07-20 18:28:02 +00:00
Charlie Marsh
45ac251e17 Use copy-on-write storage for history snapshots (#34390)
## Why

Cloning a `ContextManager` deep-copies every `ResponseItem`, even when callers only need a read-only history snapshot.

## What changed

- Store history items in an `Arc<Vec<ResponseItem>>` so cloned snapshots share their items until one is mutated.
- Reuse an owned vector when consuming an unshared snapshot and clone it only when other snapshots still reference it.
- Estimate session token counts from a snapshot after releasing the session-state lock.

## Testing

Added a regression test that verifies cloned histories share their backing items before mutation and diverge without affecting each other afterward.

GitOrigin-RevId: 24605888209ae9ff78cadb04d9c36463f7e2dbe0
2026-07-20 18:03:12 +00:00
Alex Daley
6bf4845b60 Route Codex Apps MCP through plugin service (#34389)
## What changed

- Point the default Codex Apps MCP server at `ps/mcp` instead of the legacy Apps endpoint for both `backend-api` and `api/codex` base URLs.
- Use the same server configuration for Codex Apps and the hosted plugin runtime.
- Update MCP integration tests and test-server routing to expect the plugin-service path.

GitOrigin-RevId: 939f20dcff67ba6f79c11b328bfc624b25e3aac2
2026-07-20 17:55:58 +00:00
Dylan Hurd
5a4f5ee64c Refresh bundled model metadata (#34387)
## What changed

- Add personality instruction variables for the GPT-5.6 model variants.
- Add the GPT-5.5 availability notice.
- Remove the `auto_review` and `permissions` message fields and the legacy `supports_reasoning_summary_parameter` flag from the bundled catalog.

GitOrigin-RevId: 426b0735a78232d2f658e0124db7c45889d08286
2026-07-20 17:47:49 +00:00
Owen Lin
2793c826e8 Enable memories for paginated threads (#34386)
## Why

Paginated threads keep metadata updates in SQLite, while their rollout retains the initial `memory_mode`. Reconciliation could therefore overwrite the current setting with a stale value, and memory processing excluded these threads entirely.

## What changed

- Include paginated threads in stage 1 memory job selection and global memory output lookup.
- Preserve the SQLite `memory_mode` when reconciling or backfilling an existing paginated thread, while continuing to seed missing rows and restore legacy threads from rollouts.
- Omit `memory_mode` alongside Git metadata when flushing resumed paginated history.

## Testing

Added coverage for preserving disabled memory mode during reconciliation and backfill, selecting eligible paginated threads, and omitting initial metadata on paginated resume.

GitOrigin-RevId: 2a6e16068e69680728757fbec27aeefae45b8110
2026-07-20 17:41:33 +00:00
nhamidi-oai
6f785632b0 Preserve audio across history and tool outputs (#34385)
## Why

Audio attachments could be dropped from tool outputs and reconstructed thread history, while inline base64 payload size could overstate their model context cost.

## What changed

- Preserve remote and local audio attachments in legacy user-message events and thread history.
- Keep audio from function and custom tool outputs when the model supports it and the output fits the truncation budget; otherwise replace it with an omission marker.
- Estimate inline audio cost from its duration, with a serialized-size fallback for malformed or unsupported data URLs, so compaction and truncation use model-visible cost instead of raw base64 size.
- Replace audio in messages and tool outputs with an explanatory placeholder for models without audio input support.

## Testing

Add coverage for history round trips, dynamic tool responses, modality filtering, duration-based context estimates, output-budget truncation, and remote compaction.

GitOrigin-RevId: 5ed4628850a668f8383b7cd73db71b144cc02cd1
2026-07-20 17:36:44 +00:00
Michael Bolin
692a0fb7e5 Update packaged ripgrep to 15.2.0 (#34384)
## What changed

- Point the packaged `rg` manifest at ripgrep 15.2.0 archives for all
  supported macOS, Linux, and Windows targets.
- Update each archive's size, SHA-256 digest, and executable path.

GitOrigin-RevId: 6dcfa4fe40597a7591b8413e330d27e6b0b86627
2026-07-20 17:32:25 +00:00
jif
b00c9b2e16 Mark multi-agent v2 as stable (#34383)
## What changed

- Classify `multi_agent_v2` as stable while keeping it disabled by default.
- Exclude structured `multi_agent_v2` configuration from under-development feature warnings.

## Testing

- Update the warning-event test to verify that only the remaining under-development feature is reported.

GitOrigin-RevId: 12cb661dde9bc7b5aeae2f83476cb5ff75e0c959
2026-07-20 17:27:23 +00:00
Owen Lin
19b2273d8a Keep paginated thread Git metadata in SQLite (#34382)
## Why

Paginated rollouts contain only the initial Git metadata tuple. Reusing that
tuple during later reads, reconciliation, or resume can overwrite newer SQLite
values and undo explicit field clears.

## What changed

- Treat SQLite as authoritative for Git metadata once a thread is paginated.
- Apply paginated Git metadata patches directly to SQLite without appending
  compatibility metadata to the rollout.
- Preserve explicit null values when reading by rollout path or reconciling the
  initial session metadata, and ignore the initial Git tuple during resume.

## Testing

Added coverage for updating and clearing paginated Git metadata, preserving the
result through reconciliation and rollout-path reads, and avoiding stale Git
metadata updates on resume.

GitOrigin-RevId: 4d3e68cb24965b93d337d923092a98bac9b352b5
2026-07-20 17:23:18 +00:00
Charlie Marsh
6b9a5592a6 Avoid cloning Responses WebSocket payloads (#34381)
## Why

Building a Responses WebSocket request copied the model, instructions, input
history, tools, and other request settings into a second payload before
serialization.

## What changed

- Make `ResponseCreateWsRequest` borrow shared fields from
  `ResponsesApiRequest`.
- Keep only WebSocket-specific fields owned, and allocate a separate input
  vector only for incremental continuations.
- Restore response item IDs after preparing a full request so the request
  retained for continuation matching keeps its original state.

## Testing

Update the serialization test to verify that the borrowed WebSocket request
produces the same wire payload as the Responses API request plus its
WebSocket-specific fields.

GitOrigin-RevId: b63d746b7f5164b5204ab95b057c914a4aeb71e1
2026-07-20 17:18:25 +00:00
rka-oai
8431dc590a Stop retrying turns with invalid tool images (#34380)
## What changed

Remove the fallback that replaced image content in the latest tool output with
`Invalid image` and retried the model request. Invalid-image responses now use
the existing bad-request error path without modifying conversation history.

GitOrigin-RevId: f4ea782f16c5451feb261694caa73b77f24c3e4e
2026-07-20 16:57:03 +00:00
Won Park
7e51abbbd1 Avoid rendering generated images twice (#34378)
## What changed

- Tell the model that generated images are already displayed to the user and should not be repeated as Markdown images or file links.
- Keep generated-image artifact paths and output hints owned by the image generation extension.
- Centralize the availability check for the image generation tool across feature, provider, namespace-tool, model modality, and authentication requirements.

## Testing

- Verify artifact paths sanitize session and call identifiers.
- Verify the model-facing output hint reports that the generated image is already displayed.

GitOrigin-RevId: 6c865b6a96d6a71bb2c33246d1518a00e7c8b840
2026-07-20 16:47:03 +00:00
keith thornhill
9a7e823e5b Extend second-based latency histogram buckets (#34375)
## Why

Requests longer than 10 seconds were grouped into the overflow bucket, limiting visibility into long-running request latency.

## What changed

Add second-based duration histogram boundaries at 12, 15, 20, 30, 60, and 120 seconds.

## Testing

Extend the duration histogram test to cover every new boundary and a 121-second overflow value.

GitOrigin-RevId: 063a5d397dbd37d3b3940c7a1632b7b479e874a4
2026-07-20 16:25:57 +00:00
Eric Traut
5c18cc0acc Clear stale Guardian reviews when turns end (#34371)
## Why

Pending Guardian review state could outlive an interrupted or completed turn,
leaving stale review details visible during a following goal turn.

## What changed

- Clear pending Guardian reviews during both turn completion and finalization.
- Restore an active MCP startup header after cleanup, falling back to `Working`
  when no MCP server is starting.

## Testing

Added coverage for interrupted and completed turns, including goal continuation
and overlapping MCP startup status.

GitOrigin-RevId: a15ed81a5d6005e9294089f4424a8dedbc6e9cb5
2026-07-20 16:05:14 +00:00
felixxia-oai
b6de5b524c Use app-server skill metadata directly in the TUI (#34368)
## Why

The TUI already receives skill metadata from the app-server protocol, but converted it into the core-skills model before using it.

## What changed

- Use `codex_app_server_protocol::SkillMetadata` throughout skill toggles, mentions, and input submission.
- Remove the protocol-to-core conversion and the TUI's `codex-core-skills` dependency.

GitOrigin-RevId: 43d43d74bfb67fc21ef11a0ca0592aa44b89a122
2026-07-20 15:44:37 +00:00
Charlie Marsh
28aacbb9d9 Avoid cloning hyperlink text during TUI rendering (#34366)
## What changed

Add a borrowed `Line` conversion and use it when rendering and measuring
hyperlink-aware history and pager content. This preserves line styling and
alignment while avoiding clones of the underlying span strings.

GitOrigin-RevId: c9cd6ff5ec63cd29719ea2ae51acede7364f2bd8
2026-07-20 15:39:31 +00:00
Felipe Coury
f944456d81 Animate Max and Ultra reasoning effort changes (#34365)
## What changed

- Add one-shot composer and status-line transitions when the active reasoning effort changes to Max or Ultra.
- Keep a tier-specific prompt accent after the transition, including a distinct Ultra prompt glyph.
- Preserve drafts and footer priority, avoid replaying effects for restored or unchanged settings, and disable motion when animations or sufficient terminal color support are unavailable.

## Testing

- Add unit and snapshot coverage for animation frames, prompt accents, status-line transitions, narrow layouts, terminal palettes, restored sessions, and reduced-motion behavior.

GitOrigin-RevId: 6da1d501d228d0cf1144b3d211d5d1304a06f447
2026-07-20 15:35:12 +00:00
Charlie Marsh
1e20272fa5 Avoid cloning thread history for token usage replay (#34361)
## What changed

- Resolve the turn ID for restored token usage before sending resume and fork responses, avoiding a clone of the full thread history.
- Add `ThreadHistoryBuilder::active_turn_id` so attribution can inspect the active turn without materializing its items.
- Stop history reconstruction at the latest persisted `TokenCount` and verify that a later tail turn does not receive the replayed usage.

GitOrigin-RevId: 69c4a9fe04770d1a938470afc933431e61670094
2026-07-20 14:52:42 +00:00
Charlie Marsh
ef6b597f41 Keep streamed command output bounded in the TUI (#34359)
## Why

Large command streams, including commands that never emit a newline, can make an active TUI cell grow without bound.

## What changed

- Retain live output in full up to 1 MiB, then preserve the first and last 50 completed lines plus the current partial line.
- Bound individual long lines while preserving UTF-8 boundaries, visible head and tail content, and ANSI rendering around omission markers.
- Show omitted line and byte counts in previews and transcripts. Final command output still replaces the bounded live preview when execution completes.

## Testing

Added unit and snapshot coverage for chunk boundaries, split CRLF sequences, newline-free and UTF-8 output, truncated ANSI sequences, retained-output limits, and preview and transcript rendering.

GitOrigin-RevId: 3cf3cc862db686f20ac09b1f6e7f9dc6d264e6eb
2026-07-20 14:44:25 +00:00
Charlie Marsh
20440a0833 Render streamed command output through preview iterators (#34357)
## What changed

- Encapsulate aggregated command output behind APIs for total and retained line
  counts, reversible preview iteration, and full transcript iteration.
- Build truncated command previews from the retained head and tail lines while
  preserving the logical omitted-line count.
- Cover head/tail rendering for long streamed agent and user-shell output.

GitOrigin-RevId: 54b23a19e4639e24c5e4778082edbbc6484ecf80
2026-07-20 14:27:39 +00:00
Charlie Marsh
2661d8577e Parallelize TUI bootstrap requests (#34355)
## Why

During TUI startup, `hooks/list` holds the global config queue while an
uncached `model/list` request may also take time. Waiting for
`configRequirements/read` before submitting the model request prevents these
operations from overlapping.

## What changed

Submit `model/list` and `configRequirements/read` together during bootstrap so
the model fetch can overlap the config requests. Preserve the request-specific
error context and update the session state after both requests succeed.

GitOrigin-RevId: 69a866e6d2fd4798b914dd000456194f49fcfef6
2026-07-20 14:23:15 +00:00
Charlie Marsh
eceb3eeaf3 Cache TUI flex heights across frame passes (#34348)
## Why

Sizing, rendering, and cursor placement can query the same chat widget layout
multiple times in one frame, repeatedly measuring active transcript cells.

## What changed

- Build one chat widget renderable tree per frame and reuse it for sizing,
  rendering, and cursor placement.
- Cache each flex child's desired height by width for the lifetime of that tree.
- Reuse the bottom pane's renderable directly instead of forwarding each
  renderable operation through a wrapper.

## Testing

- Verify flex layouts measure a child once across frame passes and remeasure it
  when the width changes.
- Verify a chat widget frame measures its active transcript cell once.

GitOrigin-RevId: 5ad1a6711f4011c699b5d002b13dc3319cb4db8e
2026-07-20 13:58:17 +00:00
Charlie Marsh
ada5a79ddf Avoid cloning deferred TUI lifecycle payloads (#34347)
## What changed

- Move lifecycle and approval payloads into either the interrupt queue or the
  immediate handler instead of cloning them for both branches.
- Borrow MCP elicitation request metadata while constructing the corresponding
  form, and consume apply-patch changes after collecting notification paths.

## Testing

- Add a history replay test confirming deferred MCP start and completion events
  remain FIFO after streaming finishes.

GitOrigin-RevId: 84ed34f6ff173463a1da016dc140405392c0ba45
2026-07-20 13:54:11 +00:00
Charlie Marsh
2244d11a1d Track inline visualization directives during streaming (#34346)
## What changed

- Record when committed streaming content contains an inline visualization directive and keep using the canonical full-source renderer afterward.
- Restore directive state during full recomputes and clear it when the streaming renderer is reset.
- Cover directive tracking with and without visualization context, including a raw-to-rich render mode switch.

GitOrigin-RevId: 17786851d6dad6805240b79072fcbd0bb441874a
2026-07-20 13:50:06 +00:00
Charlie Marsh
221a341029 Remove unused Rust helpers (#34345)
## What changed

- Remove unused APIs and test helpers across the Rust workspace.
- Route Linux sandbox test setup through the shared exec request path.
- Drop dependencies that became unnecessary after the cleanup.

GitOrigin-RevId: 48fd9b2b1575bad7add0819786b4d8ec88d8486f
2026-07-20 13:45:29 +00:00
Charlie Marsh
86102db5a1 Reject unsupported history modes when loading rollouts (#34344)
## Why

The first session metadata record defines a rollout's history mode. If that
record uses an unsupported mode, skipping it as a parse error can cause later
metadata copied from fork history to be treated as canonical.

## What changed

- Validate session metadata history modes before deserializing rollout lines,
  while continuing to tolerate unknown modes in copied fork history.
- Simplify thread status registration to pass only the thread ID instead of a
  fully materialized `Thread`.

GitOrigin-RevId: 9de4313d4a76b279d32bb49b2016a4f5d07507c1
2026-07-20 13:39:29 +00:00
Anton Panasenko
2deed3fb9c Preserve zsh tied PATH exports in shell snapshots (#34293)
## Why

zsh prints tied scalar/array exports such as `PATH` and `path` with `-T`
metadata. The snapshot filter rejected that syntax, so commands available only
through the configured `PATH` could not be resolved from a restored snapshot.

## What changed

- Recognize writable tied exports and retain them in zsh shell snapshots.
- Skip readonly exports so restoring a snapshot does not make variables such as
  `PATH` immutable.

## Testing

Added macOS coverage for restoring a tied `PATH`, handling entries with spaces,
deduplicating path entries, excluding readonly tied exports, and resolving a
command available only through the restored snapshot.

GitOrigin-RevId: 297cfae3368230c7f6fe5ef84f0a10b35a2c802c
2026-07-20 08:29:12 +00:00
Won Park
bf3c1972b7 Migrate legacy exec policy allow rules (#34271)
## What changed

- On session startup, remove exact `allow` entries from `rules/default.rules`
  for command prefixes that Codex no longer suggests as policy amendments.
- Record the migration in `.sandbox_migration` so it runs only once, preserving
  rules created after the migration.
- Skip the migration when user and project exec policy rules are ignored.
- Expand the protected prefix list across shells, interpreters, package runners,
  and destructive or privilege-related commands.

## Testing

- Cover selective removal, case-insensitive matching, one-time behavior, and the
  startup path with ignored policy rules.

GitOrigin-RevId: a0c60e3f82b9630e621fd034b40462e3ab775102
2026-07-20 06:13:29 +00:00
Charlie Marsh
678157acaa Avoid redundant TUI subagent metadata requests (#34234)
## What changed

- Skip loaded-subagent backfills for fresh and forked threads, which cannot have pre-existing descendants.
- Keep the backfill after resuming a thread so agent navigation is populated immediately.
- Reuse thread status collected during backfill when opening the agent picker, avoiding duplicate `thread/read` requests while preserving liveness from live event channels.

## Testing

- Add a WebSocket-backed session lifecycle test that records app-server requests across fork, fresh-session, resume, and agent-picker flows.

GitOrigin-RevId: 604742b3cb495da12c97908d7a0ffa4ebc6a6da3
2026-07-19 21:39:58 +00:00
Charlie Marsh
a97ae65362 Remeasure dynamic cells in the transcript overlay (#34232)
## Why

The transcript overlay cached every committed cell's height. Cells whose content changes after insertion, such as refreshed status output or newly available visualizations, could outgrow that cached height and be clipped.

## What changed

- Let history cells declare whether their transcript height is stable, and remeasure dynamic cells on later overlay renders.
- Preserve cached heights for stable cells when appending a committed cell instead of rebuilding all renderables.

## Testing

- Cover status output growing after a rate-limit refresh.
- Cover a visualization link replacing its unavailable placeholder.
- Verify that appending a cell preserves cached measurements for stable cells.

GitOrigin-RevId: 03e7166cb94d7353c9b89bff8abb3b7ccb84a6bb
2026-07-19 21:34:05 +00:00
Brent Traut
5a208c1fc3 Persist names for paginated threads (#34229)
## Why

Paginated threads need explicit user-facing names to remain distinct from
derived titles and previews without requiring rollout metadata writes.

## What changed

- Add a nullable `name` column to persisted thread metadata and use it as the
  canonical name for paginated threads.
- Route paginated name updates through the state database while retaining the
  name index as best-effort compatibility data and preserving legacy thread
  behavior.
- Return persisted names when reading, listing, searching, and resuming
  paginated threads, and include them in state-database search matching.

## Testing

- Cover paginated name updates, reads, list/search results, and metadata-only
  resume behavior, including stale or unavailable compatibility data.

GitOrigin-RevId: 5ac4dfa2a83682b43d59ecc87e0f515580164dca
2026-07-19 21:13:13 +00:00
Charlie Marsh
7844386e3d Backfill completion items only for the active exec turn (#34226)
## Why

Multi-agent exec sessions can receive child `turn/completed` notifications on
the same event stream as the primary turn. Backfilling those unrelated
completions issues unnecessary `thread/read` requests.

## What changed

Run completion-item backfill only after a notification has been matched to the
primary exec thread and turn.

## Testing

Add an integration test that delivers a child completion before the primary
completion and verifies that only the primary completion triggers backfill.

GitOrigin-RevId: 46a41236ee6a39e4b341570ff4826a71fa02bb32
2026-07-19 20:36:18 +00:00
Charlie Marsh
c86b1be3cd Avoid cloning file changes in TUI diff rendering (#34224)
## What changed

- Consume and sort `DiffSummary` entries directly when building renderables.
- Borrow paths and `FileChange` values in the shared row representation used by line-based summaries.
- Share line-count calculation between both rendering paths.

GitOrigin-RevId: b02668074def7529ff39445e9970a1fec209f02b
2026-07-19 20:20:23 +00:00
Charlie Marsh
6a54efb76b Cache finalized Markdown history rendering (#34223)
## Why

Finalized Markdown can be rendered repeatedly at the same width while measuring and displaying transcript history.

## What changed

- Cache the latest rendered lines for finalized agent messages and proposed plans.
- Invalidate cached lines when the width, syntax theme, terminal colors, or color level changes.
- Keep visualization directives uncached because resolving their local files depends on current filesystem state.

## Testing

Add tests for cache reuse, render-state invalidation, raw Markdown rendering, and visualization cache bypass.

GitOrigin-RevId: ba08140041a229b8cb9d297de87dc7bb39ebfe5d
2026-07-19 20:16:35 +00:00
Charlie Marsh
d0516cfe4b Avoid buffering replay-irrelevant thread notifications (#34222)
## Why

Raw response items, realtime audio, and other notifications that the TUI does
not consume during replay can carry large payloads. Retaining them in each
thread's replay buffer wastes memory and can evict useful buffered events.

## What changed

- Skip replay buffering for notification types that are handled before routing
  or ignored during replay, while still updating turn and approval state.
- Borrow notifications when recording events for an active thread so routing
  does not require an extra clone.

## Testing

Add coverage that repeatedly sends large MCP progress and realtime audio
notifications and verifies that the replay buffer, pending approval, and active
turn state remain intact.

GitOrigin-RevId: 5b3414f1db7f3ae1feea4fe6c0275e4a7a1a4174
2026-07-19 20:12:27 +00:00
Charlie Marsh
854a82dbfd Track TUI command completion separately from output (#34218)
## Why

App-server command output deltas populate an exec cell before the command
finishes. Treating the presence of output as completion can therefore mark a
streaming command inactive too early and mishandle it when the turn is
interrupted.

## What changed

- Use the recorded duration, which is set when a command ends, as the exec
  call's completion marker.
- Preserve streamed output when marking unfinished calls as failed and render
  status lines only after completion.
- Keep a single aggregated output representation and render truncated output
  without collecting every line first.
- Append grouped exploration calls in place and coalesce adjacent reads while
  rendering without cloning the calls.

## Testing

- Add snapshots covering active streamed output, transcript output, and the
  resulting history entry after interruption.
- Add coverage for truncating newline-dense output.

GitOrigin-RevId: 420ac1e5fe1b9fcdbdaa5a8998f3e43a5b720254
2026-07-19 19:44:10 +00:00
Charlie Marsh
74bfbda9b5 Keep incremental rendering with visualization context (#34217)
## Why

Providing an inline visualization context forced every streamed Markdown update
to rerender the full response, even when the source contained no visualization
directives.

## What changed

- Preserve the stable rendered prefix when visualization context is available
  but no directive is present.
- Continue using canonical full rendering when the source contains a
  visualization directive.

## Testing

Added a regression test that verifies directive-free streams match full
rendering while advancing the stable source boundary.

GitOrigin-RevId: cd70d2ba052db822d474eba8619d04cedf4c0573
2026-07-19 19:37:14 +00:00
Charlie Marsh
aa982319c2 Speed up TUI Markdown layout (#34216)
## What changed

- Allocate Markdown table widths in bulk while preserving the existing column
  shrink priorities and balancing behavior.
- Reuse flattened styled-line data during adaptive wrapping and detect URLs
  across span boundaries.
- Remap wrapped terminal hyperlinks with a single forward scan.

## Testing

- Verify bulk table shrinking matches the previous one-cell-at-a-time results,
  including a token-heavy column with a million-character width.
- Cover URLs split across styled spans and multiple links on indented Unicode
  lines.

GitOrigin-RevId: 24a6fd6fdace6ca948e613d67c130a3a7f8d1a4e
2026-07-19 19:33:31 +00:00
Charlie Marsh
3e2f79727a Avoid retaining decoded MCP images in history cells (#34206)
## Why

The MCP image output cell only renders a fixed placeholder, so it does not need
to keep the decoded image alive for the lifetime of the history cell.

## What changed

Decode image content to validate it, then return a marker cell without storing
the resulting `DynamicImage`. The rendered history output remains unchanged.

GitOrigin-RevId: b2c12d08e8ba281d2bb993a8524d338c26d52b96
2026-07-19 17:36:39 +00:00
Charlie Marsh
54994582b1 Avoid cloning buffered TUI history lines (#34204)
## What changed

Make the hyperlink-aware history insertion helper accept a slice and borrow
pending history batches when flushing them. This avoids cloning each batch's
entire `Vec<HyperlinkLine>` before insertion.

GitOrigin-RevId: 0bc86c33e2f047c62de60b7642899c4aaa4bb6b8
2026-07-19 17:32:53 +00:00
Charlie Marsh
4d7a5c7c73 Avoid liveness races when starting side conversations (#34199)
## Why

The `thread/started` notification for a newly forked side conversation can arrive after the fork response. Selecting the side thread in that window could incorrectly report that it was unavailable.

## What changed

- Seed agent navigation from the side-fork response before selecting the new thread.
- Skip redundant liveness and parent-title reads for side threads that already have local state, while preserving liveness checks for uncached agent threads.

## Testing

- Cover side-thread selection before `thread/started` is delivered.
- Verify uncached threads are still checked and regular forks still resolve their parent title.

GitOrigin-RevId: 1f9fb0586db8094bf5a2624bc4e1de06c9a783a1
2026-07-19 16:59:12 +00:00
Charlie Marsh
78fd2f2b28 Start side conversations without replaying inherited turns (#34198)
## What changed

- Fork side conversations with `exclude_turns` so their initial UI starts empty instead of displaying the parent thread's turns.
- Keep regular fork responses unchanged, including for ephemeral threads.

## Testing

- Add coverage that compares regular and side-conversation forks of the same saved thread.

GitOrigin-RevId: 662607e9f588c20a2e06656deefa5b70bde19cd2
2026-07-19 16:54:58 +00:00
Charlie Marsh
3dd3c5d08a Use the Markdown collector as the streaming source of truth (#34197)
## What changed

- Return committed byte ranges from `MarkdownStreamCollector` so the streaming controller can render and scan the collector's source directly.
- Transfer the complete source out of the collector during finalization, preserving the final unterminated line while removing the controller's duplicate source buffer.
- Cover finalization of an empty collector and update streaming tests to validate the collector-backed source.

GitOrigin-RevId: 0aca912c53080267a2d12ad397e548641171942a
2026-07-19 16:50:54 +00:00
Charlie Marsh
9dc372fbaf Avoid cloning thread data when rendering transcripts (#34194)
## What changed

Make `thread_to_transcript_cells` consume its `Thread` so transcript rendering can
move owned turn items, message content, IDs, and plan text into history cells
instead of cloning them.

GitOrigin-RevId: 80200ba8928a3ea0e91cbff8a13dd00e21432426
2026-07-19 16:46:58 +00:00
Owen Lin
0fb559f0f6 Support legacy views for paginated thread history (#34085)
## Why

Clients that use full-history resume or request full items in turn pages should
work consistently across legacy and paginated threads.

## What changed

- Materialize complete turns and items from the paginated projection for
  `thread/resume` and `thread/turns/list` when requested.
- Support `initialTurnsPage` during paginated resume, including merging a live
  active turn while preserving the requested page size and cursors.
- Keep metadata-only resume behavior and backwards cursors available through
  `excludeTurns: true`.

## Testing

- Extend app-server coverage for full paginated history, full item views, and
  initial resume pages on running threads.

GitOrigin-RevId: e340f44d631ce135895c95d7e1baa7bfecd86e71
2026-07-19 00:01:51 +00:00
nhamidi-oai
643de86a19 Add audio output support to dynamic tools and code mode (#34080)
## What changed

- Add `inputAudio` content items to dynamic tool responses, app-server events, thread history, and generated protocol schemas.
- Add an `audio()` code-mode helper that accepts inline data URLs, audio URL objects, and MCP audio blocks.
- Convert MCP audio blocks into model input when audio is supported, and replace unsupported audio with an explanatory text item.
- Reject non-data audio URLs and track audio item counts in dynamic tool analytics.

## Testing

- Cover audio serialization, protocol round trips, thread-history conversion, MCP modality filtering, code-mode helper inputs, and invalid URL handling.

GitOrigin-RevId: 1ed52a8f9c62d4840fb71c5ec736b4a3566243d6
2026-07-18 23:22:13 +00:00
jiayuhuang-openai
312caf176a Seed realtime V3 sessions with initial text items (#34067)
## What changed

- Add an optional `initialItems` field to `thread/realtime/start` for seeding
  realtime V3 session history with `user`, `developer`, and `assistant` text.
- Encode the items in Frameless Bidi session bootstrap payloads for websocket
  and WebRTC transports while preserving existing payloads when the list is
  omitted or empty.
- Reject non-empty initial items for V1 and V2, more than 128 items, any item
  over 8,192 estimated tokens, or a combined total over 8,192 estimated tokens.

## Testing

- Cover protocol serialization, app-server forwarding, websocket and WebRTC
  payloads, empty-list compatibility, version checks, and size limits.

GitOrigin-RevId: 09af367f9a07543e3f8d59b7fa5387f932dc5a6a
2026-07-18 20:59:57 +00:00
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