Repository navigation
Release v7.8.0
Providers now report how much of their usage allowance is left. Pools pick the member with the most room, and skip one that is out of allowance until it resets.
Added
IAIProviderCapacitiesreports anAIProviderCapacityfor any provider: its usage windows (5-hour, daily, weekly or monthly, each with the share used and when it resets), oneHeadroomfigure from 0 to 1,CanStartWork, andAvailableAgainAt. Claude subscriptions, ChatGPT/Codex subscriptions, GitHub Copilot and the Z.AI coding plan report their real windows. API-key providers fall back to the configured usage capacity, or count as unmetered.- The
CapacityFor(providerId)query and its@cratis/aiproxy (Providers/Capacity) let a frontend show a provider's windows and headroom. ICanReportAIProviderCapacitylets an application add a capacity source for another vendor.- New options
AIProviderOptions.MinimumHeadroomToStartWork(default 0.02) andCapacityFreshness(default 5 minutes). Observations are cached, and the last good reading is kept when a vendor fails to answer. ProviderRateLimit.ResetIndicatedBy(reason, now)reads the reset time out of a limit message, such as "resets Oct 9, 2am (UTC)" or Claude Code's|<epoch>suffix.PoolSelectionData.HeadroomByProviderranks pool members by remaining headroom.
Fixed
- Claude subscription limit messages such as "You've hit your weekly limit" are recognized as rate limits, so a pool fails over to another member instead of failing the work.
- A provider that hits a limit is parked until the reset the limit states, not for a flat hour, so it is no longer retried hourly while its weekly limit lasts.
- Pool completions skip members whose capacity says they cannot start work, and
AIProviderPoolDispatcherskips rate-limited members.