From 35f8276a160fdb7d52c59218162c00239ece109b Mon Sep 17 00:00:00 2001 From: Evan Reichard Date: Sun, 3 May 2026 21:21:49 -0400 Subject: [PATCH] fix: use same refresh interval for all providers chore: update AGENTS.md to require explicit approval for usage/ and providers/ changes --- AGENTS.md | 2 +- index.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 9c01dbc..1b25a2f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -18,7 +18,7 @@ ## Conventions - Keep user layout changes in `config.ts` when possible. -- Preserve copied provider logic in `usage/` unless fixing integration issues. +- **Do NOT modify files in `usage/` or `providers/` without explicit user approval.** These contain copied upstream provider logic. Always ask before changing them. - Use composable module config instead of subtype strings. For usage, prefer: ```ts diff --git a/index.ts b/index.ts index cce88fe..0a36b48 100644 --- a/index.ts +++ b/index.ts @@ -10,7 +10,6 @@ import type { ModuleContext, ModuleSpec, RenderedModule, StatusbarState } from " import type { Provider, UsageCredential, UsageProvider, UsageReport } from "./usage"; const REFRESH_MS = 60_000; -const ANTHROPIC_REFRESH_MS = 15 * 60_000; const usageProviders: Record = { "openai-codex": openaiCodexUsageProvider, @@ -167,7 +166,7 @@ export default function piStatusbarExtension(pi: ExtensionAPI) { return; } - const minRefreshMs = provider === "anthropic" ? ANTHROPIC_REFRESH_MS : REFRESH_MS; + const minRefreshMs = REFRESH_MS; if (!force && statusbarState.report?.provider === provider && Date.now() - statusbarState.report.fetchedAt < minRefreshMs) { rerender(ctx); return;