fix(chat): reuse optimistic message id as A2A messageId to prevent origin duplicate bubble (core#2713) #2716

Closed
agent-dev-a wants to merge 1 commits from fix/2713-origin-duplicate-message-id into main
Member

useChatSend created the optimistic user message with one id, then sent a fresh crypto.randomUUID() as the A2A params.message.messageId. The server echoes USER_MESSAGE with the A2A id, and appendMessageDedupedById could not collapse the two bubbles on the origin device, so the E2E Chat assertion at canvas/e2e/chat-desktop.spec.ts:70-77 resolved to two elements.

  • Use userMsg.id for the outbound message.messageId.
  • Add regression test asserting the optimistic and A2A ids match.

Fixes #2713.

Co-Authored-By: Claude noreply@anthropic.com

Test plan

  • npm test -- src/components/tabs/chat/hooks/__tests__/useChatSend --run passes (13/13)
  • New regression test useChatSend.originMessageId.test.tsx passes (2/2)
`useChatSend` created the optimistic user message with one id, then sent a fresh `crypto.randomUUID()` as the A2A `params.message.messageId`. The server echoes `USER_MESSAGE` with the A2A id, and `appendMessageDedupedById` could not collapse the two bubbles on the origin device, so the E2E Chat assertion at `canvas/e2e/chat-desktop.spec.ts:70-77` resolved to two elements. - Use `userMsg.id` for the outbound `message.messageId`. - Add regression test asserting the optimistic and A2A ids match. Fixes #2713. Co-Authored-By: Claude <noreply@anthropic.com> ## Test plan - `npm test -- src/components/tabs/chat/hooks/__tests__/useChatSend --run` passes (13/13) - New regression test `useChatSend.originMessageId.test.tsx` passes (2/2)
agent-dev-a added 1 commit 2026-06-13 06:29:22 +00:00
fix(chat): reuse optimistic message id as A2A messageId to prevent origin duplicate bubble (core#2713)
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 6s
CI / Python Lint & Test (pull_request) Successful in 5s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 4s
Harness Replays / detect-changes (pull_request) Successful in 6s
sop-checklist / review-refire (pull_request_target) Has been skipped
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 7s
Harness Replays / Harness Replays (pull_request) Successful in 2s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 6s
E2E Peer Visibility (literal MCP list_peers) / detect-changes (pull_request) Successful in 11s
qa-review / approved (pull_request_target) Failing after 7s
reserved-path-review / reserved-path-review (pull_request_target) Successful in 8s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (local) (pull_request) Has been skipped
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
security-review / approved (pull_request_target) Failing after 7s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 13s
sop-checklist / na-declarations (pull_request) N/A: (none)
E2E Chat / detect-changes (pull_request) Successful in 15s
sop-checklist / all-items-acked (pull_request_target) Successful in 9s
E2E API Smoke Test / detect-changes (pull_request) Successful in 15s
CI / Detect changes (pull_request) Successful in 17s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 1s
gate-check-v3 / gate-check (pull_request_target) Failing after 14s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 15s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (pull_request) Successful in 4s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2s
CI / Platform (Go) (pull_request) Successful in 2s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 2s
E2E Chat / E2E Chat (pull_request) Successful in 3s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 19s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 3s
audit-force-merge / audit (pull_request_target) Has been skipped
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (pull_request) Successful in 1m26s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (pull_request) Successful in 24s
CI / Canvas (Next.js) (pull_request) Successful in 3m34s
CI / Canvas Deploy Status (pull_request) Successful in 1s
CI / all-required (pull_request) Successful in 4s
3b57983d65
useChatSend created the optimistic user message with one id, then sent
a fresh crypto.randomUUID() as the A2A params.message.messageId. The
server echoes USER_MESSAGE with the A2A id, and appendMessageDedupedById
could not collapse the two bubbles on the origin device.

- Use userMsg.id for the outbound message.messageId.
- Add regression test asserting the optimistic and A2A ids match.

Fixes #2713.

Co-Authored-By: Claude <noreply@anthropic.com>
agent-dev-a force-pushed fix/2713-origin-duplicate-message-id from 27a8431261 to 3b57983d65 2026-06-13 06:29:22 +00:00 Compare
agent-dev-a closed this pull request 2026-06-13 06:30:03 +00:00
Some optional checks failed
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 6s
CI / Python Lint & Test (pull_request) Successful in 5s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 4s
Harness Replays / detect-changes (pull_request) Successful in 6s
sop-checklist / review-refire (pull_request_target) Has been skipped
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 7s
Harness Replays / Harness Replays (pull_request) Successful in 2s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 6s
E2E Peer Visibility (literal MCP list_peers) / detect-changes (pull_request) Successful in 11s
qa-review / approved (pull_request_target) Failing after 7s
reserved-path-review / reserved-path-review (pull_request_target) Successful in 8s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (local) (pull_request) Has been skipped
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
security-review / approved (pull_request_target) Failing after 7s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 13s
sop-checklist / na-declarations (pull_request) N/A: (none)
E2E Chat / detect-changes (pull_request) Successful in 15s
sop-checklist / all-items-acked (pull_request_target) Successful in 9s
E2E API Smoke Test / detect-changes (pull_request) Successful in 15s
CI / Detect changes (pull_request) Successful in 17s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 1s
Required
Details
gate-check-v3 / gate-check (pull_request_target) Failing after 14s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 15s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (pull_request) Successful in 4s
Required
Details
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2s
Required
Details
CI / Platform (Go) (pull_request) Successful in 2s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 2s
E2E Chat / E2E Chat (pull_request) Successful in 3s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 19s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 3s
audit-force-merge / audit (pull_request_target) Has been skipped
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (pull_request) Successful in 1m26s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (pull_request) Successful in 24s
CI / Canvas (Next.js) (pull_request) Successful in 3m34s
CI / Canvas Deploy Status (pull_request) Successful in 1s
CI / all-required (pull_request) Successful in 4s
Required
Details

Pull request closed

Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2716