{"record":{"id":"95fec2857c3b679f","repo":"babysor/MockingBird","slug":"kokoro-tts-cli-not-found","errorCode":null,"errorMessage":"kokoro-tts CLI not found.","messagePattern":"kokoro-tts CLI not found\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","filePath":"skills/speak/scripts/render_timeline.py","lineNumber":312,"sourceCode":"        if ref_cleanup is not None:\n            ref_cleanup.unlink(missing_ok=True)\n\n    if resp.status_code != 200:\n        raise RuntimeError(\n            f\"/text-to-speech cue {cue.index}: \"\n            f\"status={resp.status_code}, body={resp.text}\"\n        )\n    out_path.write_bytes(resp.content)\n    dur_h = resp.headers.get(\"X-Audio-Duration\")\n    return float(dur_h) if dur_h else -1.0\n\n\n# ── Kokoro backend ───────────────────────────────────────────────────\n\n\ndef _ensure_kokoro() -> None:\n    if not shutil.which(\"kokoro-tts\"):\n        raise RuntimeError(\"kokoro-tts CLI not found.\")\n\n\ndef _kokoro_tts(\n    cue: Cue,\n    cfg: Dict[str, Any],\n    output_format: str,\n    out_path: Path,\n) -> float:\n    with tempfile.NamedTemporaryFile(\n        mode=\"w\", suffix=\".txt\", delete=False, encoding=\"utf-8\"\n    ) as tmp:\n        tmp.write(cue.text)\n        tmp_path = tmp.name\n\n    try:\n        cmd = [\"kokoro-tts\", tmp_path, str(out_path)]\n        voice = cfg.get(\"voice\")\n        if voice:","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/babysor/MockingBird/blob/28dc5e14f12d7c754612af2fde8e78a4b03f8616/skills/speak/scripts/render_timeline.py#L294-L330","documentation":"RuntimeError raised by _ensure_kokoro when the kokoro-tts CLI is not on PATH. The Kokoro local TTS backend shells out to this binary for every cue, so its absence is fatal for that backend.","triggerScenarios":"Selecting the kokoro backend in the timeline config without having installed the kokoro-tts CLI, or running in an environment where its install dir isn't on PATH.","commonSituations":"Fresh machine, virtualenv where kokoro-tts was installed in a different env, or CI container missing the tool.","solutions":["pip install kokoro-tts (or the documented package) into the active environment","Verify: which kokoro-tts","Or switch the timeline config's backend to noiz","Activate the correct virtualenv before running render_timeline"],"exampleFix":"# before\n$ python render_timeline.py ...  # backend kokoro, CLI missing\n# after\n$ pip install kokoro-tts && which kokoro-tts\n$ python render_timeline.py ...","handlingStrategy":"validation","validationCode":"import shutil\nif backend == 'kokoro' and not shutil.which('kokoro-tts'):\n    sys.exit('kokoro-tts CLI not installed; run pip install kokoro-tts')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install the CLI in the active venv","Check backend availability at startup","Fall back to noiz backend if kokoro missing"],"tags":["environment","dependency","kokoro","tts","path"],"backgroundTag":"missing-system-dependency","analyzedSha":"28dc5e14f12d7c754612af2fde8e78a4b03f8616","analyzedAt":"2026-08-27T02:26:53.589Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}