Skip to content

Poll asynchronous jobs before downloading example outputs - #38

Open
Ray0907 wants to merge 1 commit into
MiniMax-AI:mainfrom
Ray0907:fix-async-job-polling
Open

Poll asynchronous jobs before downloading example outputs#38
Ray0907 wants to merge 1 commit into
MiniMax-AI:mainfrom
Ray0907:fix-async-job-polling

Conversation

@Ray0907

@Ray0907 Ray0907 commented Aug 11, 2026

Copy link
Copy Markdown

Summary

  • add shared polling helpers for SGLang and MiniMax Open Platform jobs
  • wait for terminal success before reading result fields or downloading output
  • stop immediately on failed, cancelled, or unexpected states
  • add configurable polling timeout and transient HTTP retries
  • apply the flow to all 18 asynchronous README scripts

Why

The video endpoints return an asynchronous job ID. The examples previously
queried each job only once and then attempted to read or download its output,
which fails whenever the job is still queued or processing.

The defaults poll every 10 seconds for up to two hours. Users can override
POLL_INTERVAL_SECONDS, POLL_TIMEOUT_SECONDS, and the HTTP_* retry values
for their deployment.

Validation

  • bash -n passed for all 19 scripts in scripts/readme
  • mock responses verified queued-to-completed, failed, unexpected, and timeout paths
  • verified all 18 async examples source the polling helper
  • git diff --check

The SGLang status handling follows its documented asynchronous video flow:
https://docs.sglang.io/cookbook/diffusion/MiniMax/MiniMax-H3#4-generate-video-and-audio


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@Ray0907
Ray0907 marked this pull request as ready for review August 11, 2026 06:43
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.

1 participant