You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
chore: remove unused flush/endInput machinery from InterruptionStreamBase - #2558
Remove the dead flush pathway from InterruptionStreamBase: the InterruptionStreamSentinel.flush() static factory, the InterruptionStreamBase.flush() and InterruptionStreamBase.endInput() methods, and the unreachable chunk.type === 'flush' no-op branch in the audio transformer.
Changes Made
Removed InterruptionStreamSentinel.flush() static method (sole caller was the dead InterruptionStreamBase.flush()).
Removed InterruptionStreamBase.flush() (sole caller was the dead endInput()).
Removed InterruptionStreamBase.endInput() (no production or test callers; teardown goes through close()).
Removed the else if (chunk.type === 'flush') branch in the audio transformer (unreachable once the flush factory above is gone).
Kept the Flush import/re-export and the Flush interface in types.ts (backwards-compatibility re-exports per the "Exports only" guideline).
Context
InterruptionStreamBase.flush()/endInput() had no production callers anywhere (verified across agents/src/voice/audio_recognition.ts, interruption_detector.ts, and the broader voice/ tree). The only consumer of InterruptionStreamSentinel.flush() was the dead InterruptionStreamBase.flush(). Production teardown of an InterruptionStreamBase uses close() exclusively (see audio_recognition.ts:2190), which already closes the input stream, the WebSocket transport, and the resampler. Tests do not call flush()/endInput()/InterruptionStreamSentinel.flush() either.
Pre-Review Checklist
Build passes: All builds (lint, typecheck, tests) pass locally
AI-generated code reviewed: Removed unnecessary comments and ensured code quality
Changes explained: All changes are properly documented and justified above
Scope appropriate: All changes relate to the PR title, or explanations provided for why they are included
Video demo: N/A (internal dead-code removal)
Testing
Automated tests added/updated (if applicable) — not applicable; removing dead code with no behavior change.
All tests pass — pnpm vitest run src/inference/interruption/ (29/29) and downstream realtime_adaptive_interruption/audio_recognition_backchannel (34/34).
Make sure both restaurant_agent.ts and realtime_agent.ts work properly (for major changes) — N/A, no major change.
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Closing this pull request because it has had no human activity in 30 days (since 2026-09-22) and was opened 30 days ago. Detail closes its pull requests once they are more than 30 days old and have had no human activity for 14 days.
If this change is still useful, reopen the pull request and Detail won't close it again. To keep a Detail pull request open, add the detail-keep-open label to it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Remove the dead flush pathway from
InterruptionStreamBase: theInterruptionStreamSentinel.flush()static factory, theInterruptionStreamBase.flush()andInterruptionStreamBase.endInput()methods, and the unreachablechunk.type === 'flush'no-op branch in the audio transformer.Changes Made
InterruptionStreamSentinel.flush()static method (sole caller was the deadInterruptionStreamBase.flush()).InterruptionStreamBase.flush()(sole caller was the deadendInput()).InterruptionStreamBase.endInput()(no production or test callers; teardown goes throughclose()).else if (chunk.type === 'flush')branch in the audio transformer (unreachable once the flush factory above is gone).Flushimport/re-export and theFlushinterface intypes.ts(backwards-compatibility re-exports per the "Exports only" guideline).Context
InterruptionStreamBase.flush()/endInput()had no production callers anywhere (verified acrossagents/src/voice/audio_recognition.ts,interruption_detector.ts, and the broadervoice/tree). The only consumer ofInterruptionStreamSentinel.flush()was the deadInterruptionStreamBase.flush(). Production teardown of anInterruptionStreamBaseusesclose()exclusively (seeaudio_recognition.ts:2190), which already closes the input stream, the WebSocket transport, and the resampler. Tests do not callflush()/endInput()/InterruptionStreamSentinel.flush()either.Pre-Review Checklist
Testing
pnpm vitest run src/inference/interruption/(29/29) and downstreamrealtime_adaptive_interruption/audio_recognition_backchannel(34/34).restaurant_agent.tsandrealtime_agent.tswork properly (for major changes) — N/A, no major change.History
Additional Notes
AI model / prompt / tooling used: Detail: Dead Code
Dead Code PRs can be configured here.