fix: use same refresh interval for all providers

chore: update AGENTS.md to require explicit approval for usage/ and providers/ changes
This commit is contained in:
2026-05-03 21:21:49 -04:00
parent 9c88e0a003
commit 35f8276a16
2 changed files with 2 additions and 3 deletions

View File

@@ -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

View File

@@ -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<Provider, UsageProvider> = {
"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;