Repository navigation
[WIP] Add rate limiting and throttle layer functionality - #51
Merged
Merged
Conversation
- Add src/infra/rate-limiter.ts: sliding-window per-user and global rate limiter with channel-aware overrides and friendly rejection messages - Add RateLimitConfig type and RateLimitChannelOverride type to src/config/types.openclaw.ts under top-level rateLimit key - Add rateLimit Zod schema to src/config/zod-schema.ts (perUser, global, windowMs, channelOverrides) - Add src/infra/rate-limiter.test.ts with 9 unit tests Agent-Logs-Url: https://github.com/Piboonsak/openclaw_github/sessions/16e35128-14bb-4f00-adb6-d456d9622d94
Piboonsak
marked this pull request as ready for review
April 5, 2026 13:22
Per code review: - Replace per-channel globalWindows map with single shared global window so the global quota truly guards API cost across all channels combined - Channel-specific global overrides get their own isolated window via channelGlobalWindows map - Fix makeConfig test helper return type to Pick<OpenClawConfig, 'rateLimit'> - Add two new tests: cross-channel global sharing and per-channel override Agent-Logs-Url: https://github.com/Piboonsak/openclaw_github/sessions/16e35128-14bb-4f00-adb6-d456d9622d94
Copilot stopped work on behalf of
Piboonsak due to an error
April 5, 2026 13:23
This was referenced Apr 6, 2026
This was referenced Apr 6, 2026
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.
src/infra/rate-limiter.ts— sliding-window per-user and global rate limiterRateLimitConfigtype tosrc/config/types.openclaw.ts(new top-levelrateLimitkey)rateLimitinsrc/config/zod-schema.tssrc/infra/rate-limiter.test.ts— 11 unit tests (all passing)makeConfighelper now returnsPick<OpenClawConfig, 'rateLimit'>(correct type)