Skip to content

fix(webchat): restore replies to attachment-only assistant messages - #135393

Merged
steipete merged 2 commits into
mainfrom
codex/qa-20260901-attachment-replies
Sep 1, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/qa-20260901-attachment-replies

Conversation

@steipete

@steipete steipete commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

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.pdf card 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.

  • Final correction: 44 focused tests passed, including the unchanged historical-normalization witness, transcript rendering, attachment history, and previews.
  • Final Chromium case: 1 passed, 6 filtered. All three normal unused-export scans passed with zero entries. Formatting, UI types, and the assertion ratchet passed.
  • Independent Codex review of the complete 21-path composition: no actionable P0–P2 findings.
  • Earlier owner coverage: 7 browser cases, 248 message/group/preview cases, 23 menu/callback cases, and 23 transcript cases passed. After the filename-helper relocation, 28 path/history and 10 media/sidebar cases passed.

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-parallelism

The 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:

Attachment-only assistant message without a Reply action

After:

Attachment-only assistant message with the Reply action

Reply preview:

Filename reply preview linked to its source message

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.
@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels Sep 1, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 1, 2026
@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 2:54 PM ET / 18:54 UTC.

ClawSweeper review

What this changes

This 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 provenance

Possible regression — probable (reviewed change; reproduction). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep 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
Reviewed head: 1fe5167d744a091f477a3f06ab20b438b536f768
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has a coherent owner-boundary repair and focused coverage, with exact-head CI still serving as the remaining landing gate.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its supplied Chromium run and before/after captures are supplemental evidence for the changed Control UI reply flow.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its supplied Chromium run and before/after captures are supplemental evidence for the changed Control UI reply flow.
Evidence reviewed 5 items Current bug and owner-boundary repair: Current main derives reply text from visible Markdown only, while the PR's action owner falls back to rendered media labels; this directly makes a document-only bubble eligible for Reply without reintroducing DOM inference.
Caller and transport path: The projection supplies the reply callback to both grouped and stream renderers, and the existing send-delivery owner forwards a prepared reply identifier to chat.send.
Regression coverage: The introduced Chromium scenario covers assistant and user document/image-only bubbles, inline and context-menu Reply, preview labeling, send identity, and source highlighting; focused unit coverage also covers settled streams and fetched previews.
Findings None None.
Security None None.

How this fits together

WebChat projects Gateway transcript entries into message groups, exposes actions for each rendered message, and passes a selected reply source to chat.send. This change makes media-only entries participate in that same reply path without attaching their source files to the new message.

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]
Loading

Decision needed

Question Recommendation
Should this maintainer-authored WebChat repair be approved once the exact head’s required checks complete? Approve after current CI: Approve the existing canonical reply-path repair once required checks are green for the exact PR head.

Why: The PR carries the protected maintainer label and changes user-visible reply behavior, so a human maintainer must make the landing decision.

Before merge

  • Resolve merge risk (P1) - Exact-head CI remains in progress, so landing should wait for GitHub’s current merge/check gate despite the clean source review.
  • Complete next step (P2) - No mechanical repair remains; a maintainer should review the user-visible change and allow exact-head CI to finish.
Agent review details

Security

None.

PR surface

Source -1, Tests +352, Docs +1, Other 0. Total +352 across 21 files.

View PR surface stats
Area Files Added Removed Net
Source 12 228 229 -1
Tests 7 368 16 +352
Docs 1 2 1 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 21 599 247 +352

Review metrics

Metric Value Why it matters
Production versus test delta production −1, tests/support +352, docs +1 The repair is production-net-neutral while adding focused browser and owner-boundary regression coverage.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the canonical message-action path after exact-head CI succeeds, retaining media-label fallback and the identity-only reply-source index.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best 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.

Labels

Label justifications:

  • P2: This fixes a bounded but user-visible WebChat reply regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its supplied Chromium run and before/after captures are supplemental evidence for the changed Control UI reply flow.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Wait for required checks to complete on the exact current head.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-01T17:35:59.868Z sha c2483ca :: needs maintainer review before merge. :: none

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.
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@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 59bcbd156fa31568f47eb4b73e8b76cbe785a764, including the transcript recovery refactor in #135326. The unrelated type failure was repaired on main in #135407. Fresh-head CI remains required before landing.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete merged commit 342cb21 into main Sep 1, 2026
186 checks passed
@steipete
steipete deleted the codex/qa-20260901-attachment-replies branch September 1, 2026 19:31
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 2, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant