Skip to content

Propose honoring stated retry times (add-retry-after) - #114

Merged
gschaetz merged 2 commits into
mainfrom
spec/add-retry-after
Oct 16, 2026
Merged

gschaetz merged 2 commits into
mainfrom
spec/add-retry-after

Conversation

@gschaetz

Copy link
Copy Markdown
Owner

Spec only, for review (no code). Step 1 of Replacing ModelRelay.

The situation

Switchyard 0.3.0 parses Retry-After but only uses it for its own internal retries; the error it returns to a library user (UpstreamHttp { status, body }) does not carry it. Upstream PR NVIDIA-NeMo/Switchyard#904 (closing #903) adds the headers; it is open and unmerged. I added our use case to #903.

What this proposes

  • A small interim: read the retry time from the error body for well-known shapes (try again in 7.66s, retryDelay, retry_after, ...), 429 and 503 only, first 4 KiB, bounded to 1 s to max_retry_after_secs (default 300).
  • A stated retry time opens the endpoint immediately for exactly that long (no failure-count wait, no doubling, not capped by max_cooldown_secs); no hint means today behavior unchanged.
  • One seam, retry_after(error), so adopting the header after #904 releases is a one-function change.
  • The cooldown source is visible in endpoint health and counted by a metric.

Amends ADR 0018 rather than adding one. Not in scope: x-ratelimit-* headers, predicting limits, changing Switchyard retries.

🤖 Generated with Claude Code

gschaetz and others added 2 commits October 15, 2026 22:42
Spec for cooling a rate-limited endpoint for the retry time its error states,
read from the body now and from Retry-After once Switchyard exposes it
(NVIDIA-NeMo/Switchyard#904). Step 1 of replacing ModelRelay. Spec only.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Gary Schaetz <gary@schaetzkc.com>
@gschaetz
gschaetz merged commit 48196c0 into main Oct 16, 2026
7 checks passed
@gschaetz
gschaetz deleted the spec/add-retry-after branch October 16, 2026 03:47
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