H-6800: Fix concurrent Voice provenance rollback - #9615
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
lunelson
left a comment
There was a problem hiding this comment.
Approved. Two non-blocking observations:
- Voice-ID normalization is repeated across
markVoiceToolOrigin, submission-state initialization, and rollback; the added tests also repeat substantial fixture setup. A small shared helper/test harness could reduce drift and noise. - Low-probability residual risk: submission coordination is keyed by the stable
setMessagesidentity plus message ID, rather than conversation ID. A pending submission across a conversation switch could therefore share coordination state if message IDs collide.
Neither blocks this focused fix.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed the duplication in I kept the coordination key unchanged. |
lunelson
left a comment
There was a problem hiding this comment.
Re-reviewed after bb46ded1ec. The follow-up centralizes Voice-ID normalization and consolidates the repeated test setup without changing provenance behavior.
I am also withdrawing my earlier conversation-key concern: AiAssistantPanel is keyed by conversationId, so a conversation change remounts the hook tree and isolates the setMessages coordination key. No remaining findings.
Co-authored-by: Cursor <cursoragent@cursor.com>
lunelson
left a comment
There was a problem hiding this comment.
Non-blocking concerns:
- Add an integration regression covering a rejected Voice answer through the panel and confirming the transport does not serialize it as
source: "voice". - Direct-user Voice provenance after reopen remains intentionally unresolved.
- The already-large AI assistant panel now also owns concurrent provenance bookkeeping.
- Local verification in this worktree was blocked by stale or missing workspace package resolution; the PR CI checks passed.
🌟 What is the purpose of this PR?
Prevent overlapping rejected Voice tool answers from restoring stale provenance onto an assistant message. Each failed submission now removes only its own temporary Voice tool-call ID from the latest metadata, preserving successful siblings and unrelated concurrent updates.
🔗 Related links
🚫 Blocked by
🔍 What does this change?
Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
Direct spoken-user attribution after hydration remains explicitly deferred. This focused fix does not restore the obsolete inline
brunch_askwidget provenance slot.🐾 Next steps
After this fix and the remaining provenance omissions are explicitly accepted, #9512 can close as a donor.
🛡 What tests cover this?
ai-assistant-panel.test.tsx: 62 tests.❓ How to test this?
yarn workspace @hashintel/petrinaut test:unit --run src/ui/views/Editor/panels/ai-assistant-panel.test.tsx.yarn workspace @hashintel/petrinaut lint:tsc.yarn workspace @hashintel/petrinaut lint:eslint.📹 Demo
Not applicable; this repairs internal provenance bookkeeping and is covered by deterministic regressions.
Made with Cursor