Files
openidea/src/features/settings/__tests__/agents.test.ts
T
matthiasdemauroyandmatthiasdemauroy 39fe96bd01 feat(agents): show Claude usage limits and session cost in the agent task header (#1041)
Claude Code reports the account's 5-hour and weekly usage limits (rate_limit_event) and the session cost (result.total_cost_usd); only the limit status was used. The limits now show as meters next to the context meter in the task header, with the reset time in the tooltip, and Settings › Tools › Agents › Chat turns each meter (context, work time, limits, cost) on or off. Limits are per provider and kept in memory; cost is off by default.

Closes #1057

Co-authored-by: matthiasdemauroy <[email protected]>
2026-11-04 00:28:23 +08:00

16 lines
632 B
TypeScript

import { describe, expect, it } from "vitest";
import { validateSettings } from "../model/schema";
describe("agent chat settings", () => {
it("defaults every meter but the cost to on and keeps stored values", () => {
expect(validateSettings({}).agents).toEqual({
showContextUsage: true,
showWorkTime: true,
showUsageLimits: true,
showCost: false,
});
const stored = validateSettings({ agents: { showUsageLimits: false, showCost: true, showWorkTime: "no" } }).agents;
expect(stored).toEqual({ showContextUsage: true, showWorkTime: true, showUsageLimits: false, showCost: true });
});
});