Repository navigation
fix(cli): render and status --timeout set the request budget - #11
Merged
Merged
Conversation
The API client had a fixed 30s http.Client timeout, so every sync render died at 30s whatever --timeout said. The context deadline is now the only limit, and the client's 30s only applies when there's no deadline. Fixes #10
AJCJ1
self-requested a review
November 23, 2026 11:44
AJCJ1
approved these changes
Nov 23, 2026
AJCJ1
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me. Two non-blocking things that might be worth a look, here or in a follow-up:
-
The
--timeouthelp text still says "Per-attempt timeout". now that the 30s client
limit is gone, the deadline covers the whole call including retries and backoff, so the wording could be a bit misleading. -
render --timeout 0is accepted and fails straight away with "Render timed out after 0s", without sending the request, because only negative values are rejected. Rejecting 0 as a usage error, likestatus --waitalready does, could make that clearer. This was already the case before this PR so more of a nice opportunity to fix it while you're in this code
--timeout 0 used to fail with "Render timed out after 0s" without sending the request. It's now a usage error, like negative values. The help text, skill and comments no longer call it a per-attempt timeout, since it covers the whole call, retries included.
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
Sync renders died at 30 seconds whatever
--timeoutsaid, because the API client had a fixed 30shttp.Clienttimeout. The context deadline from--timeoutis now the only limit, sorender --timeout 6mwaits 6 minutes and the 60s default actually applies.status --timeouthad the same problem and is fixed by the same change. The client's 30s now only kicks in when a caller sets no deadline.Fixes #10
Testing
internal/api/http_client_test.go: a caller deadline outlives the client timeout, the client timeout still applies with no deadline, andNewHTTPClientsets no fixedhttp.Clienttimeout.make cipasses.--timeout 1mfails at 30s, this branch succeeds at 35s, and--timeout 5sstill fails at 5s with the right hint.