{"record":{"id":"bc8295310f381a0f","repo":"NousResearch/hermes-agent","slug":"termux-api-command-package-detected-but-the-andro","errorCode":null,"errorMessage":"Termux:API command package detected, but the Android app is missing.\nInstall/update the Termux:API Android app, then retry /voice on.\nFallback: pkg install python-numpy portaudio && python -m pip install sounddevice","messagePattern":"Termux:API command package detected, but the Android app is missing\\.\nInstall/update the Termux:API Android app, then retry /voice on\\.\nFallback: pkg install python-numpy portaudio && python -m pip install sounddevice","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"cli.py","lineNumber":12890,"sourceCode":"        except Exception:\n            logger.debug(\"Edit diff preview failed for %s\", function_name, exc_info=True)\n\n    # ====================================================================\n    # Voice mode methods\n    # ====================================================================\n\n    def _voice_start_recording(self):\n        \"\"\"Start capturing audio from the microphone.\"\"\"\n        if getattr(self, '_should_exit', False):\n            return\n        from tools.voice_mode import create_audio_recorder, check_voice_requirements\n\n        reqs = check_voice_requirements()\n        if not reqs[\"audio_available\"]:\n            if _is_termux_environment():\n                details = reqs.get(\"details\", \"\")\n                if \"Termux:API Android app is not installed\" in details:\n                    raise RuntimeError(\n                        \"Termux:API command package detected, but the Android app is missing.\\n\"\n                        \"Install/update the Termux:API Android app, then retry /voice on.\\n\"\n                        \"Fallback: pkg install python-numpy portaudio && python -m pip install sounddevice\"\n                    )\n                raise RuntimeError(\n                    \"Voice mode requires either Termux:API microphone access or Python audio libraries.\\n\"\n                    \"Option 1: pkg install termux-api and install the Termux:API Android app\\n\"\n                    \"Option 2: pkg install python-numpy portaudio && python -m pip install sounddevice\"\n                )\n            raise RuntimeError(\n                \"Voice mode requires sounddevice and numpy.\\n\"\n                f\"Install with: {sys.executable} -m pip install sounddevice numpy\"\n            )\n        if not reqs.get(\"stt_available\", reqs.get(\"stt_key_set\")):\n            raise RuntimeError(\n                \"Voice mode requires an STT provider for transcription.\\n\"\n                \"Option 1: uv pip install faster-whisper  \"\n                \"(free, local; `pip install faster-whisper` also works if pip is on PATH)\\n\"","sourceCodeStart":12872,"sourceCodeEnd":12908,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/cli.py#L12872-L12908","documentation":"Raised when starting voice recording on Termux: check_voice_requirements() reports audio unavailable, the failure details mention the Termux:API Android app being missing, and the Termux:API command package IS installed. The Termux CLI tools exist but the companion Android app that actually grants microphone access does not, so mic capture cannot proceed.","triggerScenarios":"Running `/voice on` inside Termux after `pkg install termux-api` but without installing (or after breaking/updating away) the 'Termux:API' app from F-Droid/Play, or when the app is installed but Termux cannot bind to it.","commonSituations":"Installing the termux-api package but skipping the Android app; Play Store variant of Termux lacking permission to call the API app; app updated/disabled so `termux-microphone-record` fails.","solutions":["Install or update the 'Termux:API' Android app (F-Droid recommended, must match the Termux source)","Re-run `/voice on` after granting the app microphone permission","If the app cannot be fixed, fall back to Python audio: `pkg install python-numpy portaudio && python -m pip install sounddevice`"],"exampleFix":"# before (in Termux)\npkg install termux-api\n/voice on  # RuntimeError: Termux:API command package detected, but the Android app is missing.\n\n# after\n# install 'Termux:API' app from F-Droid, grant mic permission, then\n/voice on","handlingStrategy":"try-catch","validationCode":"from tools.voice_mode import check_voice_requirements\n\ndef termux_api_ready() -> bool:\n    reqs = check_voice_requirements()\n    return reqs[\"audio_available\"] or \"Termux:API\" not in reqs.get(\"details\", \"\")","typeGuard":null,"tryCatchPattern":"try:\n    cli._voice_start_recording()\nexcept RuntimeError as e:\n    if \"Termux:API Android app is missing\" in str(e):\n        prompt_user(\"Install the Termux:API app from F-Droid, then retry /voice on\")\n    else:\n        raise","preventionTips":["Always install the Termux:API Android app together with `pkg install termux-api`","Install the app from the same source (F-Droid vs Play) as Termux itself","Test with `termux-microphone-record 1` before relying on /voice"],"tags":["voice","termux","android","dependencies"],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}