Skip to content

Commit 65444d5

Browse files
baozhoutaoclaude
andauthored
docs(kernel): reduce the 429/503 details fences to what producers emit (#17190)
The two 429 fences taught `limit`, `window` and `quota_reset`, none of which any producer emits, and omitted `resetAt`, which both of them do. Both 429 emitters build the same exhaustive two-member bag: packages/runtime/src/endpoint-policy.ts:356 packages/runtime/src/security/inbound-rate-limit.ts:359 details: { retryAfterSeconds, resetAt } so anything else those fences name is not in the bag by construction. The 503 fence taught a `details` bag with `reason` / `retryAfterSeconds` / `estimated_completion`; no 503 producer on this tree emits a `details` bag at all, so the bag is dropped rather than re-spelled. The `QUOTA_EXCEEDED` fence is deliberately untouched: that code has no producer anywhere on the tree, so there is no emitted shape to reduce it to. Claude-Session: https://claude.ai/code/session_012GKcPZbMoGq7WPzKLfRBTU Co-authored-by: Claude <noreply@anthropic.com>
1 parent 818bfdb commit 65444d5

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

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

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,8 @@ never crosses HTTP. The refusal is emitted as the flat body shown above, and
418418
"code": "RATE_LIMIT_EXCEEDED",
419419
"message": "Rate limit exceeded",
420420
"details": {
421-
"limit": 1000,
422-
"window": "1m",
423421
"retryAfterSeconds": 45,
424-
"quota_reset": "2024-01-16T14:31:00Z"
422+
"resetAt": "2024-01-16T14:31:00Z"
425423
}
426424
}
427425
}
@@ -525,12 +523,7 @@ async function fetchWithRetry(url, options = {}, maxRetries = 3) {
525523
"success": false,
526524
"error": {
527525
"code": "SERVICE_UNAVAILABLE",
528-
"message": "Service temporarily unavailable",
529-
"details": {
530-
"reason": "database_maintenance",
531-
"retryAfterSeconds": 300,
532-
"estimated_completion": "2024-01-16T15:00:00Z"
533-
}
526+
"message": "Service temporarily unavailable"
534527
}
535528
}
536529
```
@@ -650,11 +643,8 @@ Content-Type: application/json
650643
"code": "RATE_LIMIT_EXCEEDED",
651644
"message": "Rate limit exceeded: 1000 requests per minute",
652645
"details": {
653-
"limit": 1000,
654-
"window": "1m",
655646
"retryAfterSeconds": 45,
656-
"quota_reset": "2024-01-16T14:31:00Z",
657-
"upgrade_url": "https://app.acme.com/billing/upgrade"
647+
"resetAt": "2024-01-16T14:31:00Z"
658648
},
659649
"requestId": "req_ghi789",
660650
"timestamp": "2024-01-16T14:30:15Z"

0 commit comments

Comments
 (0)