Skip to content

Commit 34a76c4

Browse files
claude[bot]claude
andauthored
docs(protocol): name the 429 backoff member what the runtime actually emits (#16938)
`content/docs/protocol/kernel/error-handling.mdx` taught `details.retry_after` on three error envelopes and instructed clients to read `data.error.details.retry_after`. No producer emits that member: both 429 emitters build `details: { retryAfterSeconds, resetAt }` (`packages/runtime/src/endpoint-policy.ts`, `packages/runtime/src/security/inbound-rate-limit.ts`), and two tests pin the spelling. A client written from this page reads `undefined` on every real 429 and silently falls back to its own backoff against a service that just asked it to wait. Only `details`-bag members move. The `RetryStrategy` enum value `retry_after` is a different, correct use of the same token and is untouched in all seven of its sites (`content/docs/api/error-catalog.mdx` x4, `content/docs/references/api/errors.mdx` x3). Claude-Session: https://claude.ai/code/session_016N6xmWt5hYm94ffVEwGH8x Co-authored-by: Claude <noreply@anthropic.com>
1 parent 859ded3 commit 34a76c4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

content/docs/protocol/kernel/error-handling.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ never crosses HTTP. The refusal is emitted as the flat body shown above, and
420420
"details": {
421421
"limit": 1000,
422422
"window": "1m",
423-
"retry_after": 45,
423+
"retryAfterSeconds": 45,
424424
"quota_reset": "2024-01-16T14:31:00Z"
425425
}
426426
}
@@ -528,7 +528,7 @@ async function fetchWithRetry(url, options = {}, maxRetries = 3) {
528528
"message": "Service temporarily unavailable",
529529
"details": {
530530
"reason": "database_maintenance",
531-
"retry_after": 300,
531+
"retryAfterSeconds": 300,
532532
"estimated_completion": "2024-01-16T15:00:00Z"
533533
}
534534
}
@@ -652,7 +652,7 @@ Content-Type: application/json
652652
"details": {
653653
"limit": 1000,
654654
"window": "1m",
655-
"retry_after": 45,
655+
"retryAfterSeconds": 45,
656656
"quota_reset": "2024-01-16T14:31:00Z",
657657
"upgrade_url": "https://app.acme.com/billing/upgrade"
658658
},
@@ -736,7 +736,7 @@ async function fetchWithRetry(url, options = {}, maxRetries = 3) {
736736
if (!response.ok) {
737737
// Check if error is retryable
738738
if (data.error.code === 'RATE_LIMIT_EXCEEDED') {
739-
const retryAfter = data.error.details.retry_after || 1;
739+
const retryAfter = data.error.details.retryAfterSeconds || 1;
740740
await sleep(retryAfter * 1000);
741741
continue;
742742
} else if (data.error.code === 'INTERNAL_ERROR') {

0 commit comments

Comments
 (0)