Maintenance/throttle special treatment#20
Merged
luke-owen-crowdhandler merged 2 commits intoJun 11, 2026
Conversation
…ct trustOnFail Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the Gatekeeper request-validation error handling so that throttle scenarios get “server-error-like” treatment (i.e., respect trustOnFail) instead of being handled like other 4xx client errors, and bumps the SDK version accordingly.
Changes:
- Treat HTTP
429differently from other 4xx errors:429now respectstrustOnFail(like 5xx) rather than forcingpromoted = false. - Add special handling for API responses with
result.status === 6(“throttle response”) to also respecttrustOnFail. - Bump package version to
2.5.0and update built artifacts / type declarations.
Reviewed changes
Copilot reviewed 2 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/gatekeeper/gatekeeper.ts | Implements special-casing for 429 and “status 6” throttling; updates inline docs. |
| package.json | Version bump to 2.5.0. |
| package-lock.json | Lockfile version bump to 2.5.0. |
| dist/types/gatekeeper/gatekeeper.d.ts | Updates generated JSDoc text to match new throttle behavior. |
| dist/gatekeeper/gatekeeper.js | Updates compiled Gatekeeper implementation with new throttle logic. |
| dist/crowdhandler.umd.min.js | Updates bundled minified build (incl. header version). |
| dist/crowdhandler.umd.js | Updates bundled UMD build (incl. header version). |
| dist/crowdhandler.esm.js | Updates bundled ESM build (incl. header version). |
| dist/crowdhandler.cjs.js | Updates bundled CJS build (incl. header version). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
1383
to
+1386
| * console.error(`API Error ${result.error.statusCode}: ${result.error.message}`); | ||
| * // Note: promoted is still set based on error type | ||
| * // 4xx errors: promoted = false | ||
| * // 5xx errors: promoted based on trustOnFail setting | ||
| * // 4xx errors (excluding 429): promoted = false | ||
| * // 429 throttle and 5xx errors: promoted based on trustOnFail setting |
Comment on lines
+1553
to
+1556
| result.error = { | ||
| message: 'API throttle response (status 6)', | ||
| code: 'RATE_LIMITED' | ||
| }; |
Comment on lines
+1746
to
+1749
| result.error = { | ||
| message: 'API throttle response (status 6)', | ||
| code: 'RATE_LIMITED' | ||
| }; |
Comment on lines
+2015
to
+2018
| result.error = { | ||
| message: 'API throttle response (status 6)', | ||
| code: 'RATE_LIMITED' | ||
| }; |
Comment on lines
+2138
to
+2141
| result.error = { | ||
| message: 'API throttle response (status 6)', | ||
| code: 'RATE_LIMITED' | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.