Repository navigation
fix(webchat): restore replies to attachment-only assistant messages - #135393
Conversation
Carry rendered message metadata through reply actions and previews so attachment-only output and settled streams keep their source references. Remove DOM-text reply inference and reuse the existing filename utility for shared media classification. Production changes remain net -2 lines. Verified with Chromium message actions, owner and sibling tests, UI typechecking, format/lint checks, and an independent Codex review.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 2:54 PM ET / 18:54 UTC. ClawSweeper reviewWhat this changesThis PR makes attachment-only WebChat messages replyable, uses visible media labels in reply previews, and preserves the selected message identity through grouped and settled-stream rendering. Regression provenancePossible regression — probable (reviewed change; reproduction). No predecessor PR is attributed. Merge readinessKeep open for normal maintainer landing review: no actionable introduced correctness or security defect was found, and the current exact-head CI gate is still incomplete. Priority: P2 Review scores
Verification
How this fits togetherWebChat projects Gateway transcript entries into message groups, exposes actions for each rendered message, and passes a selected reply source to flowchart LR
A[Gateway transcript entry] --> B[WebChat transcript projection]
B --> C[Message group and bubble]
C --> D[Reply action details]
D --> E[Composer reply preview]
E --> F[chat.send source identifier]
Decision needed
Why: The PR carries the protected Before merge
Agent review detailsSecurityNone. PR surfaceSource -1, Tests +352, Docs +1, Other 0. Total +352 across 21 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the canonical message-action path after exact-head CI succeeds, retaining media-label fallback and the identity-only reply-source index. Do we have a high-confidence way to reproduce the issue? Yes. The current-main action path has no media-label fallback, and the PR supplies a focused Chromium scenario that exercises the missing Reply action through send and source navigation; this read-only review did not execute it. Is this the best way to solve the issue? Yes. Carrying structured action details from the rendered message replaces fragile DOM-text inference and reuses the existing reply/send boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 111b7715afcf. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Index persisted message identities without normalizing historical content again. Keep reply eligibility in the existing preview and navigation owners. Use the canonical attachment collector in filename tests, make its internal helpers private, and tighten the assertion baseline after removing casts. The complete attachment-reply repair remains net -1 production line. Verified with the unchanged invalidation witness, 44 focused tests, the Chromium reply flow, UI types, assertion ratchet, all three unused-export scans, and an independent Codex review of the complete 21-path change.
|
@clawsweeper re-review The new head keeps reply-source indexing identity-only, removes three unused internal exports, and tightens the assertion baseline. The unchanged normalization witness and all 44 focused cases pass, as do the Chromium reply flow, UI types, and all three unused-export scans. Independent Codex review covered the complete 21-path change with no actionable P0–P2 findings. Production remains net −1 line. The PR body now records direct comparison with main |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
…penclaw#135393) * fix(webchat): reply to attachment-only assistant messages Carry rendered message metadata through reply actions and previews so attachment-only output and settled streams keep their source references. Remove DOM-text reply inference and reuse the existing filename utility for shared media classification. Production changes remain net -2 lines. Verified with Chromium message actions, owner and sibling tests, UI typechecking, format/lint checks, and an independent Codex review. * fix(webchat): keep reply-source indexing lazy Index persisted message identities without normalizing historical content again. Keep reply eligibility in the existing preview and navigation owners. Use the canonical attachment collector in filename tests, make its internal helpers private, and tighten the assertion baseline after removing casts. The complete attachment-reply repair remains net -1 production line. Verified with the unchanged invalidation witness, 44 focused tests, the Chromium reply flow, UI types, assertion ratchet, all three unused-export scans, and an independent Codex review of the complete 21-path change.
What Problem This Solves
Completed assistant messages containing only an attachment could display the file but offer no Reply action. Replyability was inferred from DOM text instead of the message that produced the attachment. Settled streams could also lose the source reference needed to highlight the replied-to message.
Why This Change Was Made
Carry the rendered message and its reply metadata through the existing group, stream, menu, and transcript paths. Attachment labels use the same preview owner as text; source references distinguish persisted message IDs from temporary quoted stream keys. Remove the DOM-text/hash fallback and reuse the existing filename utility for media classification.
The reply-source index records identities only. Content eligibility stays lazy in the existing preview and navigation owners, preserving the established guarantee that unchanged history is not normalized again. Attachment extraction has one public collector; its internal helpers remain private, and existing filename tests exercise that collector without changing their fixtures or assertions.
Production: 229 added / 230 removed, net −1. Tests/support: 368 added / 16 removed, net +352. Documentation: net +1. The assertion baseline tightens from six casts to three for the interaction owner. No new dependency, configuration, protocol, or storage surface.
User Impact
Users can reply to attachment-only assistant output from the inline action or context menu, see its filename in the composer, and jump to the correct source message. Markdown copying remains text-only. Text replies, grouped messages, settled streams, and media/SVG handling retain their existing behavior. WebChat documentation describes attachment reply previews.
Evidence
The regression uses Chromium and the real Control UI with a mocked Gateway. Before the fix, the completed assistant bubble and
report.pdfcard rendered without a text region, but the Reply assertion failed: expected one action, found zero. The final browser run passes the same case, including sending the reply, preserving its source, and highlighting that source without fetching it. This is UI/Gateway-contract proof, not a live model or channel test.Representative final browser command:
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-message-actions.e2e.test.ts -t 'replies to.*assistant.*document.*linked source' --maxWorkers=1 --no-file-parallelismThe current-main source gap from the earlier ClawSweeper review was checked directly against
59bcbd156fa31568f47eb4b73e8b76cbe785a764, including the transcript recovery ownership change in #135326. The composed projection preserves its per-transcript state, pruning, and exact-pending-entry checks. This source comparison does not replace current-head CI.The prior CI normalization failure, three unused exports, and stale assertion count are corrected here. Its separate auth-test type failure was repaired on main in #135407; no duplicate fixture change is included. Two guard jobs returned GitHub HTTP 500 errors. New-head CI remains the landing gate.
One earlier path/history run hit the existing no-output watchdog after partial progress. Its cause remains unresolved; a separately admitted run with unchanged source and bounds passed all 28 cases. That pass is not a watchdog fix. Existing Lit scheduling warnings also remain a named follow-up outside this reply repair.
These synthetic captures predate the behavior-preserving filename-helper relocation. The final-source browser rerun passed without creating new captures.
Before:
After:
Reply preview: