fix(quota): match the Claude Code integration provider to Claude quota
The opencode-claude integration registers its provider as `claude-code`, which never matched the `claude` quota provider, so the collapsed Usage section in the work status panel showed no limit for a model from that integration. Claude windows also reported no duration, leaving the headline to fall back to whichever row came first instead of the limit that runs out soonest. The session and weekly windows now carry their length; extra usage stays without one because it is a monthly spend cap.
This commit is contained in:
@@ -36,6 +36,10 @@ describe('resolveQuotaProviderId', () => {
|
||||
expect(resolveQuotaProviderId('anthropic')).toBe('claude');
|
||||
});
|
||||
|
||||
test('maps the opencode-claude integration provider onto Claude quota', () => {
|
||||
expect(resolveQuotaProviderId('claude-code')).toBe('claude');
|
||||
});
|
||||
|
||||
test('is case and whitespace tolerant, and rejects empties', () => {
|
||||
expect(resolveQuotaProviderId(' OpenAI ')).toBe('codex');
|
||||
expect(resolveQuotaProviderId('')).toBeNull();
|
||||
|
||||
@@ -13,11 +13,15 @@ import type { UsageProviderGroup, UsageLimitRow } from '@/components/usage/usage
|
||||
/**
|
||||
* Quota provider ids mostly match OpenCode provider ids; these are the ones
|
||||
* that do not. Unmatched providers simply produce no headline.
|
||||
*
|
||||
* `claude-code` is the provider the opencode-claude integration registers, and
|
||||
* it bills against the same Claude subscription the `claude` quota reports.
|
||||
*/
|
||||
const QUOTA_PROVIDER_ALIASES = new Map<string, string>([
|
||||
['openai', 'codex'],
|
||||
['chatgpt', 'codex'],
|
||||
['anthropic', 'claude'],
|
||||
['claude-code', 'claude'],
|
||||
['gemini', 'google'],
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user