Skip to content

FE-1834: Teach Brunch voice agent custom words - #9899

Closed
kostandinang wants to merge 30 commits into
mainfrom
kostandin/fe-1834-teach-brunch-your-words
Closed

kostandinang wants to merge 30 commits into
mainfrom
kostandin/fe-1834-teach-brunch-your-words

Conversation

@kostandinang

@kostandinang kostandinang commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🌟 What is the purpose of this PR?

Let people teach Brunch names and terms through a default-off Custom words Labs setting. Saved spellings and optional pronunciation hints help the assistant recognize and say those words in Voice conversations.

🔗 Related links

🚫 Blocked by

  • None.

🔍 What does this change?

  • Add a Voice-only Words header button and a Custom words dialog for adding, editing and removing up to 50 entries.
  • Store words in this browser, per principal and conversation, and clear them with the conversation. Unsaved edits survive another tab deleting the word.
  • Send spellings to Brunch and both voice transcription prompts, and pronunciation hints to the speaking model. Transcription models and semantic VAD are unchanged.
  • Keep a running Voice session on the hints it started with, including retries, until it restarts.
  • The word list and limits live in the website's Voice code; the spelling bounds and the words envelope live in the SDCPN plugin. Brunch core, Petrinaut Core and the stock assistant prompt are unchanged.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

  • Modifies @hashintel/petrinaut (assistant header controls) and includes a changeset.

📜 Does this require a change to the docs?

  • User guide at apps/petrinaut-website/docs/custom-words.md.

🕸️ Does this require a change to the Turbo Graph?

  • Does not affect the execution graph.

⚠️ Known issues

  • One Live Voice turn was verified with real microphone and speaker audio; legacy Realtime and physical speaker echo were not tested.
  • The 50-entry limit is also bounded by spelling, pronunciation, total-text and header size limits.
  • FE-1828: Add interview length controls to Brunch #9894 also defines petrinaut-contextual-user-message:v2, with a submissionContext payload instead of words. Whichever merges second must move onto the other's envelope.

🛡 What tests cover this?

  • SDCPN plugin, Brunch core, Petrinaut Core, the Petrinaut assistant panel, apps/brunch-agent and the website's Voice and Brunch suites pass; type, lint and format checks pass.
  • Coverage includes validation, browser persistence, cross-tab edits, envelope encoding, the model seeing only the user's own words when history is reopened, prompt wiring, session snapshots and echo filtering.

❓ How to test this?

  1. Enable Use Brunch and Custom words in User settings → Labs.
  2. In Voice, open Words and add a name with an optional pronunciation; edit, remove and reload to check persistence. The button is hidden in text mode.
  3. Start Voice and say the name. Change its hint mid-session, then restart Voice to apply it.
  4. Clear the conversation and confirm its words are gone.

📹 Demo

custom-words-live-demo.mp4

@vercel

vercel Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hash Ready Ready Preview Oct 14, 2026 6:22am UTC
hashdotdesign-tokens Ready Ready Preview Oct 14, 2026 6:22am UTC
petrinaut Ready Ready Preview Oct 14, 2026 6:22am UTC
petrinaut-docs Ready Ready Preview Oct 14, 2026 6:22am UTC

Request Review

@github-actions github-actions Bot added area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team area/tests New or updated tests area/apps labels Oct 2, 2026
@kostandinang kostandinang changed the title FE-1834: Add Custom words for Voice FE-1834: Teach Brunch your words Oct 2, 2026
@kostandinang
kostandinang marked this pull request as ready for review October 2, 2026 13:59
@cursor

cursor Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes user-message framing, model instructions, and Voice provider prompts; bounded validation and display stripping reduce prompt-injection risk, but custom terms still flow to Brunch and OpenAI.

Overview
Adds Custom words for Brunch Voice: a default-off Labs toggle, a Voice-only Words header control (via new @hashintel/petrinaut headerActions / actionsInputMode), and a per-conversation browser-stored list of spellings plus optional pronunciation notes.

Host → Brunch: Active spellings are captured per user turn and sent in a petrinaut-contextual-user-message:v2 envelope; the chat agent persists the latest snapshot and injects spellings as untrusted model instructions while context projection and UI/transcript paths show only human userText. Voice: One words snapshot is pinned for each session (including retries) and passed to server handlers that extend transcription prompts (spellings) and speaking instructions (pronunciation only), with shadow filtering for transcription-prompt echo.

Validation, encoding, and spelling limits live in the SDCPN plugin and shared voice-words helpers; clearing the conversation drops the local list.

Reviewed by Cursor Bugbot for commit b24e2cf. Bugbot is set up for automated code reviews on this repo. Configure here.

@kostandinang kostandinang changed the title FE-1834: Teach Brunch your words FE-1834: Teach Brunch voice agent custom words Oct 2, 2026

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

The approval coordinator now reports refused calls, so Live progress treats a
denied or stopped edit as finished while its refusal output is still on its
way back, instead of reading the stale input-available part as executing.

Co-authored-by: Cursor <cursoragent@cursor.com>
lunelson
lunelson previously approved these changes Oct 7, 2026
…kostandin/fe-1834-teach-brunch-your-words

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	apps/petrinaut-website/src/main/app/local-storage-demo/local-storage-demo-app.tsx
#	apps/petrinaut-website/src/main/app/voice-interview/live-conversation-control.tsx
…ch-brunch-your-words

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	apps/petrinaut-website/src/main/app/local-storage-demo/local-storage-demo-app.tsx
#	apps/petrinaut-website/src/main/app/voice-interview/live-conversation-control.test.tsx
#	apps/petrinaut-website/src/main/app/voice-interview/live-conversation-control.tsx
lunelson
lunelson previously approved these changes Oct 8, 2026
kostandinang and others added 3 commits October 8, 2026 16:11
…ch-brunch-your-words

# Conflicts:
#	apps/petrinaut-website/src/main/app/local-storage-demo/local-storage-demo-app.tsx
#	apps/petrinaut-website/src/main/app/plugins/voice/live/live-brunch-bridge/utterance-pipeline.ts
#	apps/petrinaut-website/src/main/app/plugins/voice/live/live-conversation.ts
#	apps/petrinaut-website/src/main/app/plugins/voice/realtime/openai-realtime-session.ts
#	apps/petrinaut-website/src/main/app/plugins/voice/session/voice-interview-control.tsx
#	apps/petrinaut-website/src/main/app/plugins/voice/shared/classify-interruption.test.ts
…ch-brunch-your-words

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	apps/petrinaut-website/src/main/app/local-storage-demo/local-storage-demo-app.tsx
Co-authored-by: Cursor <cursoragent@cursor.com>
lunelson
lunelson previously approved these changes Oct 9, 2026
…ch-brunch-your-words

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	apps/brunch-agent/src/ui/chat.tsx
#	apps/petrinaut-website/README.md
#	apps/petrinaut-website/src/main/app/local-storage-demo/local-storage-demo-app.tsx
#	apps/petrinaut-website/src/main/app/plugins/brunch/brunch-panel-transport.ts
#	libs/@hashintel/brunch-agent/packages/plugin-sdcpn/src/contextual-user-message.ts
#	libs/@hashintel/brunch-agent/packages/transport-aisdk/src/index.ts
#	libs/@hashintel/brunch-agent/packages/transport-aisdk/src/transcript.ts
#	libs/@hashintel/brunch-agent/packages/transport-aisdk/test/chat-transport.test.ts
#	libs/@hashintel/brunch-agent/packages/transport-aisdk/vite.config.ts
#	libs/@local/flue-aisdk-transport/package.json
#	libs/@local/flue-aisdk-transport/src/client/contextual-user-message.test.ts
#	libs/@local/flue-aisdk-transport/src/client/words.test.ts
@lunelson

Copy link
Copy Markdown
Contributor

Closing in favor of #10054

This branch was successfully deployed

4 active deployments
Preview – hash — b24e2cfd Deployed Oct 14, 2026 by vercel[bot]
Preview – petrinaut-docs — b24e2cfd Deployed Oct 14, 2026 by vercel[bot]
Preview – petrinaut — b24e2cfd Deployed Oct 14, 2026 by vercel[bot]
Preview – hashdotdesign-tokens — b24e2cfd Deployed Oct 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) area/tests New or updated tests type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

4 participants