Repository navigation
v1.2.2
Release v1.2.2 - WhisperX Process Isolation, CUDA/OpenVINO Conflict Fix, and a Real-Backend E2E Test Layer
This release isolates WhisperX into its own subprocess to resolve a hard dependency-version conflict, fixes a real CUDA/OpenVINO mixed-context crash/hang on Intel iGPU hardware, closes the one remaining gap in dashboard JS test coverage, and adds a second, real-backend Playwright test layer that runs the dashboard, analytics, /docs, and the Bazarr/OpenAI-compatible API against the actual FastAPI app instead of a mock. That real-backend layer surfaced two genuine, previously-undetected bugs, both fixed here.
Highlights
WhisperX Process Isolation (Architecture Change)
whisperxis no longer imported in the main service process. WhisperX 3.8.6 hard-pins a torch/torchaudio/torchvision/huggingface-hub stack incompatible with the rest of the application's dependency versions, and that stack cannot be safely reloaded inside one live interpreter.- New
modules/inference/engines/whisperx_worker.py(child-process entrypoint, spawned viamultiprocessing.get_context("spawn")against an isolated install atWHISPERX_LIB_PATH; app__main__and package inits are spawn-safe so the child does not import the main torch stack before isolation) andwhisperx_worker_client.py(parent-side, lock-serialized client that lazily owns the worker; RPC deadline disabled by default viaWHISPERX_WORKER_CALL_TIMEOUT_SEC=0) replace direct in-processwhisperx.*calls inwhisperx_engine.pyanddiarization.py. ALIGN_POOL/DIARIZE_POOLstill track per-hardware-unit handles in the main process; the underlying models now live in the worker. Idle cleanup andunload_models()shut down and respawn the worker to actually reclaim VRAM/RAM, rather than dropping in-process references. AWhisperXWorkerErrorfalls back to unlabeled segments instead of failing the whole transcription.whisperxhas been removed frompyproject.tomlentirely; it's installed only inside the Dockerfile's isolated/app/libs/whisperxstage.
Bug Fixes
- CUDA + OpenVINO mixed-context crash/hang on Intel iGPU. Eager per-unit preprocessing-manager construction could poison the CUDA-capable
onnxruntimemodule by initializing an OpenVINO execution provider in the same process.modules/core/config.pynow forcesPREPROCESS_DEVICEtoCUDAwheneverDEVICE == "CUDA"and preprocessing would otherwise resolve to GPU/NPU/Intel/OpenVINO;modules/inference/pipeline/preprocessing/__init__.pyandprovider.pyadd matching guards (_ensure_openvino_onnxruntimeskipped outright on CUDA, on-disk OpenVINO cache dropped for GPU/NPU providers, plus a last-resort_block_openvino_alongside_cudaredirect) so no code path can still trigger the conflict. - torch/torchvision import race on startup. UVR's per-request
onnxruntimemodule reload could interleave with torchvision's first import from a request-handling thread, intermittently producingoperator torchvision::nms does not existerrors.whisper_pro_asr.pynow importstorch/torchvisiononce, single-threaded, during app startup (_warm_up_torch_stack()) before any request thread can race it. response_format=text/response_format=verbose_jsonsilently downgraded to SRT. The OpenAI-compatible/v1/audio/transcriptionsand/v1/audio/translationsendpoints only recognized{json, vtt, txt, tsv, srt}foroutput/response_format; a spec-following client requesting the documentedtextorverbose_jsonvalues got SRT-formatted output instead.modules/api/routes/asr.pynow aliasestext→txtandverbose_json→json.promptsilently dropped on the OpenAI-compatible endpoints. The official OpenAI SDKs (and any spec-following client) sendprompt; the route only ever readinitial_prompt, so a caller's prompt was accepted with a 200 and then ignored.promptis now accepted as an alias, withinitial_promptstill taking precedence when both are sent.
Test Coverage — Dashboard JS, Bazarr/OpenAI Contract Research, and a Real-Backend E2E Layer
- Closed the last dashboard JS coverage gap:
modules/monitoring/templates/dashboard/features/audit.js(caller-info panel rendering, JSON normalization, media-path stripping) andfeatures/runtime.js(theupdateStats()polling loop: top stats, telemetry buffering, hardware-pool rendering and kind inference) previously had zero unit or e2e coverage. Addedtests/js/dashboard_audit.test.js(23 tests) andtests/js/dashboard_runtime.test.js(29 tests). - Bazarr wire-format audit against Bazarr's actual source. Read
morpheus65535/bazarr's real provider (subliminal_patch/providers/whisperai.py) directly rather than assuming from this repo's own prior test naming. Finding: real Bazarr never sendslocal_path— it always uploads pre-encoded raws16le/16kHz/mono PCM as a multipartaudio_file, withencode=false,task,language,output=srt, and an optionalvideo_file(caller metadata only). This repo'slocal_pathtests cover a real, intentional optimization this codebase separately supports, but were previously the de facto stand-in for "how Bazarr talks to us" — now re-labeled, and a newTestRealBazarrWireFormatclass intests/integration/test_bazarr_wire_format.pycovers the actual multipart/raw-PCM contract. - OpenAI
/v1/audio/*contract audit against OpenAI's documented API reference. Cross-checked every documented request field (file,model,language,prompt,response_formatand all 5 spec values,temperature,timestamp_granularities[],stream) against the route implementation; the two real bugs above were found this way, along with the path-based task-inference logic (/v1/audio/translationsforcingtask=translateregardless of an explicittaskparam). ~30 new integration tests added covering the full parameter matrix, alias equivalence across/asr//v1/audio/transcriptions//v1/audio/translations,filevsaudio_filefield-name precedence, and alocal_pathaccess-control/path-traversal test. - New real-backend Playwright layer (
tests/e2e/real/,npm run test:e2e:real): boots the actual FastAPI app (tests/e2e/real_backend/serve_real_app.py) with only ASR inference and language-detection voting patched to deterministic fakes — routing,history_manager,telemetry_manager, settings persistence, and the auth/admin-key middleware all run for real. 18 tests cover the full task lifecycle (a real/v1/audio/transcriptionssubmission through active-tasks → history → analytics), the Bazarr multipart wire format, settings persistence, auth (missing/wrong/correct admin key), the/docsSwagger UI (previously only string-asserted at the backend level, never loaded in a browser), and responsive/dark-theme rendering at the dashboard's real CSS breakpoints (768px/600px/480px), none of which any prior e2e spec exercised. - This real-backend layer is what surfaced the two response-format/prompt bugs above — bugs invisible to the existing fixture-mock e2e suite, which mocks the backend round trip rather than validating it.
- Dashboard settings tab rehydrates from the backend on open. Opening Settings calls
loadRetentionSettings()which GETs/system/settingsand appliesTELEMETRY_RETENTION_HOURS/LOG_RETENTION_DAYSto the sliders (and labels). Real-backend e2e asserts the values survive a full-page reload.
Design Gaps Flagged for Follow-Up (Not Implemented This Release)
npm run quality:frontendruns the fixture-mock Playwright project but not the new real-backend one; real-backend E2E must run through the Docker test image pipeline (Dockerfile.testtargettest, orscripts/ci/build-and-test.sh/scripts/ci/build-and-test.ps1, which invoketests/run_suite.shwith optionalSKIP_REAL_E2E=1). Do not run host-sidenpm run test:e2e:realas a quality gate.
Documentation Accuracy
docs/API.md: documented theprompt→initial_promptandresponse_format→outputaliases (including thetext/verbose_jsonvalue mappings) and the OpenAI SDK compatibility fields (model,temperature,timestamp_granularities[],stream) that are accepted-but-ignored.docs/ARCHITECTURE.md: added the WhisperX process-isolation explanation to the diarization pipeline section and the two new worker files to the source-tree listing.README.md: documented the newnpm run test:e2e:realreal-backend Playwright layer alongside the existing fixture-mocknpm run test:e2e..agent/skills/quality/frontend_quality_gates_skill.md: added the real-backend Playwright gate and noted it isn't yet folded into thequality:frontendaggregate script.- Audited
docs/SETUP.mdanddocs/DOCKERHUB_DESCRIPTION.mdagainst every production-code change in this release. Found and fixed two real gaps during a follow-up review pass:docker-compose.yml's commented Windows/WSL2 Intel block was missing thepid: host/privileged: true/cap_add/sysfsmounts thatdocs/SETUP.md's telemetry note already claimed it documented (added them, matching the equivalentdocker runflags already shown in SETUP.md); and theHOST_INTEL_RENDER_GIDderivation comment (docker-compose.yml,docs/SETUP.md,docs/DOCKERHUB_DESCRIPTION.md) pipedstat -c '%g' /dev/dri/renderD*— which can print multiple lines on multi-GPU hosts — into a scalargroup_addentry; all three now derive a single GID (| head -n 1, matching the pattern the AMD section already used correctly). docs/SETUP.md's Docker Hub quickstart command unconditionally required/dev/dri//dev/accelandstat-ed/dev/dri/renderD128directly, which fails outright on NVIDIA/AMD/CPU-only hosts despite the Prerequisites section listing those as supported. Split into a CPU-only default command (works everywhere) and a separate Intel-hardware variant.
Dependency Changes
- Main:
fastapi0.139.2→0.141.1,uvicorn0.51.0→0.52.4. - ML group:
torch2.8.0→2.13.0,torchaudio2.8.0→2.11.0,torchvision0.23.0→0.28.0,transformers4.48.3→5.15.1 (major),huggingface-hub0.36.2→1.28.0 (major),tokenizers0.21.4→0.22.2; NVIDIA CUDA runtime libs migrated cu12→cu13.librosaheld at 0.11.0 andopenvinoheld at 2026.2.1 deliberately (upgrading either regresses a dependency or the Intel iGPU GPU plugin, per in-repo comments); new explicitaudioreadpin sincelibrosano longer pulls it in transitively. whisperxremoved frompyproject.toml/poetry.lock— now installed only inside the Dockerfile's isolated worker stage, not the main dependency set.
Verification
Docker-parity full CI gate (scripts/ci/build-and-test.sh) — required (not optional) for this release given the ML dependency version bumps, and was run to completion in a follow-up pass:
- Backend:
pytest(with coverage) — 1342 passed, 0 failed. Coverage gate (tests/check_coverage.py, threshold 90%) — 96.21% total, every individual file at or above the 90% per-file floor. - Coverage badge regenerated (
assets/coverage.svg). - Lint/format: Black, isort, Ruff (check + format), Flake8, Pylint — all clean, Pylint 10.00/10 (verified by exit code, not just the displayed score, after this pass also found and fixed several genuine bugs the gate itself doesn't check for — see below).
- Complexity: Radon cyclomatic complexity, rank-A enforced repo-wide — zero violations.
- Security/audit: Bandit,
pip-audit,gitleaks,npm audit(low threshold),check-inline-ignores.py(zero-suppression policy) — zero findings. - Markdown/config/shell lint: markdownlint, yamllint (strict), shfmt, ShellCheck, Hadolint, PSScriptAnalyzer, actionlint, HTMLHint/html-validate — all clean.
- Frontend: Vitest, fixture-mock Playwright, and the real-backend Playwright project all green inside the container.
Bugs found and fixed getting the Docker-parity gate green (none were caught by the native runs above, underscoring why the container gate is required, not optional, for a release touching this many dependency/runtime boundaries): a pre-existing 126-char docker-compose.yml comment line failing yamllint's strict mode before any test could run; Black-formatting drift in two test files; a Python-patch-version-specific inspect.getsource() fragility in a concurrency test helper (3.13.15 in the CI container vs. 3.13.13 used natively) — fixed by reading source directly from the file instead of via the loader; a mock.patch() silently clobbered by importlib.reload() in a settings-fallback test — fixed by mocking the lower-level primitives instead of the reloaded module's own redefined name; stale host __pycache__ directories leaking into the Docker build context despite .dockerignore; and 6 real cyclomatic-complexity violations (genuine refactors: extracted helper functions, not just complexity-suppression).