FE-1570: Optimize spoken Brunch responses for Voice mode - #9496
FE-1570: Optimize spoken Brunch responses for Voice mode#9496kostandinang wants to merge 15 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
b5eba96 to
2709cf3
Compare
2709cf3 to
9e121db
Compare
Amp-Thread-ID: https://ampcode.com/threads/T-01a0618e-4184-736b-a426-c802f086dc83 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0618e-4184-736b-a426-c802f086dc83 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0618e-4184-736b-a426-c802f086dc83 Co-authored-by: Amp <amp@ampcode.com>
Keep child-only replay fixtures aligned with the mute state contract now owned by the parent PR. Co-authored-by: Cursor <cursoragent@cursor.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0618e-4184-736b-a426-c802f086dc83 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0618e-4184-736b-a426-c802f086dc83 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0618e-4184-736b-a426-c802f086dc83 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0618e-4184-736b-a426-c802f086dc83 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0618e-4184-736b-a426-c802f086dc83 Co-authored-by: Amp <amp@ampcode.com>
Separate speech cancellation from bridge lifecycle invalidation so prepared turns still close their tool call without starting unwanted audio. Co-authored-by: Cursor <cursoragent@cursor.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0618e-4184-736b-a426-c802f086dc83 Co-authored-by: Amp <amp@ampcode.com>
9e121db to
1fe880e
Compare
PR SummaryMedium Risk Overview
The Voice dock gains Voice playback options (Repeat question, Read full response) wired through Petrinaut session state ( Docs and changesets describe the dock replacing the composer during voice, typed send requiring End voice mode first, and expanded voice diagnostics for the preparation operation. Reviewed by Cursor Bugbot for commit c7fe8a2. Bugbot is set up for automated code reviews on this repo. Configure here. |
Skip automatic speech for answered ask turns and keep replay actions disabled while a barge-in turn remains unresolved. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 943dfc2. Configure here.
Treat a completed transcript as the end of the input guard so replay actions recover when no answer submission follows. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The Brunch-side premise has changed enough since this work was designed that we now intend to validate a different Voice integration in FE-1574. This is an architectural coordination note, not a claim that the careful correlation, fallback, cancellation, and replay work in this PR is incorrect. 🏗️ Agent notesWhat changedMission 4 replaced the older Brunch agent shape with the package-composed We also no longer expect the existing Petrinaut AI assistant or its AI SDK A remotely exposed browser path may still need a thin authenticated same-origin proxy, but it should preserve Flue semantics rather than translate Voice through AI SDK UI messages. Why this matters for this PRThe preparation path here is defensive: it excludes tools/reasoning, protects the exact Mission 5 will initially remove that variable and test exact canonical speech. Its visible proof target is:
The draft contract is here. What we should preserveThe reusable work in this stack—exactly-once finalized answer submission, turn correlation, interruption/barge-in behavior, stale-work rejection, playback controls, answer provenance, and explicit canonical fallback—should inform or be ported into that experiment. For now, please treat the AI SDK/Petrinaut-assistant dependency and secondary 50-word preparation as experimental choices rather than the integration seam we intend to stabilize. If canonical speech proves unusably long, the next least-lossy options are deterministic question-focused presentation or Brunch-owned spoken-mode output. We should retain a secondary generative preparation step only if the direct experiment demonstrates that those are insufficient and the latency/semantic trade-off is accepted explicitly. |


🌟 What is the purpose of this PR?
Improve spoken response quality for the Voice mode introduced by H-6763 without weakening Brunch's authority. Petrinaut continues to render the complete canonical Brunch response, while OpenAI Realtime prepares only shorter explanatory context for disposable audio delivery. Application code then appends every protected
brunch_askquestion exactly.This PR is stacked on #9467 so it can reuse the unified Voice session, transcript, and lifecycle contracts without duplicating them.
🔗 Related links
🚫 Blocked by
🔍 What does this change?
conversation: "none",tool_choice: "none", and no tools to prepare context.Boundaries
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:
🐾 Next steps
mainafter H-6763: Integrate Voice mode into the AI assistant #9467 merges.brunch_askhuman-answer admission against the landed architecture.🛡 What tests cover this?
yarn workspace @apps/petrinaut-website test:unit— 31 files / 237 tests passed.yarn workspace @hashintel/petrinaut test:unit --run— 46 files / 405 tests passed.yarn workspace @local/petrinaut-arch-docs lint:arch-docs— 57 layers / 259 edges / 579 files passed.git diff --checkpassed.❓ How to test this?
VITE_BRUNCH_CHAT_ENDPOINT,PETRINAUT_OPENAI_VOICE_ENABLED=true, and dedicatedOPENAI_VOICE_API_KEYinapps/petrinaut-website/.env.local.yarn workspace @apps/petrinaut-website devand open the local URL.📹 Demo
A short physical-device preview recording should be added before marking this PR ready for review because the primary behavior is audio-dependent.