@monotykamary/pi-retry 0.8.1 → 0.8.2

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.
package/README.md CHANGED
@@ -167,7 +167,7 @@ Exhausted quotas, session limits, and budgets are auto-detected and stop the ret
167
167
  - **Usage / session limits with reset windows** — "You've hit your limit · resets …" and "5-hour limit reached" (Claude Code), "You've hit your usage limit" / "You've exceeded your usage limit" (Codex), "You have hit your ChatGPT usage limit (plus plan)" (ChatGPT subscription caps via the Codex backend, also `usage_limit_reached`)
168
168
  - **Plan / billing quotas** — OpenAI `insufficient_quota`, "You exceeded your current quota, please check your plan and billing details" (OpenAI, Gemini — reached only after pi's built-in 429 retry gives up)
169
169
  - **Google subscription caps** — "You have exhausted your capacity on this model. Your quota will reset after …" (Gemini Code Assist), "You have reached the quota limit for …" / "You can resume using this model at …" (Antigravity)
170
- - **Hard allotments** — OpenRouter `free-models-per-day`, Alibaba "Allocated quota exceeded" (`Throttling.AllocationQuota`), GitHub Copilot "premium request allowance", z.ai GLM Coding Plan "Usage limit reached for 5 hour" / "no resource package"
170
+ - **Hard allotments** — OpenRouter `free-models-per-day`, Alibaba Coding Plan window quotas "hour/week/month allocated quota exceeded" and free-quota exhaustion "free allocated quota exceeded" (the bare "Allocated quota exceeded" is TPM rate limiting and stays retryable), GitHub Copilot "premium request allowance", z.ai GLM Coding Plan "Usage limit reached for 5 hour" / "no resource package"
171
171
  - **Budget exhaustion** — "out of budget", "Budget has been exceeded" (LiteLLM-style proxies), max/spending/monthly limits
172
172
  - **Suspended accounts** — "Your account … is suspended" (Kimi `exceeded_current_quota_error`)
173
173
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monotykamary/pi-retry",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "Extension suite for pi coding agent that handles 400/413 errors and connection errors with automatic retry",
5
5
  "type": "module",
6
6
  "author": "Tom X Nguyen",
@@ -157,8 +157,11 @@ const SILENCED_PATTERNS = [
157
157
  // (Thinking). You can resume using this model at …" (Antigravity)
158
158
  // - OpenRouter: "Rate limit exceeded: free-models-per-day. ..."
159
159
  // - Alibaba: "Allocated quota exceeded, please increase your quota limit"
160
- // (Throttling.AllocationQuota hard cap; RateQuota is
161
- // transient and stays retryable)
160
+ // (429 Throttling.AllocationQuota / insufficient_quota) TPM
161
+ // token rate limiting, transient, auto-recovers in minutes;
162
+ // stays retryable. Matched only when prefixed by a hard-cap
163
+ // window: "hour|week|month allocated quota exceeded" (Coding
164
+ // Plan) and "free allocated quota exceeded" (free quota drained)
162
165
  // - Copilot: "You have exceeded your premium request allowance"
163
166
  // - LiteLLM: "Budget has been exceeded! Current cost: …, Max budget: …"
164
167
  // - Kimi: "Your account {org}<{ak}> is suspended, please check your
@@ -171,8 +174,9 @@ const SILENCED_PATTERNS = [
171
174
  //
172
175
  // Deliberately retryable (verified, kept out): DeepSeek 402 "Insufficient
173
176
  // Balance" and 429 "Rate Limit Reached" (concurrency), Kimi TPD org limits
174
- // and "exceeded your current token quota" (balance). See the note on
175
- // hasQuotaExhaustedError below.
177
+ // and "exceeded your current token quota" (balance), Alibaba "Allocated quota
178
+ // exceeded" (429 Throttling.AllocationQuota — TPM rate limiting, recovers in
179
+ // minutes). See the note on hasQuotaExhaustedError below.
176
180
  export const QUOTA_EXHAUSTED_PATTERNS = [
177
181
  // Session / usage limits with reset windows (Claude, Codex, ChatGPT plans)
178
182
  /hit your (?:[a-z]+ )?usage limit/i, // "…hit your usage limit", "…hit your ChatGPT usage limit (plus plan)" — the optional word is the provider name; "hit your rate limit" intentionally NOT matched (burst limit stays retryable)
@@ -188,7 +192,14 @@ export const QUOTA_EXHAUSTED_PATTERNS = [
188
192
  /exceeded your current quota/i, // Kimi's "...current token quota" (balance, retryable) intentionally not matched
189
193
  // Hard allotments
190
194
  /free.models.per.day/i, // OpenRouter free-tier daily pool
191
- /allocated\s*quota/i, // Alibaba Throttling.AllocationQuota
195
+ // Alibaba: bare "Allocated quota exceeded" (429 Throttling.AllocationQuota /
196
+ // insufficient_quota) is TPM token rate limiting — transient, auto-recovers
197
+ // in minutes, retryable — NOT matched here. Only the Coding Plan window
198
+ // quotas (hour/week/month) and free-quota exhaustion are true hard caps.
199
+ /hour\s*allocated\s*quota/i, // "hour allocated quota exceeded" (Coding Plan)
200
+ /week\s*allocated\s*quota/i, // "week allocated quota exceeded" (Coding Plan)
201
+ /month\s*allocated\s*quota/i, // "month allocated quota exceeded" (Coding Plan)
202
+ /free\s*allocated\s*quota/i, // "free allocated quota exceeded" (free quota drained)
192
203
  /premium\s*request\s*allowance/i, // GitHub Copilot monthly allowance
193
204
  /monthly\s*(limit|quota|budget|allowance)/i,
194
205
  // Budget exhaustion (LiteLLM and similar proxies/gateways)