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:
@@ -39,6 +39,15 @@ describe('Claude usage transforms', () => {
|
||||
expect(models.Fable.windows['7d'].usedPercent).toBe(12);
|
||||
});
|
||||
|
||||
it('reports each window duration so callers can rank limits by urgency', () => {
|
||||
const { windows, models } = toClaudeUsage(LIVE_PAYLOAD);
|
||||
|
||||
expect(windows['5h'].windowSeconds).toBe(5 * 60 * 60);
|
||||
expect(windows['7d'].windowSeconds).toBe(7 * 24 * 60 * 60);
|
||||
expect(models.Fable.windows['7d'].windowSeconds).toBe(7 * 24 * 60 * 60);
|
||||
expect(windows.extra_usage.windowSeconds).toBeNull();
|
||||
});
|
||||
|
||||
it('reports extra usage as a spend window with a money label', () => {
|
||||
const { windows } = toClaudeUsage(LIVE_PAYLOAD);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user