Repository navigation
Conversation
SamyPesse
marked this pull request as ready for review
October 9, 2026 15:03
[Medium impact] The PR appears safe to merge; no actionable issues remain. SummaryAdds configurable request budgets while keeping the default of 1,000 requests per API key.
Reviews (3) · Last reviewed commit: "feat(cli): add --requests-per-minute and..." · Reviewed by Greptile |
The configurable budget was reachable only through createEmulator, so anyone running the CLI or the Docker image (whose entrypoint is the CLI) was still pinned to 1,000 requests per key per minute. The flag and WORKOS_EMULATE_REQUESTS_PER_MINUTE follow the precedence the other flags use, with the flag winning over the environment so a compose file can set a default a command can override. The value is validated on the command line with the same rule createServer enforces, so a bad budget fails naming the flag or variable the user actually set rather than an option name from the programmatic API.
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.
The fixed 1,000-request budget can throttle larger integration suites sharing one API key, causing SDK retries to wait for the next window. Add a positive-safe-integer
requestsPerMinuteoption tocreateEmulatorand the core server options, retaining the default of 1,000.Each 60-second window now accepts the full configured budget. A budget of 1 permits one request; the last accepted request reports
X-RateLimit-Remaining: 0, and subsequent requests receive HTTP 429 withRetry-Afteruntil the window resets. This addresses Greptile's smallest-budget finding and corrects the same boundary for default and larger budgets. The README documents configuration, headers, and window behavior.Validation:
main(c63466f246b5060c766df4155676784543c7e171).@workos/emulate@0.14.0matches the four built runtime/type files byte for byte. A fresh frozen-lockfile installation, OpenKnowledge Compute'sbun run check, all 22 backend integration scenarios, and the 10 HTTP regression cases against the installed patched package pass.