Skip to content

feat(agent): add Realtime voice sessions and a local Frankie demo - #7519

Draft
tlongwell-block wants to merge 10 commits into
mainfrom
frankie/native-realtime
Draft

feat(agent): add Realtime voice sessions and a local Frankie demo#7519
tlongwell-block wants to merge 10 commits into
mainfrom
frankie/native-realtime

Conversation

@tlongwell-block

@tlongwell-block tlongwell-block commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add OpenAI Realtime transport to buzz-agent, including manual text/image/WAV turns and an opt-in ACP extension for live voice. A user can speak, interrupt playback, approve a shell command, and hear its actual result through the existing Buzz permission broker and MCP executor.

The new examples/realtime-audio webpage streams native 24 kHz PCM, shows transcripts and playback latency, and lets users choose the brain's thinking level before connecting. A Tool approval menu defaults to Ask each time and can automatically approve subsequent shell calls; users can switch back while connected, and reload resets the choice. Its launcher starts the native llama.cpp Frankie server and Buzz with neutral instructions, an isolated default working directory, bounded lifetimes, and fresh loopback credentials. Users can supply their own voice WAV without rebuilding the GGUF.

Capture, playback, provider responses, and tool execution have bounded queues and explicit cancellation/acknowledgment fences. Reconnect starts a fresh session without replaying tools. The example includes the sustained-capture, playback accounting, output-limit recovery, and transcript reset fixes exercised in native testing. Frankie's optional duplex/backchannel extensions are negotiated; the Realtime transport remains endpoint-agnostic.

No model weights, reference recordings, personal persona, machine paths, credentials, or raw session logs are included.

Related issue

Companion native implementation: tlongwell-block/llama.cpp#1

Try it

Follow the end-to-end setup guide. Obtain the model separately. The guide includes the tested GGUF's SHA-256, a pinned llama.cpp revision, Buzz build commands, and the launcher command. The page has no npm runtime dependencies or frontend build step. The launcher supports macOS and Linux.

Testing

  • cargo test -p buzz-agent: 721 passed, one pre-existing ignored test.
  • node --test examples/realtime-audio/*.test.mjs: nine passed; production AudioWorklet/capture queues, auth/origin checks, permission forwarding, disconnect cleanup, and launcher rejection paths.
  • node examples/realtime-audio/client.browser.mjs: production browser client and ACP adapter tested with a controlled subprocess for manual/automatic approval, switching modes, pending decisions, keyboard focus, reload defaults, and six viewport sizes.
  • Biome formatting/lint for the example; release builds of buzz-agent and buzz-dev-mcp.
  • Real browser → Buzz ACP → MCP/native inference on Apple Silicon Metal, using llama.cpp d0aa7352535cbdc2bddfd5512b5f95d731761f72 and GGUF SHA-256 1822228c2caa051fb4fa8535c9a3105c2bb67440968dc5a9f6ee44ffbc439c50: spoken arithmetic, approved uptime with a spoken result, a 1.5-second capture stall, reconnect with Minimal thinking, and denial without retrying. Desktop and narrow layouts checked. The two Off-thinking turns reached actual first sound in approximately 0.74 and 0.85 seconds, with no playback gaps in that run; these are fixture observations, not a general throughput benchmark.
  • just ci: passed, including workspace/desktop Rust lint and tests, 6,488 desktop JavaScript tests, desktop/web builds, repository policy checks, and 2,098 mobile tests.

Hosted OpenAI interoperability has not been live-verified. Native CPU/Metal compatibility has separate coverage; CUDA and a complete 128K workload on a 24 GiB consumer GPU remain hardware-validation work. The default 128K/Q4 KV allocation does not establish that GPU memory target.

New demo page (there was no webpage in the previous PR):

Frankie voice demo

Meli added 5 commits September 8, 2026 22:11
The optional real-binary cancellation test otherwise waits for execution
while its permission request is unanswered.

Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz>
Signed-off-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz>
Keep read and write halves independent so cancellation can be sent while
provider output is pending. Add wire, input-bound, and disconnect tests.

Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz>
Signed-off-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz>
Keep a provider connection per ACP session and reuse the existing permission
and tool executor. Support bounded PCM WAV input/output and reject unsupported
policy modes. Exercise permission, conversation reuse, audio, and disconnect
revocation through a real ACP subprocess.

Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz>
Signed-off-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz>
Explicitly request PCM24k on both audio directions. Accept absent or null
manual turn detection and reject mismatched acknowledgment modalities.
Return provider errors as transport events; the manual driver still fails
closed on rejected mutations, now with a bounded provider diagnostic.

Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz>
Signed-off-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz>
Forward bounded ACP PNG/JPEG content as GA input_image parts alongside
text. Advertise image input only for Realtime sessions and allow auto,
text, or audio output through BUZZ_AGENT_REALTIME_OUTPUT.

Validate input before provider mutation; cover forwarding, output choice,
and invalid-image recovery with real ACP subprocess tests. Document the
manual-turn limits and keep conventional text-only behavior unchanged.

Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz>
Signed-off-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz>
@tlongwell-block
tlongwell-block requested a review from a team as a code owner September 9, 2026 13:57
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is d074576871a66c72e4a9eb5ad59ec0b22a7f0081...9bab300881db59c8a58ef0e54924dd2d5b4c995f.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review 9bab300881db59c8a58ef0e54924dd2d5b4c995f to authorize a new review.
Any previous review applies only to its recorded range.

@tlongwell-block
tlongwell-block marked this pull request as draft September 9, 2026 14:11
Meli added 3 commits September 10, 2026 20:46
…e demo

Signed-off-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz>
* origin/main:
  fix(markdown): align mention chip wrapping (#7501)
  fix(relay): reject presence updates when Redis storage fails (#7532)
  fix(desktop): let inbox title and message author names truncate under narrow panes (#7550)
  fix(buzz-acp): report missing models without retrying (#7538)
  fix(desktop): require a Codex adapter with Astra support (#7427)
  fix(desktop): order unnamed roster members by full canonical npub (#7503)
  fix(mobile): standardize public-key identity display on npub (#7493)
  fix(desktop): npub identity controls across profile, agents, and workflows (#7489)
  fix(desktop): npub identity displays for mention, member, and workflow surfaces (#7495)
  fix(desktop): shared npub identity foundation (canonicalNpub, PubKey gate, strict parser) (#7488)
  fix(mobile): render push notification sender identity as npub (#7494)
  fix(acp): pace targeted overflow recovery on consumer capacity (#7325)
  fix(link-preview): keep composer fetches user-paced (#7211)

Signed-off-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz>
Signed-off-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz>
@tlongwell-block tlongwell-block changed the title feat(agent): manual OpenAI Realtime mode with text, image, and audio turns feat(agent): add Realtime voice sessions and a local Frankie demo Sep 11, 2026
Meli added 2 commits September 10, 2026 21:17
Signed-off-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz>
Signed-off-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant