Skip to content

FE-1664: Refine host-owned Voice sessions in Petrinaut - #9719

Merged
kostandinang merged 3 commits into
kostandin/fe-1663-experiment-live-full-duplex-migrationfrom
kostandin/fe-1664-petrinaut-voice-platform
Sep 15, 2026
Merged

kostandinang merged 3 commits into
kostandin/fe-1663-experiment-live-full-duplex-migrationfrom
kostandin/fe-1664-petrinaut-voice-platform

Conversation

@kostandinang

@kostandinang kostandinang commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Note

Platform extraction: This PR isolates provider-independent, host-owned Voice presentation so it can be reviewed and shipped independently. It introduces no GPT-Live, transcription, Flue, or Brunch behavior and depends on #9671.

🌟 What is the purpose of this PR?

Extract the reusable Petrinaut Voice presentation from the GPT-Live experiment so the Petrinaut platform behavior can be reviewed and shipped independently of OpenAI, Flue, and Brunch integration code.

Hosts continue to own session and recovery behavior. Petrinaut only presents the reported Voice state and available actions.

🔗 Related links

🚫 Blocked by

🔍 What does this change?

  • Lets host-owned Voice sessions show a neutral Connected state and omit controls the host does not support.
  • Keeps compact Voice setup above a stationary dock without moving viewport controls or showing a premature Connecting state.
  • Keeps Voice failures and explicit recovery warnings in one deduplicated, copyable, dismissible Voice issues popover attached to the dock, while temporary session notices remain in the dock status.
  • Leaves ordinary AI assistant, stream, Stop, handoff, and interactive-tool failures on the existing global notification path.
  • Adds focused stories, regression coverage, user documentation, and the @hashintel/petrinaut patch changeset.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • modifies an npm-publishable library and I have added a changeset file(s)

@hashintel/petrinaut patch: .changeset/tidy-voice-dock.md.

📜 Does this require a change to the docs?

The changes in this PR:

  • require changes to docs which are made as part of this PR

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

The changes in this PR:

  • do not affect the execution graph

⚠️ Known issues

This PR does not alter capture, transcription, transport, admission, or provider recovery behavior. Those remain host responsibilities.

🐾 Next steps

#9673 is already restacked on this PR and can be reviewed as the downstream experimental consumer. The stack now targets main; merge in order #9671#9719#9673#9704.

🛡 What tests cover this?

  • Full @hashintel/petrinaut unit suite: 1,129 passed.
  • @hashintel/petrinaut build, typecheck, and ESLint: passed.
  • Repository formatting and Markdown lint: passed.

❓ How to test this?

  1. Run yarn workspace @hashintel/petrinaut dev.
  2. Open the AI assistant content stories for compact setup, connected sessions, collapsed sessions, and multiple Voice issues.
  3. Confirm the setup card does not move the dock, unsupported actions are absent, and Voice issue details remain available in expanded and collapsed layouts.
  4. Trigger an ordinary assistant failure and confirm it remains a global notification rather than joining the Voice issues popover.

📹 Demo

No separate recording is included; the Storybook cases provide the review fixtures.

@vercel

vercel Bot commented Sep 14, 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 Sep 15, 2026 3:15pm UTC
petrinaut Ready Ready Preview Sep 15, 2026 3:15pm UTC
petrinaut-docs Ready Ready Preview Sep 15, 2026 3:15pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
hashdotdesign-tokens Ignored Ignored Preview Sep 15, 2026 3:15pm UTC

Request Review

@cursor

cursor Bot commented Sep 14, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
UI-only changes to Voice presentation and error routing in the AI assistant panel; no changes to capture, transport, or host session logic.

Overview
Voice issues no longer surface as global toasts. Host-reported errorMessage and the new optional warningMessage are deduplicated into local state and shown via a dock warning control with tooltip preview, scrollable popover, copy, and Dismiss Voice issues. Ordinary AI assistant/stream errors still use the shared notification path.

Compact Voice setup keeps consent/permission in an overlay card above a fixed Voice setup dock (no premature Connecting, no layout shift for viewport controls). The issues icon stays anchored in the dock when collapsing or expanding a live session; dock layout reserves space so status text does not overlap the indicator.

Session notice remains a temporary dock status line only. Clearing chat also clears accumulated Voice issues.

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

@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/apps > hash.design Affects the `hash.design` design site (app) labels Sep 14, 2026
@kostandinang
kostandinang added this pull request to stack #9720 September 14, 2026 17:15

@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.

@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.

kube
kube previously approved these changes Sep 15, 2026
@lunelson

Copy link
Copy Markdown
Contributor

Code review finding: MultipleVoiceIssues and CollapsedVoiceIssues put the second issue in notice, but the implementation collects durable issues only from errorMessage and warningMessage. As written, those fixtures contain one Voice issue, so the play assertion looking for Show 2 Voice issues cannot pass. Please change the second fixture value to warningMessage in both stories (or change the production classification if notice was intended to be durable).

@kostandinang
kostandinang force-pushed the kostandin/fe-1664-petrinaut-voice-platform branch from 0ea50ca to 3d9c011 Compare September 15, 2026 11:44
@kostandinang

kostandinang commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

@lunelson Addressed in 67e084f. Both MultipleVoiceIssues and CollapsedVoiceIssues now put the second durable issue in warningMessage, so the fixtures match the production classification and the Show 2 Voice issues assertion.

@lunelson lunelson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-reviewed the current remote head after the restack. The durable Voice issue stories now use warningMessage, matching production classification, and I found no remaining child-specific code issue. The parent Live autoplay concern remains owned by #9671.

@kostandinang
kostandinang removed this pull request from stack #9737 September 15, 2026 15:03
kostandinang and others added 3 commits September 15, 2026 17:04
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

@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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit aa77ecb. Configure here.

/>
<Button size="xs" variant="ghost" onClick={onDismiss}>
Dismiss Voice issues
</Button>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Dismiss drops keyboard focus

Low Severity

Dismiss Voice issues clears voiceAlerts and unmounts VoiceAlerts while focus is still in the portalled popover. That skips the popover onClose path and returnFocusRef, so the trigger is gone before focus can return to the dock.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit aa77ecb. Configure here.

An error occurred while trying to automatically change base from kostandin/fe-1663-experiment-live-full-duplex-migration to main September 15, 2026 15:14
@kostandinang
kostandinang merged commit 7d82856 into kostandin/fe-1663-experiment-live-full-duplex-migration Sep 15, 2026
51 of 53 checks passed
@kostandinang
kostandinang deleted the kostandin/fe-1664-petrinaut-voice-platform branch September 15, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps > hash.design Affects the `hash.design` design site (app) 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

Development

Successfully merging this pull request may close these issues.

3 participants