Repository navigation
fix(ui): preserve rich preview metadata beside shortcodes - #138593
Conversation
Keep canonical structured preview metadata when an assistant shortcode matches a live or persisted tool result. Reuse the Canvas block parser and enrich the owned display row without duplicating cards or mutating history. Cover MCP App and dashboard metadata across live and both history orders. The six regressions fail before the repair; 410 owner cases, 20 canonical checks and an independent review pass. Source-bound Chromium reproduces the wrong renderer before and the interactive App after, including reload.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 4, 2026, 4:45 PM ET / 20:45 UTC. ClawSweeper reviewWhat this changesThe PR preserves rich Canvas and MCP App preview metadata when an assistant shortcode references the same live or persisted tool result. Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: current main does not contain the repair, and the introduced raw-structured-block dedupe correctly preserves the metadata that selects the interactive MCP App renderer without adding a second card. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI converts Gateway history and live tool results into chat rows, then renders Canvas previews as either documents or interactive MCP Apps. The change keeps the structured preview attached to its owned display row so the renderer receives its sandbox and App descriptor. flowchart LR
A[Gateway history and live results] --> B[Message normalization]
B --> C[Chat row builder]
C --> D[Structured preview matching]
D --> E[Canvas or interactive App renderer]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +26, Tests +56. Total +82 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the shared structured-preview parser and enrich the existing assistant display row, preserving one card and the renderer-critical MCP App, widget, and sandbox fields across live and history paths. Do we have a high-confidence way to reproduce the issue? Yes, at source level: a tool result and matching assistant shortcode lose the MCP App descriptor under the former normalized-message dedupe; the added six owner-boundary cases cover live and both persisted orderings. Is this the best way to solve the issue? Yes. The repair changes the projection boundary where a shortcode-derived preview was incorrectly treated as equivalent to a structured preview, while the renderer continues to use its existing canonical descriptor. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cbbe91d8f75a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Keep canonical structured preview metadata when an assistant shortcode matches a live or persisted tool result. Reuse the Canvas block parser and enrich the owned display row without duplicating cards or mutating history. Cover MCP App and dashboard metadata across live and both history orders. The six regressions fail before the repair; 410 owner cases, 20 canonical checks and an independent review pass. Source-bound Chromium reproduces the wrong renderer before and the interactive App after, including reload.
What this fixes
An assistant reply containing only an
[embed]shortcode could discard the matching tool result’s rich preview metadata. An MCP App then rendered as a Canvas document instead of an interactive App; dashboard widget identity and the tool’s sandbox ceiling could also be lost. The regression affected live results and persisted history in either ordering.The projection now deduplicates against actual structured Canvas blocks, not the lightweight preview synthesized from a shortcode. History enrichment updates the existing owned display row, so it preserves one card, stable row identity and transcript immutability. The existing canonical Canvas parser is reused by both paths. Raw structured-block deduplication, turn boundaries and search filtering remain unchanged.
Validation
b1164348d55ca3bc221544daa86a908b70c100c6. All four repair files remain byte-identical to the previously reviewed candidate; current renderer and test/build context are retained.Before / after
Both captures are synthetic-only and have been inspected for unrelated or sensitive content. The before error is an intentional mocked missing-document response, not a claim about provider availability.
Scope and release-note context
Restore rich Canvas/MCP App previews when an assistant emits a matching shortcode, including dashboard widget identity and sandbox metadata. No new protocol, configuration, database, dependency or compatibility surface. Production is +49/-23 lines (net +26), needed to retain the owning history row across both result orderings while avoiding duplicate cards; tests add 56 lines in the existing suite. No changelog edit is included under the repository’s release-time convention.
Final review disposition
Reviewed the latest ClawSweeper disposition. The +26 production lines retain the existing display-row owner so rich tool metadata can enrich either persisted ordering without another card; the canonical parser is shared rather than duplicated. All six metadata/order regressions, 410 owner tests, source-bound before/after Chromium proof and 20 local changed checks pass. Exact-head CI 33917323341 is now successful. No config, storage, protocol or sandbox policy change is introduced; proceed through the normal prepare/merge gates.