Skip to content

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

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-dfeb8429
Jun 4, 2026
Merged

fix(tools): add raise_for_status for MiniMax t2a_v2 TTS path#39057
teknium1 merged 1 commit into
mainfrom
hermes/hermes-dfeb8429

Conversation

@teknium1

@teknium1 teknium1 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

The MiniMax t2a_v2 TTS path now surfaces a clear HTTPError on a 4xx/5xx response instead of an opaque JSONDecodeError.

Previously, on an HTTP error with a non-JSON body, response.json() raised a confusing JSONDecodeError. The sibling text_to_speech path already guarded with raise_for_status(); this brings t2a_v2 to parity.

Changes

  • tools/tts_tool.py: add response.raise_for_status() before response.json() in the t2a_v2 branch.

Validation

Before After
4xx/5xx, non-JSON body opaque JSONDecodeError clear HTTPError
compile py_compile OK

Salvage of #38142 by @annguyenNous, cherry-picked onto current main with authorship preserved.

Infographic

minimax-tts-clear-errors

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.
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-dfeb8429 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9802 on HEAD, 9802 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 5086 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@teknium1
teknium1 merged commit 4cca7f5 into main Jun 4, 2026
23 checks passed
@teknium1
teknium1 deleted the hermes/hermes-dfeb8429 branch June 4, 2026 13:17
@alt-glitch alt-glitch added type/bug Something isn't working tool/tts Text-to-speech and transcription provider/minimax MiniMax (Anthropic transport) P2 Medium — degraded but workaround exists labels 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 provider/minimax MiniMax (Anthropic transport) 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