Skip to content

FE-1800: Simplify Live filter stages and remove unused voice history state - #9921

Merged
lunelson merged 1 commit into
mainfrom
ln/voice-review-follow-ups
Oct 6, 2026
Merged

lunelson merged 1 commit into
mainfrom
ln/voice-review-follow-ups

Conversation

@lunelson

@lunelson lunelson commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

🌟 What is the purpose of this PR?

This PR settles four optional review follow-ups from the merged Live voice stack. Live voice behaves the same. One development trace changes shape: filter.shadow now records only the skip reason, because the stage name always matched it. The other changes remove unused history state, merge two tests with the same setup, and correct a comment that called load-bearing audio sampling optional.

🔗 Related links

🔍 What does this change?

  • Each utterance-pipeline stage declares the reason it skips with, and its skips check returns a boolean. filter.shadow traces carry inputId and reason, without the duplicate stage key. The website README's speaker-echo check now refers to reason.
  • VoiceMediationHistory drops the anchorOnly turn field. Nothing on main or in FE-1789: Experiment with end-to-end Brunch Voice steering #9826 sets it. Saved browser history still loads, because the schema strips unknown keys.
  • The comment on the Live stats sampler says a failed sample reads as inaudible output, and that the short-during-output filter and echo checks depend on this sampling. It previously called the sampling optional telemetry.
  • One test checks startedDuringOutput and liveOutputText for a muted speaker and zero volume. It replaces two tests that built the same speaker matrix.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 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: the website README's speaker-echo check

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

The changes in this PR:

  • do not affect the execution graph

⚠️ Known issues

None. Traces recorded before this change also carry reason, so earlier speaker-echo sessions still compare with new ones.

🐾 Next steps

The speaker-echo check still has to show what GPT-Live does while a deferred delegation stays open (#9862). The result decides whether deferred delegations need a timeout.

🛡 What tests cover this?

  • The 19 voice-interview test files and use-voice-mediation-history.test.ts pass: 540 tests.
  • oxfmt passes on the changed files. Locally, tsgo and oxlint report errors only in files this PR does not touch, and main reports the same 15 type errors. CI runs the full checks.

❓ How to test this?

  1. In apps/petrinaut-website, run yarn vitest run src/main/app/voice-interview.
  2. Optionally, run Live voice on laptop speakers, filter the Verbose console by [Petrinaut Live trace], and let speaker echo produce a phantom. Its filter.shadow lines show reason and no stage.

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

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

Request Review

@cursor

cursor Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Refactors filter stage plumbing and trace shape without changing skip rules; removes dead anchorOnly persistence with backward-compatible schema parsing.

Overview
This PR simplifies Live utterance filtering and trims unused voice-history state; runtime voice behavior is unchanged except for the shape of dev filter.shadow traces.

Utterance pipeline: Each filter stage now declares its skip reason and a boolean skips predicate instead of a separate name and skip that returned a reason. Shadow diagnostics log only inputId and reason (the redundant stage field is dropped). The website README’s speaker-echo section documents filter.shadow with reason.

Voice mediation history: The unused anchorOnly turn field is removed from the schema and from what gets loaded or persisted; older saved history still loads because unknown keys are stripped.

Live conversation: The comment on failed WebRTC getStats sampling now states that a failed sample is treated as inaudible output (which the short-during-output and echo logic depend on), rather than “optional telemetry.” Tests merge two duplicate muted/zero-volume speaker cases into one case that asserts both startedDuringOutput and liveOutputText.

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

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

Nice improvement.

  • Agreed anchorOnly is safe to drop; nothing on main ever set it.
  • One fixed reason per stage means a stage can't return different reasons anymore. That's fine today, but the TypeSafe gate in #9816 has several outcomes. If we move it into the pipeline later, would you add one stage per outcome?
  • #9899 adds a stage using the old name/skip shape. I'll update it on my side.

@lunelson

lunelson commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

I'd keep it as one step that returns its category, not one stage per outcome. So one judge call per stage. #9816 runs it after the synchronous stages, and moving it inside would make the pipeline async, which reshapes the stage type anyway. Until then every stage has exactly one, so the fixed reason fits, I think.

@lunelson lunelson changed the title Simplify Live filter stages and remove unused voice history state FE-1800: Simplify Live filter stages and remove unused voice history state Oct 6, 2026
@lunelson
lunelson requested a review from kube October 6, 2026 07:52
@lunelson
lunelson enabled auto-merge October 6, 2026 07:52
@lunelson
lunelson added this pull request to the merge queue Oct 6, 2026
Merged via the queue into main with commit 55ac87b Oct 6, 2026
54 of 55 checks passed
@lunelson
lunelson deleted the ln/voice-review-follow-ups branch October 6, 2026 09:27

This branch was successfully deployed

3 active deployments
Preview – petrinaut-docs — 0d155e7c Deployed Oct 5, 2026 by vercel[bot]
Preview – hash — 0d155e7c Deployed Oct 5, 2026 by vercel[bot]
Preview – petrinaut — 0d155e7c Deployed Oct 5, 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)

Development

Successfully merging this pull request may close these issues.

3 participants