Skip to content

FE-1828: Add interview length controls to Brunch - #9894

Open
kostandinang wants to merge 49 commits into
mainfrom
ka/fe-1828-interview-budget
Open

kostandinang wants to merge 49 commits into
mainfrom
ka/fe-1828-interview-budget

Conversation

@kostandinang

@kostandinang kostandinang commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🌟 What is the purpose of this PR?

Add experimental Interview length controls to Brunch Chat and Voice, so people can choose how much questioning to do before wrapping up. Minutes are an estimate derived from replies remaining, not a timer.

🔗 Related links

🚫 Blocked by

  • Run the support-desk-staffing persona at Quick, Standard and Thorough and check the observed question counts. Real-model adherence is not yet verified.

🔍 What does this change?

  • Add a default-off Interview length Labs setting under Use Brunch, with a five-stop picker in the composer and Voice dock: Off, Quick (~5 min), Standard (~10 min), Thorough (~20 min) and Deep (no limit).
  • Count completed Brunch replies against a per-level cap (text 3 / 6 / 10, Voice 2 / 4 / 7). Counts survive level changes and reloads; the wrap-up summary does not spend a question.
  • Send the allowance with each submission as host-owned submission context in a version-two contextual envelope. The SDCPN plugin owns the schema and the instruction; an absent or malformed allowance means Off, and Off keeps today's request and instructions unchanged.
  • At the cap, Brunch settles the latest answer and summarises facts, labelled assumptions and open items. Deep offers pauses instead of closing.
  • Pass the Voice level through a validated startup header and quiet mid-session updates that never interrupt speech.
  • Add generic Petrinaut slots (renderComposerStatus, renderSystemMessage, inputMode); Petrinaut itself knows nothing about interview length.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

  • Modifies @hashintel/petrinaut and includes a patch changeset for the new generic slots. The Brunch packages are private.

📜 Does this require a change to the docs?

  • User guide at apps/petrinaut-website/docs/interview-length.md, linked from the website README. Petrinaut's model-visible docs are unchanged.

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

  • Does not affect the execution graph.

⚠️ Known issues

  • Caps are model instructions, not a hard cutoff. Persona counts and paid Live Voice behaviour are unverified; browser checks used fixture history.
  • Level-change notes live only in the mounted session.
  • FE-1834: Teach Brunch voice agent custom words #9899 also defines petrinaut-contextual-user-message:v2, with a words payload instead of submissionContext. Whichever merges second must move onto the other's envelope.

🐾 Next steps

🛡 What tests cover this?

  • SDCPN plugin, Brunch app, Petrinaut assistant panel and website budget, transport, Labs and Voice suites pass; type, lint and format checks pass.
  • Coverage includes envelope bounds and version-one byte equality, Off leaving requests and instructions unchanged, malformed allowances falling back to Off, mode-specific caps, counting across wrap-up and reload, level changes, the model seeing only the user's own words when history is reopened, and quiet Voice updates.

❓ How to test this?

  1. Run yarn dev:brunch, then enable Use Brunch and Interview length in User settings → Labs.
  2. Open Chat, pick each stop from the icon at the left of the composer, and check Escape returns focus to the trigger.
  3. Check the estimate moves with replies, not time, and that lowering the level keeps earlier replies counted.
  4. In Voice, change the level mid-session and confirm speech is not interrupted and the collapsed dock keeps its height.
  5. Select Off, then disable the experiment; the control disappears and re-enabling restores the saved level.

📹 Demo

interview-length-demo.mp4

kostandinang and others added 22 commits October 1, 2026 10:09
Carry the current allowance alongside immutable Flue birth data, preserve Off requests, and keep budget context separate from human evidence and transcript display.

Co-authored-by: Amp <amp@ampcode.com>
Count canonical replies against per-mode allowances, show question-derived estimates, and carry level changes into Live sessions without interrupting speech. Keep budget notes visible in both modes and remove retired sweep formatting.

Co-authored-by: Amp <amp@ampcode.com>
Restore the compact colored picker, hover previews and quiet estimate with a focusable detail card.

Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Amp <amp@ampcode.com>
…cript note

Co-authored-by: Amp <amp@ampcode.com>
The trigger remounts when its tooltip is re-enabled on close, so the Popover's focus return landed on a detached button and keyboard users were left on the page body.

Co-authored-by: Amp <amp@ampcode.com>
A note anchored to the pending user message vanished when canonical history replaced that message with a new id. Fall back to the anchor's position among messages of the same role.

Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Amp <amp@ampcode.com>
@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:25am UTC
hashdotdesign-tokens Ready Ready Preview Oct 14, 2026 6:25am UTC
petrinaut Ready Ready Preview Oct 14, 2026 6:25am UTC
petrinaut-docs Ready Ready Preview Oct 14, 2026 6:25am 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
…budget

# Conflicts:
#	apps/petrinaut-website/src/main/app/local-storage-demo/local-storage-demo-app.test.tsx
#	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.test.ts
#	apps/petrinaut-website/src/main/app/plugins/brunch/brunch-panel-transport.ts
#	apps/petrinaut-website/src/main/app/plugins/brunch/tools/brunch-sweep-output.ts
#	apps/petrinaut-website/src/main/app/plugins/voice/live/live-conversation-control.tsx
#	apps/petrinaut-website/src/main/app/plugins/voice/live/live-conversation.ts
#	apps/petrinaut-website/src/main/app/plugins/voice/session/voice-interview-control.tsx
…budget

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

# Conflicts:
#	apps/petrinaut-website/src/main/app/local-storage-demo/local-storage-demo-app.test.tsx
#	apps/petrinaut-website/src/main/app/local-storage-demo/local-storage-demo-app.tsx
lunelson
lunelson previously approved these changes Oct 9, 2026
@kostandinang
kostandinang marked this pull request as draft October 12, 2026 08:44
@kostandinang
kostandinang marked this pull request as ready for review October 13, 2026 07:30
…budget

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

# Conflicts:
#	apps/petrinaut-website/src/main/app/local-storage-demo/local-storage-demo-app.test.tsx
#	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
#	apps/petrinaut-website/src/main/app/plugins/voice/live/live-conversation.ts
#	libs/@hashintel/brunch-agent/packages/transport-aisdk/src/index.ts
#	libs/@hashintel/brunch-agent/packages/transport-aisdk/src/transcript.ts
#	libs/@local/flue-aisdk-transport/src/client/submission-context.test.ts
#	libs/@local/flue-aisdk-transport/src/client/transcript.test.ts
…cation

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

This branch was successfully deployed

4 active deployments
Preview – hash — 7a9e7776 Deployed Oct 14, 2026 by vercel[bot]
Preview – petrinaut-docs — 7a9e7776 Deployed Oct 14, 2026 by vercel[bot]
Preview – petrinaut — 7a9e7776 Deployed Oct 14, 2026 by vercel[bot]
Preview – hashdotdesign-tokens — 7a9e7776 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.

2 participants