Token counting, model quotas, and sliding window rate limiter
Find a file
Claude 3c63b1022a
feat(ratelimit): generalise beyond Gemini with provider profiles and push coverage to 95%
Phase 0: Rewrite test suite with testify (77.1% -> 95.1% coverage).
Add boundary tests, concurrent access tests, benchmarks, error path
coverage for Load/Persist, Reset, Stats, and CountTokens.

Phase 1: Extract hardcoded Gemini quotas into provider-agnostic config.
Add Provider type, DefaultProfiles(), NewWithConfig(), SetQuota(), and
AddProvider(). Pre-configured profiles for Gemini, OpenAI, Anthropic,
and Local. New() retains exact backward compatibility via delegation.

Co-Authored-By: Charon <developers@lethean.io>
2026-02-20 01:07:57 +00:00
CLAUDE.md feat: extract go-ratelimit from core/go pkg/ratelimit 2026-02-19 16:09:13 +00:00
FINDINGS.md feat(ratelimit): generalise beyond Gemini with provider profiles and push coverage to 95% 2026-02-20 01:07:57 +00:00
go.mod feat(ratelimit): generalise beyond Gemini with provider profiles and push coverage to 95% 2026-02-20 01:07:57 +00:00
go.sum feat(ratelimit): generalise beyond Gemini with provider profiles and push coverage to 95% 2026-02-20 01:07:57 +00:00
ratelimit.go feat(ratelimit): generalise beyond Gemini with provider profiles and push coverage to 95% 2026-02-20 01:07:57 +00:00
ratelimit_test.go feat(ratelimit): generalise beyond Gemini with provider profiles and push coverage to 95% 2026-02-20 01:07:57 +00:00
TODO.md feat(ratelimit): generalise beyond Gemini with provider profiles and push coverage to 95% 2026-02-20 01:07:57 +00:00