Skip to content

Maintenance/throttle special treatment#20

Merged
luke-owen-crowdhandler merged 2 commits into
mainfrom
maintenance/throttle-special-treatment
Jun 11, 2026
Merged

Maintenance/throttle special treatment#20
luke-owen-crowdhandler merged 2 commits into
mainfrom
maintenance/throttle-special-treatment

Conversation

@luke-owen-crowdhandler

Copy link
Copy Markdown
Contributor

No description provided.

luke-owen-crowdhandler and others added 2 commits June 11, 2026 13:16
…ct trustOnFail

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 429 differently from other 4xx errors: 429 now respects trustOnFail (like 5xx) rather than forcing promoted = false.
  • Add special handling for API responses with result.status === 6 (“throttle response”) to also respect trustOnFail.
  • Bump package version to 2.5.0 and 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'
};
@luke-owen-crowdhandler luke-owen-crowdhandler merged commit 4267ad9 into main Jun 11, 2026
1 check passed
@luke-owen-crowdhandler luke-owen-crowdhandler deleted the maintenance/throttle-special-treatment branch June 11, 2026 12:34
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