Skip to content

server: return 400 for an inline voice_ref that is not a WAV - #1255

Merged
0xShug0 merged 1 commit into
0xShug0:mainfrom
magnus-dev-melin:tasks-voice-ref-invalid-wav-400
Nov 10, 2026
Merged

0xShug0 merged 1 commit into
0xShug0:mainfrom
magnus-dev-melin:tasks-voice-ref-invalid-wav-400

Conversation

@magnus-dev-melin

Copy link
Copy Markdown
Contributor

Follow-up to #1252. Valid Base64 that decoded to bytes other than a WAV reached the WAV reader's generic error and returned HTTP 500, although the PR and the API docs said invalid voice_ref values return 400. It is now a request error (HTTP 400, "voice_ref base64 data is not a readable WAV (…)"), as an unreadable audio_base64 already is. The docs now say exactly which cases return 400: a malformed voice_ref, or inline data that is not a readable WAV. A server-local path that can't be read keeps its existing behavior.

Validation (macOS, M1 Max, Metal, chatterbox_q8_0 as "task": "vc"):

  • cli_request_options_test gains the case (valid Base64 of plain text); on main the test aborts with std::runtime_error: invalid WAV RIFF header, with this change it passes.
  • Legacy server, /v1/tasks/run with audio_base64 and voice_ref: {"type": "base64", "data": <Base64 of plain text>}: HTTP 400 "voice_ref base64 data is not a readable WAV (invalid WAV RIFF header)"; an inline WAV still returns HTTP 200 and the converted audio.

Thanks for catching it.

Valid Base64 that decoded to something other than a WAV reached the WAV
reader's generic error and became HTTP 500. It is now a request error
(HTTP 400), like an unreadable audio_base64, and the docs say which
voice_ref problems return 400.
@0xShug0
0xShug0 merged commit f001793 into 0xShug0:main Nov 10, 2026
12 checks passed
@0xShug0

0xShug0 commented Nov 10, 2026

Copy link
Copy Markdown
Owner

@magnus-dev-melin Thanks! PR merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants