Skip to content

FE-1664: Preserve Live Brunch recovery turns across repeated errors - #9746

Merged
kostandinang merged 1 commit into
mainfrom
kostandin/fe-1664-live-error-edge
Sep 15, 2026
Merged

kostandinang merged 1 commit into
mainfrom
kostandin/fe-1664-live-error-edge

Conversation

@kostandinang

@kostandinang kostandinang commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

🌟 What is the purpose of this PR?

Fix a case where a new voice request is dropped after Brunch reports an error. Repeated updates with the same error status currently interrupt the new request, even if its submission is already in progress.

The bridge should interrupt existing turns when Brunch enters error, then allow later requests to recover normally.

🔗 Related links

🚫 Blocked by

🔍 What does this change?

  • Interrupts pending turns only when the status changes to error, rather than on every error update.
  • Keeps a new recovery turn through repeated error updates and offers its completed response to Live once Brunch returns to ready.
  • Adds regression tests for error interruption and recovery. Stop behavior is unchanged, and its existing tests still pass.

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

Only the private @apps/petrinaut-website application changes, so no changeset is needed.

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

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

The changes in this PR:

  • do not affect the execution graph

⚠️ Known issues

None known for this fix.

🐾 Next steps

No further changes are planned as part of this fix.

🛡 What tests cover this?

The new tests check that entering error interrupts pending work once and prevents its late result from being offered to Live. They also check that a recovery turn survives repeated error updates before and after admission, is offered exactly once after ready, and that a later transition into error interrupts again.

The recovery test fails on the original implementation and passes with this fix. Local verification passed with Node 22.21.1 and Yarn 4.16.0:

  • Bridge tests: 45 passed, including the existing Stop tests.
  • Website unit tests: 796 passed across 64 files.
  • Website build, TypeScript checks, and ESLint task: passed. The lint:eslint task uses type-aware Oxlint.
  • Repository formatting check and git diff --check: passed.

❓ How to test this?

  1. Check out this branch and install dependencies.

  2. Run the focused regression tests:

    yarn workspace @apps/petrinaut-website test:unit src/main/app/voice-interview/live-brunch-bridge.test.ts
  3. Run the website checks and formatting check:

    npx turbo run build test:unit lint:tsc lint:eslint --filter @apps/petrinaut-website --output-logs errors-only
    yarn lint:format

📹 Demo

Not applicable. This changes internal turn handling, with no visual changes.

@vercel

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

Request Review

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@cursor

cursor Bot commented Sep 15, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes when live voice turns are interrupted and when Brunch answers are offered to Live during error recovery, with subtle user-facing impact if wrong.

Overview
Fixes recovery voice requests being dropped when Brunch keeps reporting error: LiveBrunchBridge.update now calls #interruptTurns only on the first transition into error (same edge-triggered pattern as stopped), so repeated error snapshots no longer clear an in-flight recovery turn.

After recovery completes, commentary is still withheld while status stays error and is offered once when chat returns to ready. A later fresh error transition interrupts again as before.

Two regression tests cover one-shot interruption with suppressed late results, and recovery surviving duplicate error updates through settlement.

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

lunelson
lunelson previously approved these changes Sep 15, 2026
Base automatically changed from kostandin/fe-1664-land-voice-stack to main September 15, 2026 16:29
@kostandinang
kostandinang dismissed lunelson’s stale review September 15, 2026 16:29

The base branch was changed.

@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 15, 2026
Co-authored-by: Kostandin Angjellari <ka@hash.ai>
@kostandinang
kostandinang force-pushed the kostandin/fe-1664-live-error-edge branch from bdaa04f to 5bbe1a9 Compare September 15, 2026 16:38
@github-actions github-actions Bot removed 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 15, 2026
@kostandinang
kostandinang added this pull request to the merge queue Sep 15, 2026
Merged via the queue into main with commit 00d9c4a Sep 15, 2026
49 checks passed
@kostandinang
kostandinang deleted the kostandin/fe-1664-live-error-edge branch September 15, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants