{"record":{"id":"43ccb244a13c6ac0","repo":"tinyhumansai/openhuman","slug":"audio-blob-is-empty","errorCode":null,"errorMessage":"audio blob is empty","messagePattern":"audio blob is empty","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/features/human/voice/sttClient.ts","lineNumber":82,"sourceCode":"interface CloudTranscribeResult {\n  text: string;\n}\n\n/**\n * Transcribe a recorded audio blob via the Rust core's cloud STT proxy.\n *\n * The blob is read into a base64 string and shipped over JSON-RPC; the core\n * decodes it and POSTs `multipart/form-data` to the hosted backend's\n * `/openai/v1/audio/transcriptions` endpoint. Going through the core keeps\n * the provider API key off the desktop app and reuses the same auth flow as\n * `synthesizeSpeech`.\n */\nexport async function transcribeCloud(\n  blob: Blob,\n  opts: CloudTranscribeOptions = {}\n): Promise<string> {\n  if (!blob || blob.size === 0) {\n    throw new Error('audio blob is empty');\n  }\n  const encodeStart = Date.now();\n  const audio_base64 = await blobToBase64(blob);\n  const encodeMs = Math.round(Date.now() - encodeStart);\n\n  const params: Record<string, unknown> = { audio_base64 };\n  // MediaRecorder mime types include codec parameters (e.g. `audio/webm;codecs=opus`)\n  // — the backend's allow-list expects the bare type, so strip the suffix.\n  const mime = (opts.mimeType ?? blob.type ?? 'audio/webm').split(';')[0].trim() || 'audio/webm';\n  params.mime_type = mime;\n  params.file_name = opts.fileName ?? `audio.${guessExtension(mime)}`;\n  if (opts.model) params.model = opts.model;\n  if (opts.language) params.language = opts.language;\n\n  sttLog(\n    'transcribe bytes=%d mime=%s base64_ms=%d (b64_size=%d)',\n    blob.size,\n    mime,","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/app/src/features/human/voice/sttClient.ts#L64-L100","documentation":"Argument-loop error from `openhuman memory docs` (alias `list`). The subcommand accepts only `--namespace/-n` (with a value), `-v/--verbose`, and `-h/--help`. Any other token — an unknown flag or a positional — aborts with this message.","triggerScenarios":"`openhuman memory docs --json`; `openhuman memory docs default` (positional namespace is not accepted — it must be `--namespace default`); `openhuman memory list -a`.","commonSituations":"Assuming a JSON output flag exists; passing the namespace positionally out of habit from other tools; scripts written against a different CLI's docs command.","solutions":["Use `--namespace <ns>` instead of a positional: `openhuman memory docs --namespace default`","Drop unsupported flags (-v is the only extra one besides --namespace)","Run `openhuman memory docs --help` for the exact usage line"],"exampleFix":"# before\nopenhuman memory docs default\n# after\nopenhuman memory docs --namespace default","handlingStrategy":"validation","validationCode":"# bash: docs accepts only --namespace <v>, -v, -h\nfor a in \"$@\"; do\n  case \"$a\" in\n    --namespace|-n|-v|--verbose|-h|--help) ;;\n    -*) echo \"unknown docs arg: $a\" >&2; exit 2 ;;\n    *) echo \"positional not accepted; use --namespace '$a'\" >&2; exit 2 ;;\n  esac\ndone\nopenhuman memory docs \"$@\"","typeGuard":null,"tryCatchPattern":"if ! out=$(openhuman memory docs \"$@\" 2>&1); then\n  case \"$out\" in *\"unknown docs arg\"*) openhuman memory docs --help >&2; exit 2;; esac\n  printf '%s\\n' \"$out\" >&2; exit 1\nfi","preventionTips":["Wrap the CLI in a small typed wrapper that maps positional namespaces to --namespace"],"tags":["cli","usage","argument-parsing","memory"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}