Skip to content

fix(tools): add raise_for_status for MiniMax t2a_v2 TTS path - #38142

Closed
annguyenNous wants to merge 1 commit into
NousResearch:mainfrom
annguyenNous:fix/minimax-t2a-v2-http-check
Closed

fix(tools): add raise_for_status for MiniMax t2a_v2 TTS path#38142
annguyenNous wants to merge 1 commit into
NousResearch:mainfrom
annguyenNous:fix/minimax-t2a-v2-http-check

Conversation

@annguyenNous

Copy link
Copy Markdown
Contributor

Problem

In tools/tts_tool.py, the MiniMax t2a_v2 TTS code path calls response.json() without first checking the HTTP status code. If the API returns HTTP 4xx/5xx with non-JSON content, response.json() raises an opaque JSONDecodeError instead of a clear HTTPError.

The non-t2a_v2 path already has response.raise_for_status() at line 1299.

Fix

Add response.raise_for_status() before response.json() in the t2a_v2 path.

Files Changed

  • tools/tts_tool.py — 1 line added

The MiniMax t2a_v2 code path calls response.json() without first
checking the HTTP status code. If the API returns HTTP 4xx/5xx with
non-JSON content (e.g. HTML error page), response.json() raises an
opaque JSONDecodeError instead of a clear HTTPError.

The non-t2a_v2 path already has response.raise_for_status() at line
1299. Add the same check before response.json() in the t2a_v2 path
for consistent error handling.
@alt-glitch alt-glitch added type/bug Something isn't working tool/tts Text-to-speech and transcription P2 Medium — degraded but workaround exists labels Jun 3, 2026
@teknium1

teknium1 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Merged via PR #39057 — your commit was cherry-picked onto current main with your authorship preserved in git log. Thanks @annguyenNous!

@teknium1 teknium1 closed this Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Medium — degraded but workaround exists tool/tts Text-to-speech and transcription type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants