fix(canvas-chat): clear 'unreachable' banner while the agent is thinking (core#2697) #2745
Reference in New Issue
Block a user
Delete Branch "fix/chat-clear-error-while-thinking"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug (CTO screenshot)
The red "Failed to send — agent may be unreachable" banner showed beside a live
●●● 102stimer 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
thinkingis 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 withdata.currentTaskset (thinking) clears the send-error. Full ChatTab error suite green.🤖 Generated with Claude Code
5-axis review on head
45db14b68d. Correctness: the new effect clears both local error state and send-error state wheneverthinkingis 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 onthinkingandclearSendError; no polling or expensive work. Readability: scoped change with a focused regression test forcurrentTaskclearing the stale banner. Required Canvas and all-required CI are green on the current head./sop-ack
APPROVED (post-merge 5-axis review) on head
45db14b68d.Correctness: the change is tightly scoped to clearing stale chat send/unreachable errors when
thinkingis 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.tsxplus its test; no backend/security-sensitive path changed. Required CI for the head showsCI / all-requiredgreen; the aggregate status includes stale governance/SOP contexts, but the PR is already merged. /sop-ack