feat: add --timeout flag to image, text, and video commands#45
Open
Railly wants to merge 1 commit into
Open
Conversation
|
Someone is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
Collaborator
|
@Railly Good one. Can you plz fix the conflict and sign your commit(s) before merging? |
4eb6bcf to
a96bde8
Compare
The hardcoded 120s default for image and text aborts complex prompts before the AI Gateway has a chance to respond. AI Gateway accepts up to ~13min per provider; the CLI just never let users reach for it. Adds --timeout <seconds> to all three generation commands. Defaults are unchanged (120s for image/text, 300s for video), so this is purely additive. Updates README, commands docs, and troubleshooting docs to document the flag.
a96bde8 to
124b75f
Compare
Author
|
@ctate done! |
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
Adds a
--timeout <seconds>flag toimage,text, andvideo. Defaults are unchanged (120s for image/text, 300s for video), so this is purely additive.Why
The hardcoded 120s default in
image(andtext) aborts complex prompts before the AI Gateway has a chance to respond. Real example: a sprite atlas prompt (1536x1872, 72 cells, strict layout constraints) consistently hits the 120s wall and surfaces asGateway request failed: The operation timed outregardless of model. There is no escape hatch in the current CLI: the user has to fork or downgrade the prompt.The Gateway itself is not the bottleneck. Per AI Gateway docs, provider timeouts go from 1s up to 789,000ms (~13 min), and that timeout only measures time-to-first-byte. The CLI's
AbortSignal.timeout(120_000)is what fires first.The current docs even acknowledge this in
troubleshooting.mdx("If you're consistently hitting timeouts, try a faster model variant"), but switching models is not always the right answer — for image generation, model choice is dictated by quality requirements, not latency tolerance.What changes
--timeout <seconds>onimage,text,video. ReusedparsePositiveIntfor validation.commands.mdx,troubleshooting.mdxupdated to document the flag and renamed the existing column to "Default timeout" for clarity.Verification
bun run typecheckpassesbun run format:checkpassesbun run lintpasses (24 preexisting warnings, 0 new)bun run buildproduces a working binarydist/ai image --helpshows the new flag with the correct defaultExample