@skj1724/oh-my-opencode 3.19.13 → 3.19.15

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/dist/cli/index.js CHANGED
@@ -8467,7 +8467,7 @@ var import_picocolors2 = __toESM(require_picocolors(), 1);
8467
8467
  // package.json
8468
8468
  var package_default = {
8469
8469
  name: "@skj1724/oh-my-opencode",
8470
- version: "3.19.13",
8470
+ version: "3.19.15",
8471
8471
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
8472
8472
  main: "dist/index.js",
8473
8473
  types: "dist/index.d.ts",
package/dist/index.js CHANGED
@@ -24709,7 +24709,10 @@ function isZhipuQuotaCode(code) {
24709
24709
  }
24710
24710
  function isGenericQuotaMessage(message) {
24711
24711
  const m = message.toLowerCase();
24712
- return m.includes("usage quota") || m.includes("quota exceeded") || m.includes("exceeded your quota") || m.includes("quota") && m.includes("exceeded") || m.includes("upgrade your plan");
24712
+ if (m.includes("per_minute") || m.includes("per minute") || m.includes("per_second") || m.includes("per second") || m.includes("per_day") || m.includes("per day")) {
24713
+ return false;
24714
+ }
24715
+ return m.includes("usage quota") || m.includes("quota exceeded") || m.includes("exceeded your quota") || m.includes("quota") && m.includes("exceeded") || m.includes("upgrade your plan") || m.includes("usage limit") || m.includes("available balance") || m.includes("enable usage from");
24713
24716
  }
24714
24717
  function isZhipuRateLimitCode(code) {
24715
24718
  if (typeof code !== "number")
@@ -24842,6 +24845,15 @@ function classifyProviderError(error) {
24842
24845
  reason: `Zhipu/GLM: ${quotaReasons[code] ?? "quota exceeded"}`
24843
24846
  };
24844
24847
  }
24848
+ if (isGenericQuotaMessage(message)) {
24849
+ return {
24850
+ category: "quota",
24851
+ retryable: false,
24852
+ shouldFallback: true,
24853
+ statusCode,
24854
+ reason: `Quota exceeded: ${message.substring(0, 100)}`
24855
+ };
24856
+ }
24845
24857
  if (statusCode === 529 && type2 === "overloaded_error") {
24846
24858
  return {
24847
24859
  category: "overloaded",
@@ -24998,6 +25010,7 @@ init_runtime_fallback();
24998
25010
  function createRuntimeFallbackHook(ctx, options) {
24999
25011
  const retryStates = new Map;
25000
25012
  const fallbackAttempts = new Map;
25013
+ const interruptingSessions = new Map;
25001
25014
  const config = options?.config ?? {
25002
25015
  enabled: true,
25003
25016
  max_attempts: 3,
@@ -25020,6 +25033,7 @@ function createRuntimeFallbackHook(ctx, options) {
25020
25033
  if (sessionID2) {
25021
25034
  retryStates.delete(sessionID2);
25022
25035
  fallbackAttempts.delete(sessionID2);
25036
+ interruptingSessions.delete(sessionID2);
25023
25037
  }
25024
25038
  return false;
25025
25039
  }
@@ -25129,6 +25143,22 @@ function createRuntimeFallbackHook(ctx, options) {
25129
25143
  if (fallbackResult.kind !== "next") {
25130
25144
  return false;
25131
25145
  }
25146
+ const isRetryPartEvent = event.type === "message.part.updated" && retryAttempt !== undefined;
25147
+ if (isRetryPartEvent) {
25148
+ if (interruptingSessions.get(sessionID)) {
25149
+ return false;
25150
+ }
25151
+ interruptingSessions.set(sessionID, true);
25152
+ try {
25153
+ await ctx.client.session.abort({ path: { id: sessionID } });
25154
+ log("[runtime-fallback] aborted retry loop", { sessionID, retryAttempt });
25155
+ } catch (abortErr) {
25156
+ log("[runtime-fallback] abort failed, falling through to direct prompt", {
25157
+ sessionID,
25158
+ error: String(abortErr)
25159
+ });
25160
+ }
25161
+ }
25132
25162
  try {
25133
25163
  await ctx.client.session.prompt({
25134
25164
  path: { id: sessionID },
@@ -25146,6 +25176,10 @@ function createRuntimeFallbackHook(ctx, options) {
25146
25176
  { model: fallbackResult.model, error: classifyProviderError(fallbackError) }
25147
25177
  ]);
25148
25178
  return false;
25179
+ } finally {
25180
+ if (isRetryPartEvent) {
25181
+ interruptingSessions.delete(sessionID);
25182
+ }
25149
25183
  }
25150
25184
  };
25151
25185
  return { handler };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skj1724/oh-my-opencode",
3
- "version": "3.19.13",
3
+ "version": "3.19.15",
4
4
  "description": "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",