blob: 5134518dba1cc69ee1f62b84ad8609e32eeef9c9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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.
|