Repository navigation
Conversation
|
Intent: Hide every "Ask the agent" error hand-off while the dashboard cannot reach the gateway, and bring it back automatically on reconnect — the hand-off otherwise delivers the error to a composer that cannot send. |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Real dead-end removed at the affordance itself; the context-free seam mirrors an existing pattern ( [DESIGN-REVIEWED] fec3baf |
UX Review (Fable 5, fork) — 🔴 BLOCKUX-level review of All evidence is in hand. The diff conditionally hides the existing "Ask the agent" hand-off (in UX-Verdict: BLOCK Cannot evaluate: missing screenshots of the disconnected error surfaces — the description's raw-URL images were not admitted as evidence for this revision. Evidence gaps
Watch
[UX-REVIEWED] fec3baf |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed Review detailsThe candidate describes a transient, self-correcting UI state:
No Step 2 findings survive falsification: the No findings. [OPUS-REVIEWED] fec3baf |
First Principles Review (Fable 5, fork) — 🟡 CONCERNSPremise-level review of All the evidence is in. The fix itself is well-provenanced (manual repro in the description, tests that fail on base), the seam has counted consumers, and the pattern mirrors the existing First-Principles-Verdict: CONCERNS The pairing pin claims the two flags "cannot drift," but Not justified as shipped
What this change shipsInventory (8 items) — 7 justifiedIntent: stop offering an "Ask the agent" hand-off that lands in a composer that cannot send while the gateway is down — a FIX.
Watch
[FIRST-PRINCIPLES-REVIEWED] fec3baf |
|
Triage: the The failing test is Holding — no pushes or retriggers against this red. Once the fix lands on main I will rebase (the diff is byte-identical under rebase; review stamps carry by patch-id) and push to re-run the shard. |
|
Maintainer handoff: this frontend-only head is reviewer-clean, but CI is blocked by an unrelated current-main backend dependency failure.
Contributor rerun is admin-only (HTTP 403), and a rerun would remain deterministic until main supplies |
6ccecfb to
04e78c3
Compare
04e78c3 to
5b58fce
Compare
|
self-added: no
|
|
self-added: yes
|
|
|
self-added: yes
|
|
|
|
|
🤖 Kiro Crew [operator: chenmingwei23#de330d0c]: This PR has been inactive for 7+ days with failing CI. I've assessed the blockers and they appear resolvable -- I'll push fixes directly to this branch as a co-author. Assessment: Frontend-only change (240/-10, 6 files). Blockers are mechanical: the failing Frontend Tests (2) and Frontend Coverage Merge shards report all specs passing (520 passed / 2082 passed) then exit 1 from the coverage-gate step, and PR Readiness is red on coverage. Fix plan: rebase onto current main, ensure the new lines in errorReport.ts / AskAgentButton.tsx / useWebSocket.ts meet the per-file coverage floor, and re-run so the fresh run set supersedes the stale 2026-09-14 one. If you'd prefer I don't touch this PR, add the |
|
PR triage (2026-10-05): DISTINCT, needs a REBASE. No breaking change or P0 found.
|
…unreachable While the gateway is down, "Ask the agent" hands the error to a chat composer that cannot send, and the error on screen is usually the connectivity failure itself. Hide the hand-off (AskAgentButton and ErrorNoticeMenuItem) while disconnected; it returns on reconnect. The button must mount outside the store Provider (ErrorBoundary fallbacks), so the store's connected flag is mirrored into a context-free seam in utils/errorReport. The socket layer moves both through markGatewayConnected/markGatewayDisconnected in hooks/websocket/gatewayConnectivity.ts, called from connection.ts (handleClose) and reconnectCatchUp.ts (first connect and reconnect). A source-level test pins that no raw sseConnected/sseDisconnected dispatch exists outside those helpers. Re-ported from #10680 onto the hooks/websocket split from #15082. Fixes #20215 Co-authored-by: Ruben Cuevas <rubencu@amazon.com>
|
Thank you @rubencu for this fix and its design. Since #15082 split |
…unreachable While the gateway is down, "Ask the agent" hands the error to a chat composer that cannot send, and the error on screen is usually the connectivity failure itself. Hide the hand-off (AskAgentButton and ErrorNoticeMenuItem) while disconnected; it returns on reconnect. The button must mount outside the store Provider (ErrorBoundary fallbacks), so the store's connected flag is mirrored into a context-free seam in utils/errorReport. The socket layer moves both through markGatewayConnected/markGatewayDisconnected in hooks/websocket/gatewayConnectivity.ts, called from connection.ts (handleClose) and reconnectCatchUp.ts (first connect and reconnect). A source-level test pins that no raw sseConnected/sseDisconnected dispatch exists outside those helpers. Re-ported from #10680 onto the hooks/websocket split from #15082. Fixes #20215 Co-authored-by: Ruben Cuevas <rubencu@amazon.com>
…unreachable While the gateway is down, "Ask the agent" hands the error to a chat composer that cannot send, and the error on screen is usually the connectivity failure itself. Hide the hand-off (AskAgentButton and ErrorNoticeMenuItem) while disconnected; it returns on reconnect. The button must mount outside the store Provider (ErrorBoundary fallbacks), so the store's connected flag is mirrored into a context-free seam in utils/errorReport. The socket layer moves both through markGatewayConnected/markGatewayDisconnected in hooks/websocket/gatewayConnectivity.ts, called from connection.ts (handleClose) and reconnectCatchUp.ts (first connect and reconnect). A source-level test pins that no raw sseConnected/sseDisconnected dispatch exists outside those helpers. Re-ported from #10680 onto the hooks/websocket split from #15082. Fixes #20215 Co-authored-by: Ruben Cuevas <rubencu@amazon.com>
…20223) * fix(dashboard): hide the ask-the-agent hand-off while the gateway is unreachable While the gateway is down, "Ask the agent" hands the error to a chat composer that cannot send, and the error on screen is usually the connectivity failure itself. Hide the hand-off (AskAgentButton and ErrorNoticeMenuItem) while disconnected; it returns on reconnect. The button must mount outside the store Provider (ErrorBoundary fallbacks), so the store's connected flag is mirrored into a context-free seam in utils/errorReport. The socket layer moves both through markGatewayConnected/markGatewayDisconnected in hooks/websocket/gatewayConnectivity.ts, called from connection.ts (handleClose) and reconnectCatchUp.ts (first connect and reconnect). A source-level test pins that no raw sseConnected/sseDisconnected dispatch exists outside those helpers. Re-ported from #10680 onto the hooks/websocket split from #15082. Fixes #20215 Co-authored-by: Ruben Cuevas <rubencu@amazon.com> * test(dashboard): screenshot harness for the offline ask-the-agent gate --------- Co-authored-by: Ruben Cuevas <rubencu@amazon.com> Co-authored-by: cixuuz <26782336+cixuuz@users.noreply.github.com>
Problem / Motivation
When the gateway is unreachable (stopped, crashed, or mid-restart), the dashboard's error surfaces still render their "Ask the agent" link — the header's instance bar shows "Failed to fetch Ask the agent", and every other error banner does the same. Clicking it does nothing useful: the agent runs on the gateway, so the hand-off lands in a chat composer that is itself inert ("gateway offline — message will not send").
Why it matters
The most likely error on screen while the gateway is down IS the connectivity failure itself. Offering "Ask the agent" next to it promises help the app cannot deliver, and a call to action that does nothing on click reads as one more broken thing.
What changed (motivation → approach → change)
The hand-off button now hides while the gateway is unreachable, and comes back on its own when the connection returns. The error text and the dismiss control stay.
AskAgentButtoncannot read the store'sdashboard.connectedflag: its callers include ErrorBoundary fallbacks, where the storeProvidermay be exactly what threw, and the existing tests pin that it mounts with noProviderat all. So the flag is mirrored into a module seam inutils/errorReport.ts— the same shape as theinstallSoftNavigateseam already there — written byuseWebSocketright beside itssseConnected/sseDisconnecteddispatches so each WebSocket connect/disconnect transition updates both copies. The button subscribes withuseSyncExternalStore, which needs no context, so the boundary-safety contract holds. The seam defaults to connected, so a surface that never mounts the socket (a boundary fallback, a bare test render) keeps the button.flowchart LR subgraph Before B1[gateway down]:::ctx --> B2[error banner]:::ctx --> B3["Ask the agent → inert composer"]:::removed end subgraph After A1[gateway down]:::ctx --> A2[error banner]:::ctx --> A3[hand-off hidden until reconnect]:::added end classDef added fill:#DCFCE7,stroke:#16A34A classDef changed fill:#FEF3C7,stroke:#D97706 classDef removed fill:#FEE2E2,stroke:#DC2626,stroke-dasharray:4 3 classDef ctx fill:#E0F2FE,stroke:#0284C7🟩 added · 🟥 removed · 🟦 unchanged
The gate lives in
components/AskAgentButton.tsx(which also servescomponents/ErrorNotice.tsx, the boundary fallbacks and the header instance bar) and in the Radix menu-item variantErrorNoticeMenuItem; the seam writes sit inhooks/useWebSocket.ts. The root ErrorBoundary's hard hand-off button is deliberately not gated: at the root, connection state is as suspect as everything else.Tests
errorToAgent.test.tsx: the seam defaults to connected (bare renders keep the button); the button hides on disconnect and reappears on reconnect without a caller re-render;ErrorNoticekeeps the diagnostic and dismiss while disconnected; the menu-item hand-off hides too.gatewayConnectedPairing.test.ts: rawsseConnected/sseDisconnecteddispatches are confined to the paired WebSocket helpers. This guard does not change or govern the inheritedsseStatusreducer.Manual verification
Reproduced the exact reported state against a pod built from this branch: authenticated dashboard, then gateway stopped, then reload (assets served by vite, API dead). Before: 4 "Ask the agent" links next to the failure banners. After: 0 — banners and "Try again" intact. Captures below.
Screenshots / video
Before (gateway down — dead-end CTA next to the failure):
After (same state — the CTA is gone, the error and retry stay):
Pattern harvest
Not generalizable: one-off UI affordance gating; the reusable part (the context-free connectivity seam) now exists for any future surface with the same dead-end.
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)no linked issue: reported directly by the maintainer in chat, no tracked issue exists.