Skip to content

fix(listen): enforce globally bounded Parakeet routing and fallback - #10070

Merged
Git-on-my-level merged 2 commits into
BasedHardware:mainfrom
Git-on-my-level:fix/parakeet-routing-admission
Jul 20, 2026
Merged

Git-on-my-level merged 2 commits into
BasedHardware:mainfrom
Git-on-my-level:fix/parakeet-routing-admission

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Supersedes the accidental off-scope PR head and repairs the live-transcription routing incident at the provider boundary.

  • Makes Modulate Velma-2 the checked-in, rendered, production primary for streaming, prerecorded, and PTT STT.
  • Moves the hard admission gate to the single Parakeet GPU service instance, so 19+ backend-listen replicas share one capacity limit.
  • Makes Parakeet capacity/allocation explicit deployment settings, validated in runtime contracts; invalid/missing settings fail Parakeet startup rather than silently changing behavior.
  • Releases admission leases on every session termination path and provides a readiness handshake so failed Parakeet connections fall back safely to Modulate.
  • Adds a bounded provider circuit breaker for unhealthy Parakeet connection failures.

Root cause and durable guard

Parakeet became the global first-choice STT provider while it could safely serve only one bounded GPU pool. Per-listener admission could not protect that shared pool. The durable owner is now the Parakeet service itself: it enforces the global service cap before constructing a stream, and clients fail over to Modulate when admission or connection fails.

Verification

283 focused repair tests passed
687 selected backend test files passed
backend preflight: 17 passed
make preflight: 25/25 checks passed
rendered dev/prod runtime contract validators passed
git diff --check passed

Failure class

Failure-Class: FC-split-mutation-authority

Follow-up / rollout

This PR changes source and deployment contracts only. It does not deploy or merge automatically. Before a production rollout, validate bounded real traffic: capacity denial and unhealthy Parakeet must route to Modulate, and the active-stream cap must remain below the configured Parakeet service capacity.

@Git-on-my-level
Git-on-my-level force-pushed the fix/parakeet-routing-admission branch from 70a140e to 93c1df3 Compare July 20, 2026 01:26
@Git-on-my-level Git-on-my-level changed the title fix(listen): enforce durable live-STT routing policy with Parakeet admission control (#10048) fix(listen): enforce globally bounded Parakeet routing and fallback Jul 20, 2026
…mission control (BasedHardware#10048)

Failure-Class: none

Modulate Velma-2 is the explicit safe primary for all STT surfaces
(streaming, pre-recorded, PTT). Parakeet is the bounded-capacity
secondary, gated by a new admission controller before connection
attempt.

Changes:
- Reorder DEFAULT_MODELS_BY_SURFACE: modulate-velma-2 first, parakeet second
- Add config/parakeet_admission.py: try_admit/release with concurrent cap
  (PARAKEET_MAX_CONCURRENT, default 30) and allocation percentage
  (PARAKEET_ALLOCATION_PCT, default 100, read at request time)
- Wire admission gate in get_stt_service_for_language; denied requests
  fall through to Modulate with low-cardinality fallback telemetry
- Add capacity_full/allocation_zero/allocation_rejected to ALLOWED_REASONS
- Call release() in both ParakeetStreamingSocket.drain_and_close and
  ParakeetWebSocketSocket.drain_and_close for counter safety
- Add 24 focused unit tests covering: retired-provider safety,
  capability mismatch, allocation states (0/canary/100), capacity
  exhaustion, config-incomplete health fallback, and telemetry reason
  validity
- Update existing Deepgram serving-disabled and backoff tests for new
  Modulate-primary ordering
- Add traffic-only mitigation runbook (docs/runbooks/)

Verification:
  103 tests passed in 0.96s (test_parakeet_admission + test_deepgram_serving_disabled + test_streaming_deepgram_backoff)
  make preflight: 9/9 checks passed
  No new orphaned TODO/FIXME markers
@Git-on-my-level
Git-on-my-level force-pushed the fix/parakeet-routing-admission branch from 943c97f to 1d59063 Compare July 20, 2026 04:28
Move live-stream admission to the Parakeet GPU owner, make the deployed Modulate-first route deterministic, and cover construction fallback plus teardown ownership across listen and PTT paths.

Failure-Class: FC-split-mutation-authority
@Git-on-my-level
Git-on-my-level force-pushed the fix/parakeet-routing-admission branch from 1d59063 to 093b880 Compare July 20, 2026 04:37
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Rebased onto latest main and fixed all three previously failing checks.

  • Backend unit suite: fixed two pyright reportPrivateUsage errors. Renamed StreamAdmissionController._release → release_lease (the lease is the designated caller) and _validate_parakeet_admission_contract → validate_parakeet_admission_contract (imported validation contract).
  • Hermetic Backend E2E + Listen Pusher Stack Gauntlet: updated the Parakeet test peers (ScriptedParakeetPeer, parakeet_stub.py) to send the {"type": "ready"} admission frame that the production ParakeetWebSocketSocket now waits for during its startup handshake. Updated the fake STT socket's drain_and_close to call finish() so teardown observability stays consistent with production drain behavior.
  • Desktop Swift / Hygiene: restored executable mode on prepare-qualification-profile.sh and added a desktop changelog fragment.

All CI checks now pass: Backend unit suite, Hermetic Backend E2E, Listen Pusher Stack Gauntlet, Sync Cloud Tasks Stack Gauntlet, Hygiene, Desktop Swift CI.

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