diff options
Diffstat (limited to '.rules/changelog/2026-04/01')
| -rw-r--r-- | .rules/changelog/2026-04/01/01.md | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/.rules/changelog/2026-04/01/01.md b/.rules/changelog/2026-04/01/01.md new file mode 100644 index 0000000..5134518 --- /dev/null +++ b/.rules/changelog/2026-04/01/01.md @@ -0,0 +1,26 @@ +# Changelog — 2026-04-01 #01 + +## Changes + +### New: Rate Limiter (`lib/dispatch/adapter/rate_limiter.rb`) +- Implemented `Dispatch::Adapter::RateLimiter` class with cross-process rate limiting via filesystem locks (`flock`). +- Supports per-request cooldown (`min_request_interval`) and sliding window limiting (`rate_limit`). +- State stored as JSON in `{token_path_dir}/copilot_rate_limit` with `0600` permissions. +- Handles missing, empty, or corrupt state files gracefully. +- Validates constructor arguments with descriptive `ArgumentError` messages. + +### Modified: Copilot Adapter (`lib/dispatch/adapter/copilot.rb`) +- Added `min_request_interval:` (default `3.0`) and `rate_limit:` (default `nil`) constructor parameters. +- Instantiates a `RateLimiter` in `initialize`. +- Calls `@rate_limiter.wait!` before HTTP requests in `chat_non_streaming`, `chat_streaming`, and `list_models`. +- Added `require_relative "rate_limiter"`. + +### Version Bump (`lib/dispatch/adapter/version.rb`) +- Bumped `VERSION` from `"0.1.0"` to `"0.2.0"`. + +### Updated Test (`spec/dispatch/adapter/copilot_spec.rb`) +- Updated VERSION expectation from `"0.1.0"` to `"0.2.0"`. + +### RuboCop Config (`.rubocop.yml`) +- Disabled `Layout/LineLength` cop. +- Disabled `Style/Documentation` cop. |
