Skip to content

[Partner Nodes] fix: respect Retry-After header#14234

Merged
bigcat88 merged 1 commit into
masterfrom
fix/api-nodes/support-retry-after-header
Jun 19, 2026
Merged

[Partner Nodes] fix: respect Retry-After header#14234
bigcat88 merged 1 commit into
masterfrom
fix/api-nodes/support-retry-after-header

Conversation

@bigcat88

@bigcat88 bigcat88 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

The API-node HTTP client retries 408/500/502/503/504 responses with blind exponential backoff and ignores any Retry-After header the server sends.
This change makes the retry loop honor Retry-After: when one of those statuses carries the header, the client waits the server-requested delay (capped) before retrying, instead of its own backoff schedule.

API Node PR Checklist

Scope

  • Is API Node Change

Pricing & Billing

  • Need pricing update
  • No pricing update

If Need pricing update:

  • Metronome rate cards updated
  • Auto‑billing tests updated and passing

QA

  • QA done
  • QA not required

Comms

  • Informed Kosinkadink

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8019f8ef-197e-47dd-8df6-60a82c882604

📥 Commits

Reviewing files that changed from the base of the PR and between 35378d4 and b9cf3dd.

📒 Files selected for processing (2)
  • comfy_api_nodes/util/_helpers.py
  • comfy_api_nodes/util/client.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • comfy_api_nodes/util/_helpers.py
  • comfy_api_nodes/util/client.py

📝 Walkthrough

Walkthrough

This PR adds support for honoring HTTP Retry-After headers during request retries. A new helper function in _helpers.py parses the header as either a numeric delay-in-seconds or HTTP-date string, clamps the result to a maximum of 150 seconds, and returns a fallback delay if parsing fails. The client imports this helper and applies it during the retry decision path for non-rate-limit failure status codes, replacing the backoff-only delay calculation with a server-guided wait duration.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title clearly and concisely summarizes the main change: adding support for respecting the Retry-After header in HTTP client retries.
Description check ✅ Passed The pull request description is directly related to the changeset, explaining the problem (ignoring Retry-After headers) and the solution (honoring server-requested delays with a cap).
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@bigcat88 bigcat88 marked this pull request as draft June 2, 2026 12:12
@bigcat88 bigcat88 force-pushed the fix/api-nodes/support-retry-after-header branch from 35378d4 to 0e27d95 Compare June 19, 2026 06:33
Signed-off-by: bigcat88 <bigcat88@icloud.com>
@bigcat88 bigcat88 force-pushed the fix/api-nodes/support-retry-after-header branch from 0e27d95 to b9cf3dd Compare June 19, 2026 06:44
@bigcat88 bigcat88 marked this pull request as ready for review June 19, 2026 06:58
@bigcat88 bigcat88 merged commit bd39bbf into master Jun 19, 2026
18 checks passed
@bigcat88 bigcat88 deleted the fix/api-nodes/support-retry-after-header branch June 19, 2026 08:33
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.

2 participants