Skip to content

feat(stt): add FakeSTT test harness for FallbackAdapter#1288

Open
drain-zine wants to merge 4 commits intolivekit:mainfrom
lottiehq-oss:feat/stt-fake-harness
Open

feat(stt): add FakeSTT test harness for FallbackAdapter#1288
drain-zine wants to merge 4 commits intolivekit:mainfrom
lottiehq-oss:feat/stt-fake-harness

Conversation

@drain-zine
Copy link
Copy Markdown
Contributor

@drain-zine drain-zine commented Apr 22, 2026

Description

Ports Python's tests/fake_stt.py to TypeScript at agents/src/stt/testing/fake_stt.ts, exposed under stt.testing (mirrors voice.testing.FakeLLM). Follow-up to #1278 — gives STT tests the reusable harness the Python side already has.

Changes Made

  • New agents/src/stt/testing/fake_stt.ts: FakeSTT, FakeRecognizeStream, FakeUserSpeech, RecognizeSentinel, speedUpFakeUserSpeech. Scripted fakeException / fakeTranscript / fakeTimeoutMs, mid-test updateOptions(), recognizeCh + streamCh observability channels, sendFakeTranscript() injection, and timed user-speech emission anchored to the first pushed frame.
  • agents/src/stt/index.ts — re-exports testing subpath.
  • agents/src/stt/fallback_adapter.test.ts — rewritten onto the harness; inline MockSTT/MockSpeechStream removed. One new parity test ported from Python's test_stt_recover: flips a failed instance via updateOptions() and asserts the
    recovery probe marks it available.

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're included
  • Video demo: N/A, internal test infrastructure only

Testing

  • Automated tests added/updated (if applicable)
  • All tests pass
  • Make sure both restaurant_agent.ts and realtime_agent.ts - N/A, no runtime code paths touched

Note to reviewers: Please ensure the pre-review checklist is completed before starting your review.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 22, 2026

🦋 Changeset detected

Latest commit: 12cbbd9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 26 packages
Name Type
@livekit/agents Major
@livekit/agents-plugin-anam Major
@livekit/agents-plugin-assemblyai Major
@livekit/agents-plugin-baseten Major
@livekit/agents-plugin-bey Major
@livekit/agents-plugin-cartesia Major
@livekit/agents-plugin-cerebras Major
@livekit/agents-plugin-deepgram Major
@livekit/agents-plugin-elevenlabs Major
@livekit/agents-plugin-google Major
@livekit/agents-plugin-hedra Major
@livekit/agents-plugin-inworld Major
@livekit/agents-plugin-lemonslice Major
@livekit/agents-plugin-livekit Major
@livekit/agents-plugin-mistral Major
@livekit/agents-plugin-neuphonic Major
@livekit/agents-plugin-openai Major
@livekit/agents-plugin-phonic Major
@livekit/agents-plugin-resemble Major
@livekit/agents-plugin-rime Major
@livekit/agents-plugin-runway Major
@livekit/agents-plugin-sarvam Major
@livekit/agents-plugin-silero Major
@livekit/agents-plugins-test Major
@livekit/agents-plugin-trugen Major
@livekit/agents-plugin-xai Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

devin-ai-integration[bot]

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant