tinyhumansai/openhuman · error

audio blob is empty

Error message

audio blob is empty

What it means

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.

Source

Thrown at app/src/features/human/voice/sttClient.ts:82

interface CloudTranscribeResult {
  text: string;
}

/**
 * Transcribe a recorded audio blob via the Rust core's cloud STT proxy.
 *
 * The blob is read into a base64 string and shipped over JSON-RPC; the core
 * decodes it and POSTs `multipart/form-data` to the hosted backend's
 * `/openai/v1/audio/transcriptions` endpoint. Going through the core keeps
 * the provider API key off the desktop app and reuses the same auth flow as
 * `synthesizeSpeech`.
 */
export async function transcribeCloud(
  blob: Blob,
  opts: CloudTranscribeOptions = {}
): Promise<string> {
  if (!blob || blob.size === 0) {
    throw new Error('audio blob is empty');
  }
  const encodeStart = Date.now();
  const audio_base64 = await blobToBase64(blob);
  const encodeMs = Math.round(Date.now() - encodeStart);

  const params: Record<string, unknown> = { audio_base64 };
  // MediaRecorder mime types include codec parameters (e.g. `audio/webm;codecs=opus`)
  // — the backend's allow-list expects the bare type, so strip the suffix.
  const mime = (opts.mimeType ?? blob.type ?? 'audio/webm').split(';')[0].trim() || 'audio/webm';
  params.mime_type = mime;
  params.file_name = opts.fileName ?? `audio.${guessExtension(mime)}`;
  if (opts.model) params.model = opts.model;
  if (opts.language) params.language = opts.language;

  sttLog(
    'transcribe bytes=%d mime=%s base64_ms=%d (b64_size=%d)',
    blob.size,
    mime,

View on GitHub (pinned to a221052e0d)

Solutions

  1. Use `--namespace <ns>` instead of a positional: `openhuman memory docs --namespace default`
  2. Drop unsupported flags (-v is the only extra one besides --namespace)
  3. Run `openhuman memory docs --help` for the exact usage line

Example fix

# before
openhuman memory docs default
# after
openhuman memory docs --namespace default
Defensive patterns

Strategy: validation

Validate before calling

# bash: docs accepts only --namespace <v>, -v, -h
for a in "$@"; do
  case "$a" in
    --namespace|-n|-v|--verbose|-h|--help) ;;
    -*) echo "unknown docs arg: $a" >&2; exit 2 ;;
    *) echo "positional not accepted; use --namespace '$a'" >&2; exit 2 ;;
  esac
done
openhuman memory docs "$@"

Try / catch

if ! out=$(openhuman memory docs "$@" 2>&1); then
  case "$out" in *"unknown docs arg"*) openhuman memory docs --help >&2; exit 2;; esac
  printf '%s\n' "$out" >&2; exit 1
fi

Prevention

When it happens

Trigger: `openhuman memory docs --json`; `openhuman memory docs default` (positional namespace is not accepted — it must be `--namespace default`); `openhuman memory list -a`.

Common situations: 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.

Related errors


AI-assisted analysis of tinyhumansai/openhuman@a221052e0d (2026-08-16). Data as JSON: /api/errors/43ccb244a13c6ac0. Report an issue: GitHub.