fix(canvas-chat): true multi-send — don't block on a pending reply (core#2697) #2726
Reference in New Issue
Block a user
Delete Branch "fix/chat-multisend-concurrent"
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
#2700 feature 2 ("send as much as you want") only half-worked:
useChatSend.sendMessageearly-returned on|| sendingand heldsendInFlightRefacross the entire agent-reply wait, so a follow-up message sent while the prior reply was still pending was silently dropped — the CTO's reported "can't send another one until the agent answers."Fix
|| sendinggate (line 160).await, the server-side A2A queue is durable + ordered, and the thinking indicator stays up viasending/data.currentTask. So the next send proceeds immediately.messageId; replies arrive via the existing AGENT_MESSAGE WS + dedup path.Tests (new
useChatSend.multiSend.test.tsx)Note: the UI already didn't disable the textarea/send button on
sending(ChatTab 863/869) — the hook gate was the only blocker.🤖 Generated with Claude Code
APPROVED on head
261c8ef65e.Reviewed with the 5-axis lens. The fix correctly removes
sendingas a send gate while preservinguploadingand the shortsendInFlightRefre-entrancy guard during synchronous setup/file upload/POST dispatch. Releasing the guard immediately after the POST is fired allows a follow-up message while the prior agent reply is pending, without changing the durable server queue ordering or message-id generation.The new hook test covers the reported path: second send while the first POST hangs still creates two user bubbles and two POSTs with distinct
messageIds; whitespace remains a no-op. Existing timeout/poll-mode behavior is untouched. Security/auth/persistence surfaces are unchanged. Targeted E2E checks are green;CI / Canvas (Next.js)was still queued at review time, so merge should wait for Canvas/all-required to finish green./sop-ack
/sop-ack comprehensive-testing
/sop-ack local-postgres-e2e
/sop-ack staging-smoke
/sop-ack root-cause
/sop-ack five-axis-review
/sop-ack no-backwards-compat
/sop-ack memory-consulted
Code review is approved and explicit SOP acks are posted, but merge is still blocked by
sop-checklist / all-items-acked: the PR body is missing the required filled SOP checklist sections (body-unfilled). Please add/fill the 7 body markers:Comprehensive testing performed,Local-postgres E2E run,Staging-smoke verified or pending,Root-cause not symptom,Five-Axis review walked,No backwards-compat shim / dead code added, andMemory consulted.