Repository navigation
fix(webchat): announce attachment failures before long replies - #132102
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 5:44 PM ET / 21:44 UTC. ClawSweeper reviewWhat this changesThe PR changes Control UI live announcements to place a named attachment failure before a long assistant reply, with unit and mocked-Gateway browser coverage. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep this member-authored, maintainer-labeled PR open for normal maintainer handling. The one-line owner-boundary repair correctly preserves attachment-failure visibility under the existing announcement cap; no actionable defect was found. Priority: P2 Review scores
Verification
How this fits togetherControl UI projects Gateway history and chat events into transcript rows, then composes a bounded polite live-region announcement for assistive technology. This change affects the ordering of a typed attachment failure and reply prose before the existing 500-unit cap is applied. flowchart LR
A[Gateway history and chat events] --> B[Control UI transcript projection]
B --> C[Announcement composer]
C --> D[500-unit safe truncation]
D --> E[Polite screen-reader live region]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource 0, Tests +157. Total +157 across 3 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Retain the shared failure-first composition and merge it after normal exact-head checks and maintainer review complete. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main composes reply prose before attachment failure text and then truncates the combined result at 500 UTF-16 units; the introduced tests exercise the failing long-reply paths. Is this the best way to solve the issue? Yes. The shared composer is the narrow owner for all affected row forms, and reordering its two existing inputs preserves the cap, initial-history silence, and key-based deduplication. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5b605da38946. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
d97efac to
b3bf654
Compare
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where users relying on the Control UI's live announcements would hear only the reply prose when a long assistant answer also contained a failed attachment. The visible attachment card correctly said the file was not sent, but the bounded announcement could omit that outcome entirely.
Why This Change Was Made
The canonical announcement composer now places the named, actionable attachment failure before ordinary reply text. Ordinary, active and completed-run rows share that owner, so the fix is a single ordering change with no extra state, fallback or configuration. The existing 500 UTF-16-unit cap, surrogate-safe truncation, quiet initial history and stable-message deduplication remain intact.
Production LOC: +1/-1 (net 0). Tests cover all three row paths plus the production-bundle browser flow. No layout, Gateway protocol, provider, delivery or persistence behavior changes.
Provenance: the prose-first composition was introduced in #131826 (merge 8bd8958, 2026-08-28). Code author, PR author and merger: @vyctorbrzezowski. This repair preserves that PR's named failure cards. Separate pipeline-stage work in #131812 is unaffected.
User Impact
Failed files are announced with their name, failure status and actionable reason even beside a long answer. Ordinary answer text still uses the remaining announcement budget. This is the release-note context for the fix.
Evidence
Completed proof: all 310 chat-view tests; two focused attachment-rendering/normalization siblings; two Chromium E2E cases; the full three-path changed-file gate (including core-test/UI typechecking, lint, i18n and repository-wide guards); and an independent Codex review with no actionable findings.
The regression fails on the original composer in all three row paths. The real Chromium app with a mocked Gateway also fails before the fix for ordinary delivery and a completed composer-initiated run: the visible card is correct, but the 500-character live region contains only prose. After the repair, the live region starts with
missing.pdf: Not sent. File not found. Check the path and try again.while staying within the same cap.Browser proof observes the actual polite, atomic live-region DOM; it does not claim a real screen reader spoke the text or a live model/provider delivered a file. The signed-in Chrome relay is disconnected, so the browser proof uses isolated Chromium and synthetic fixtures.
The Vitest browser runs passed both assertions but emitted a slow-fork-shutdown warning. A separate recorded production-bundle run passed both flows and verified clean Chromium exit, closed owned port and removed temporary build directory. The warning remains a test-runner follow-up, not a product-failure claim. The first changed gate caught a test-library mismatch and a missing UI dependency link in the isolated checkout; both were corrected without changing dependencies, and the complete gate then passed.
Before (visible card already correct; live-region text omitted the failure):
After (same visual layout; live-region text now begins with the failure):
Recorded composer-to-final flow (synthetic fixtures, unchanged visual layout):
attachment-announcement-completed.mp4