fix(image,speech): pass through actual API error messages on FAILED status#53
Merged
TimPietruskyRunPod merged 1 commit intomainfrom Jan 21, 2026
Merged
Conversation
…tatus When the Runpod API returns a FAILED status, the SDK now surfaces the actual error message instead of throwing generic errors. Image model: - Added `error` field to response schema - Added explicit FAILED status handler for initial /runsync response - Polling already handled this correctly Speech model: - Added FAILED status handler (same issue existed here) Closes #52
justinwlin
approved these changes
Jan 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/runsyncresponseProblem
When the Runpod API returns a
FAILEDstatus, the SDK was throwing generic errors:"Unexpected response status: FAILED""Runpod speech response did not include an audio_url."Instead of the actual error message from the API, e.g.:
"Total pixels (262144) must be between 589824 and 2073600.""Failed to download voice prompt from provided URL."Changes
src/runpod-image-model.ts: Addederrorfield to response schema and FAILED status handlersrc/runpod-speech-model.ts: Added FAILED status handlerTest plan
pnpm type-checkpassespnpm lintpasses (0 errors)pnpm testpasses (58 tests, node + edge)Closes #52