fix(web): group image views like other tool calls - #9597
Merged
Conversation
Image views were forced out of tool groups and the settled-turn fold by leaving a bare path label that split every group for no benefit. Revert both so an image view is an ordinary read. Tell Codex and Claude to embed result images as markdown in their final response instead, which chat already renders inline. ACP providers and OpenCode expose no system-prompt input, so they are unchanged. Co-Authored-By: Claude Code <noreply@anthropic.com>
Contributor
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
Contributor
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — The PR changes default chat grouping/folding behavior and adds runtime directives to every provider's normal prompt path. These cross-cutting default behavior changes warrant human review despite the focused intent and adapter tests. You can add or adjust custom eligibility rules. Learn more. |
… text OpenCode appends a per-prompt `system` string after its own agent and provider prompts, so it can carry the same instruction as Codex and Claude. Co-Authored-By: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Image views were forced out of tool groups and settled-turn folds by #9126. After #9460 hid their previews until expansion, bare image paths still split otherwise ordinary tool groups.
Remove that grouping exception. Image views group and fold like other reads, including in the live activity row. Expanding a tool row still uses the existing image-preview renderer.
All six providers now share a concise
<runtime_info>block identifying T3 Code and their harness, ending with: "You can embed images and videos in your response using Markdown with absolute file paths."Codex receives it in developer instructions, Claude in its system-preset append, and OpenCode in each prompt's
systemfield. Cursor, Grok, and Antigravity receive a separate ACP text block after the user content, without changing the stored message. Per-turn context includes the model when known. Claude omits model/effort from its session-level prompt to avoid stale values; OpenCode variants are not assumed to be reasoning effort.Before
Base
2675e3c70, the PR merge base. The same copied thread, expanded turn, scroll anchor, dark theme, and 1280 × 1000 viewport are used in both captures.After
Captured at
73c468825; the later prompt-only revision does not change the UI.Verification
fcffb6e6f, all 307 focused tests pass across the shared runtime instructions, Codex session runtime, and Claude, OpenCode, Cursor, Grok, and Antigravity adapters. Grok and Cursor tests verify runtime context stays out of saved prompts. Server typecheck, targeted lint, and diff checks pass. CI, Cursor Bugbot, and Macroscope correctness and Effect conventions checks pass on this revision; both review threads are resolved.73c468825, 294 focused tests passed acrossCodexSessionRuntime.test.ts,OpenCodeAdapter.test.ts,MessagesTimeline.logic.test.ts,MessagesTimeline.test.tsx, andChatMarkdown.test.tsx.Note
Medium Risk
Changes default chat timeline layout and per-turn agent instructions across every harness; mistakes could mislead models or alter how tool activity is shown, though behavior is covered by adapter and timeline tests.
Overview
Image views in the chat timeline no longer bypass tool grouping or settled-turn folding. The special-case logic that kept image-preview work rows standalone is removed, so image views behave like other tool reads in groups, folds, and the live activity strip; expanded rows still use the existing image preview renderer.
All six provider adapters now share
buildRuntimeInstructionsfor a consistent<runtime_info>block (T3 Code + harness, optional model/reasoning effort, Markdown image/video embed hint). Codex folds it into developer instructions; Claude appends it to theclaude_codesystem preset; OpenCode sends it on each prompt’ssystemfield. Cursor, Grok, and Antigravity append an extra ACP text block after user content without changing stored thread prompts. Provider docs describe this wiring.Reviewed by Cursor Bugbot for commit fcffb6e. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Group image views like other tool calls and add shared provider runtime context
buildRuntimeInstructionsformatter in RuntimeInstructions.ts that emits a runtime-info block with harness identity, optional model/reasoning-effort metadata, and Markdown media-embedding instructions using absolute file paths.Macroscope summarized fcffb6e.
Implemented with Claude Fable 5.1 via Claude Code in T3 Code. Preparation resumed and verified with vega-alpha via the Codex harness in T3 Code.