FE-1654: Test Realtime rephrasing of completed Brunch responses - #9638
Draft
kostandinang wants to merge 3 commits into
Draft
FE-1654: Test Realtime rephrasing of completed Brunch responses#9638kostandinang wants to merge 3 commits into
kostandinang wants to merge 3 commits into
Conversation
Co-authored-by: Amp <amp@ampcode.com>
Keep canonical responses authoritative, gate speech on complete successful turns, and retain overlapping Voice input in a recoverable FIFO queue. Co-authored-by: Amp <amp@ampcode.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Keep completed-response gating intact, report missing speech text, and exclude acknowledgements from substantive TTS timing. Co-authored-by: Amp <amp@ampcode.com>
6 tasks
kostandinang
added this pull request to stack #9652
September 10, 2026 17:56
This was referenced Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🌟 What is the purpose of this PR?
Test whether OpenAI Realtime can keep Voice conversational while Brunch remains the authoritative domain agent. Brunch streams its complete response to the screen independently; after the entire turn and its tool continuations succeed, Realtime speaks a concise, faithful rephrasing. During work, Realtime may deliver only application-selected, event-backed acknowledgements or progress notices.
This is a draft sibling of #9622, based on #9585, not stacked on the separate-Brunch-authored-speech experiment. One short live query now completes through Realtime → Brunch → spoken rephrasing, with the returned audio inspected. The original acknowledgement-only failure did not reproduce; broader fidelity, naturalness, queueing and interruption evaluation remains outstanding.
🔗 Related links
🚫 Blocked by
🔍 What does this change?
Realtime becomes a bounded spoken rephrasing layer over completed Brunch responses. It has no domain tools or autonomous response path. Brunch continues to own the full visible answer, reasoning, questions, and tool calls. Realtime speech is not inserted as another canonical chat message.
Additional finalized speech is retained in FIFO order while Brunch works. A compact follow-up count confirms retention without displaying a separate transcript list. Discard removes waiting inputs; failure holds them for explicit Resume. Speaking over audio interrupts playback only, while Stop cancels active work and withdraws queued inputs.
Rephrasing is answer-first and conversational. Missing or unfinished completed-response text produces a visible error, and acknowledgement requests are excluded from substantive speech timing.
🏗️ Agent notes
Status and imperative
Draft experiment, not accepted. Test conversational fluidity without transferring domain authority from Brunch. A concise spoken answer is the normal path; Read full response remains optional.
Throughline and contracts
Realtime transcription → existing panel FIFO → AI SDK/Flue admission → Brunch and browser-tool continuations → canonical screen stream → positively completed correlated response snapshot → application-requested Realtime rephrasing → audio.
conversation: "none"request. No reasoning, partial output, raw tool results, history, or queued user text enters that request. Source content is data, not instructions.readyor an individual message completion is insufficient. Failed, cancelled, stopped, or unproven work cannot trigger a final paraphrase, and late events cannot revive invalidated generations.Proof and experiment measurements
Automated checks, UI inspection and the single live diagnostic are recorded below. They do not establish general fidelity or naturalness.
Measure acknowledgement latency, silence during Brunch work, completion-to-substantive-audio latency, qualification fidelity, fabricated claims/progress, queued-turn correctness and conversational naturalness. Include queue wait and missing answers. Use synchronized audio/screen recording; provider-buffer timestamps are only proxies. Pin models, prompts and fixtures across #9585, #9622 and this variant. #9622 also changes Brunch generation, so differences cannot all be attributed to Realtime.
Constraints
No Realtime domain tools or independent domain reasoning. Preserve typed-mode behavior, exact user text, turn identity and idempotency. No new endpoint, conversation store or Flue upgrade; the parent’s local Flue 2.0.3 context patch is retained. Operational logs contain metadata, not transcript, source or audio.
Fog-line
The acknowledgement-only report remains unexplained. Long answers, tool continuations, overlapping speech and real microphone echo need live evaluation. Runtime completion gates do not guarantee faithful wording. Deployed behavior is unverified.
Stop or reorient
Reassess on premature speech, fabricated progress, qualification loss, lost/reordered turns, playback after cancellation or typed-mode changes. Do not expand Realtime’s authority to compensate for poor naturalness. Further paid trials require approval.
Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
@hashintel/petrinaut📜 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
Compare the three variants using short and long answers, tool continuations, queued turns and interruptions. Judge Brunch’s correctness against tool evidence separately from spoken fidelity against its canonical response.
🛡 What tests cover this?
Latest local verification: 1,239 tests passed — Petrinaut 808, website 378, transport 52, Brunch Voice context 1.
All 12 build/test/typecheck/lint tasks passed for Petrinaut, the website and transport:
Coverage includes complete-turn gating, failed/textless continuations, Stop races, FIFO ordering and recovery, no historical autoplay, missing/unfinished response errors and acknowledgement-excluded speech timing. Prompt/payload tests cover source isolation, exact marked questions and no domain tools. Browser checks exercise Resume/Discard; queued, recovery and listening states were visually inspected. Changed-file formatting and commit hooks passed.
Live diagnostic — 10 September 2026
Fresh local Chrome conversation with real WebRTC, Realtime and Brunch. Synthetic spoken input: “In two sentences, what is a Petri net? Do not change the model.”
❓ How to test this?
ka/realtime-voice-rephrasing, build workspace dependencies and run the checks above. This branch targets FE-1630: Optimize and measure the Brunch Voice relay #9585, not FE-1657: Separate Brunch-authored Voice speech from on-screen responses #9622.yarn exec storybook dev -p 6108 --ci --no-openinlibs/@hashintel/petrinaut. Inspecteditor-ai-assistant--voice-queued-turns,--voice-queue-recovery, and--voice-session-listening; verify the compact count, Resume/Discard, and no empty indicator./?brunch-fixture=crew-reservation-v1.📹 Demo
Inspected local Chrome/Storybook fixtures. These show UI layout only; no live provider or acoustic result is implied.