Skip to content

fix(cli): render and status --timeout set the request budget - #11

Merged
gdameneses merged 2 commits into
mainfrom
fix/render-timeout
Nov 23, 2026
Merged

gdameneses merged 2 commits into
mainfrom
fix/render-timeout

Conversation

@gdameneses

Copy link
Copy Markdown
Collaborator

Summary

Sync renders died at 30 seconds whatever --timeout said, because the API client had a fixed 30s http.Client timeout. The context deadline from --timeout is now the only limit, so render --timeout 6m waits 6 minutes and the 60s default actually applies. status --timeout had 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

  • New tests in internal/api/http_client_test.go: a caller deadline outlives the client timeout, the client timeout still applies with no deadline, and NewHTTPClient sets no fixed http.Client timeout.
  • make ci passes.
  • Against a local server that answers after 35s: v1.3.0 with --timeout 1m fails at 30s, this branch succeeds at 35s, and --timeout 5s still fails at 5s with the right hint.

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
AJCJ1 self-requested a review November 23, 2026 11:44

@AJCJ1 AJCJ1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Two non-blocking things that might be worth a look, here or in a follow-up:

  • The --timeout help 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 0 is 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, like status --wait already 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.
@gdameneses
gdameneses merged commit 8f9ddcc into main Nov 23, 2026
1 check passed
@cjroebuck
cjroebuck deleted the fix/render-timeout branch November 27, 2026 22:46
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.

render: --timeout is ignored, sync renders fail after 30 seconds

2 participants