@ravshansbox/pi-quota 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.ts +4 -3
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -68,7 +68,7 @@ type CodexResetConsumeResponse = { code?: string };
68
68
 
69
69
  const modelProviderNames: Record<QuotaState['provider'], string> = {
70
70
  anthropic: 'anthropic',
71
- 'openai-codex': 'openai',
71
+ 'openai-codex': 'openai-codex',
72
72
  };
73
73
 
74
74
  const requestTimeoutMs = 30_000;
@@ -623,10 +623,11 @@ export default function (pi: ExtensionAPI) {
623
623
  function scheduleCheck() {
624
624
  const next = nextMarkAfter(new Date());
625
625
  const delay = Math.max(0, next.getTime() - Date.now());
626
- checkTimer = setTimeout(async () => {
626
+ const timer = setTimeout(async () => {
627
627
  await runCycle(false);
628
- scheduleCheck();
628
+ if (checkTimer === timer) scheduleCheck();
629
629
  }, delay);
630
+ checkTimer = timer;
630
631
  }
631
632
 
632
633
  function stopTimers() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ravshansbox/pi-quota",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Anthropic and OpenAI Codex quota status extension for pi",
5
5
  "license": "MIT",
6
6
  "type": "module",