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
fix(canvas-chat): clear "unreachable" banner while the agent is thinking (core#2697)
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 6s
E2E Peer Visibility (literal MCP list_peers) / detect-changes (pull_request) Successful in 6s
CI / Python Lint & Test (pull_request) Successful in 7s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 5s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 6s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (local) (pull_request) Has been skipped
Harness Replays / detect-changes (pull_request) Successful in 7s
sop-checklist / review-refire (pull_request_target) Has been skipped
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 8s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 2s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (pull_request) Successful in 5s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 8s
Harness Replays / Harness Replays (pull_request) Successful in 3s
reserved-path-review / reserved-path-review (pull_request_target) Successful in 8s
sop-checklist / all-items-acked (pull_request_target) Successful in 10s
CI / Detect changes (pull_request) Successful in 18s
E2E Chat / detect-changes (pull_request) Successful in 17s
gate-check-v3 / gate-check (pull_request_target) Failing after 12s
E2E API Smoke Test / detect-changes (pull_request) Successful in 18s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 2s
CI / Platform (Go) (pull_request) Successful in 2s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 18s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2s
E2E Chat / E2E Chat (pull_request) Successful in 2s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 22s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 2s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (pull_request) Successful in 28s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (pull_request) Successful in 29s
CI / Canvas (Next.js) (pull_request) Successful in 3m48s
CI / Canvas Deploy Status (pull_request) Successful in 1s
CI / all-required (pull_request) Successful in 3s
reserved-path-review / reserved-path-review (pull_request_review) Successful in 7s
qa-review / approved (pull_request_target) Approved via pull_request_review trigger
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4 — body-unfilled: comprehensive-testing, local-postgres-e2
sop-checklist / na-declarations (pull_request) N/A: (none)
qa-review / approved (pull_request_review) Successful in 9s
security-review / approved (pull_request_target) Approved via pull_request_review trigger
security-review / approved (pull_request_review) Successful in 13s
audit-force-merge / audit (pull_request_target) Successful in 6s
45db14b68d
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