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:
@@ -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
|
||||
|
||||
3
index.ts
3
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<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;
|
||||
|
||||
Reference in New Issue
Block a user