fix(canvas-chat): clear 'unreachable' banner while the agent is thinking (core#2697) #2745

Merged
devops-engineer merged 1 commits from fix/chat-clear-error-while-thinking into main 2026-06-13 10:14:07 +00:00
Member

Bug (CTO screenshot)

The red "Failed to send — agent may be unreachable" banner showed beside a live ●●● 102s timer with tool calls streaming (gdown/pip) — the agent was plainly reachable + working a long poll-mode turn that simply hadn't replied yet.

Why #2736 wasn't enough

#2736 cleared the banner only when a reply landed (onAgentMessage/onSendComplete). On a multi-minute turn with no reply yet, a banner set earlier (a prior failed send, or an activity-error event) lingered the whole time.

Fix

Add an effect that clears both error sources whenever thinking is true (sending || data.currentTask). Active processing = reachable, so the "unreachable" banner is self-contradictory then. The banner now only appears when the agent is genuinely idle and a send failed.

Test

ChatTab.errorClearOnReply.test.tsx: rendering with data.currentTask set (thinking) clears the send-error. Full ChatTab error suite green.

🤖 Generated with Claude Code

## Bug (CTO screenshot) The red **"Failed to send — agent may be unreachable"** banner showed beside a live **`●●● 102s`** timer with tool calls streaming (gdown/pip) — the agent was plainly reachable + working a long poll-mode turn that simply hadn't replied yet. ### Why #2736 wasn't enough #2736 cleared the banner only when a reply **landed** (`onAgentMessage`/`onSendComplete`). On a multi-minute turn with no reply yet, a banner set earlier (a prior failed send, or an activity-error event) lingered the whole time. ### Fix Add an effect that clears both error sources whenever `thinking` is true (`sending || data.currentTask`). Active processing = reachable, so the "unreachable" banner is self-contradictory then. The banner now only appears when the agent is genuinely **idle and a send failed**. ### Test `ChatTab.errorClearOnReply.test.tsx`: rendering with `data.currentTask` set (thinking) clears the send-error. Full ChatTab error suite green. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
core-devops added 1 commit 2026-06-13 10:07:50 +00:00
Reported: the red "Failed to send — agent may be unreachable" banner showed
next to a live "●●● 102s" timer with tool calls streaming — the agent was
plainly reachable + working a long poll-mode turn that hadn't replied yet.
#2736 cleared the banner only when a reply LANDED, so a banner set earlier
lingered through the whole multi-minute turn.

Add an effect that clears both error sources whenever `thinking` is true
(sending || data.currentTask) — active processing proves reachability, so an
"unreachable" banner is self-contradictory. The banner now only shows when
the agent is genuinely idle + a send failed.

Test: rendering with data.currentTask set (thinking) clears the send-error.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
agent-reviewer-cr2 approved these changes 2026-06-13 10:13:51 +00:00
agent-reviewer-cr2 left a comment
Member

5-axis review on head 45db14b68d. Correctness: the new effect clears both local error state and send-error state whenever thinking is true (sending || data.currentTask), which matches the reported case where an unreachable banner lingered beside live agent activity before a reply landed. Robustness: this complements #2736's reply-landing clear without changing send/reply flow; the banner remains available for the idle+failed-send case. Security: no auth, input, or secret-handling surface changed. Performance: a small React effect keyed on thinking and clearSendError; no polling or expensive work. Readability: scoped change with a focused regression test for currentTask clearing the stale banner. Required Canvas and all-required CI are green on the current head.

5-axis review on head 45db14b68d964ac5ad5a64ec7d3615c7c6d89010. Correctness: the new effect clears both local error state and send-error state whenever `thinking` is true (`sending || data.currentTask`), which matches the reported case where an unreachable banner lingered beside live agent activity before a reply landed. Robustness: this complements #2736's reply-landing clear without changing send/reply flow; the banner remains available for the idle+failed-send case. Security: no auth, input, or secret-handling surface changed. Performance: a small React effect keyed on `thinking` and `clearSendError`; no polling or expensive work. Readability: scoped change with a focused regression test for `currentTask` clearing the stale banner. Required Canvas and all-required CI are green on the current head.
Member

/sop-ack

/sop-ack
devops-engineer merged commit 1a1eeef3a1 into main 2026-06-13 10:14:07 +00:00
Member

APPROVED (post-merge 5-axis review) on head 45db14b68d.

Correctness: the change is tightly scoped to clearing stale chat send/unreachable errors when thinking is true (sending || data.currentTask), which matches the reported state where a live long-running agent turn is visible but the stale banner remains. This does not weaken failure detection for idle/offline agents because the clear only fires when a send is in flight or the platform reports current task activity.

Tests: the existing reply/onSendComplete clear coverage remains, and the new currentTask case covers the pre-reply long-turn path. Scope is limited to ChatTab.tsx plus its test; no backend/security-sensitive path changed. Required CI for the head shows CI / all-required green; the aggregate status includes stale governance/SOP contexts, but the PR is already merged. /sop-ack

APPROVED (post-merge 5-axis review) on head 45db14b68d964ac5ad5a64ec7d3615c7c6d89010. Correctness: the change is tightly scoped to clearing stale chat send/unreachable errors when `thinking` is true (`sending || data.currentTask`), which matches the reported state where a live long-running agent turn is visible but the stale banner remains. This does not weaken failure detection for idle/offline agents because the clear only fires when a send is in flight or the platform reports current task activity. Tests: the existing reply/onSendComplete clear coverage remains, and the new currentTask case covers the pre-reply long-turn path. Scope is limited to `ChatTab.tsx` plus its test; no backend/security-sensitive path changed. Required CI for the head shows `CI / all-required` green; the aggregate status includes stale governance/SOP contexts, but the PR is already merged. /sop-ack
Sign in to join this conversation.
No Reviewers
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2745