Skip to content

Release v7.8.0

Choose a tag to compare

@github-actions github-actions released this 06 Oct 08:23
39294c3

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

  • IAIProviderCapacities reports an AIProviderCapacity for any provider: its usage windows (5-hour, daily, weekly or monthly, each with the share used and when it resets), one Headroom figure from 0 to 1, CanStartWork, and AvailableAgainAt. 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/ai proxy (Providers/Capacity) let a frontend show a provider's windows and headroom.
  • ICanReportAIProviderCapacity lets an application add a capacity source for another vendor.
  • New options AIProviderOptions.MinimumHeadroomToStartWork (default 0.02) and CapacityFreshness (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.HeadroomByProvider ranks 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 AIProviderPoolDispatcher skips rate-limited members.