Token counting, model quotas, and sliding window rate limiter
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> |
||
|---|---|---|
| CLAUDE.md | ||
| FINDINGS.md | ||
| go.mod | ||
| go.sum | ||
| ratelimit.go | ||
| ratelimit_test.go | ||
| TODO.md | ||