Skip to content

fix(quota-poller): match concrete provider IDs via family prefix#214

Merged
github-actions[bot] merged 1 commit intomainfrom
fix/quota-poller-provider-family-matching
Apr 18, 2026
Merged

fix(quota-poller): match concrete provider IDs via family prefix#214
github-actions[bot] merged 1 commit intomainfrom
fix/quota-poller-provider-family-matching

Conversation

@typelicious
Copy link
Copy Markdown
Collaborator

Summary

  • Introduces `_provider_family()` that collapses concrete provider IDs (`deepseek-chat`, `deepseek-reasoner`, `kilocode`, `kilo-sonnet`, `kilo-opus`) to balance-polling families (`deepseek` / `kilo`)
  • Fixes fetcher dispatch in `_poll_package` + env-key lookup in `_resolve_api_key`
  • Recognises `KILOCODE_API_KEY` for the full kilo-* family
  • Ships as v2.2.2

Why

v2.2.0 introduced the quota poller but its dispatcher compared `provider_id` against literal `"deepseek"` / `"kilocode"`. Real catalog entries use router-facing IDs like `deepseek-chat` → silent fall-through with "no balance fetcher for provider X".

Verified live on a running 2.2.1 service: with the hot-patched fix the poller immediately fetched the real DeepSeek USD balance from `/user/balance` and persisted it back to `packages/catalog.v1.json`.

Test plan

  • Unit test: `_provider_family('deepseek-chat') == 'deepseek'`, `_provider_family('kilo-opus') == 'kilo'`
  • Unit test: `_resolve_api_key('deepseek-chat', None)` picks up `DEEPSEEK_API_KEY`
  • Live: DeepSeek balance ($29.27) returned and persisted
  • CI green across 3.10 / 3.11 / 3.12 / 3.13

🤖 Generated with Claude Code

The quota poller compared provider_id against literal "deepseek" and
"kilocode", so catalog entries using the real router-facing IDs
(deepseek-chat, deepseek-reasoner, kilo-sonnet, kilo-opus) silently
fell through with "no balance fetcher for provider X" and
"$DEEPSEEK_API_KEY not found".

Added _provider_family() that collapses concrete IDs to polling
families (deepseek / kilo), used in both the dispatch and env-key
lookup. Now KILOCODE_API_KEY is recognised for the full kilo-* family.

Verified against live service: DeepSeek /user/balance now returns
the real USD balance; Kilo still fails (upstream 404, unrelated).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions github-actions bot enabled auto-merge (squash) April 18, 2026 12:43
@github-actions github-actions bot merged commit a3363a4 into main Apr 18, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant