@skj1724/oh-my-opencode 3.19.12 → 3.19.13
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 +1 -1
- package/dist/index.js +32 -13
- package/package.json +1 -1
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.
|
|
8470
|
+
version: "3.19.13",
|
|
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
|
@@ -25023,18 +25023,27 @@ function createRuntimeFallbackHook(ctx, options) {
|
|
|
25023
25023
|
}
|
|
25024
25024
|
return false;
|
|
25025
25025
|
}
|
|
25026
|
-
if (event.type !== "session.error" && event.type !== "message.updated")
|
|
25026
|
+
if (event.type !== "session.error" && event.type !== "message.updated" && event.type !== "message.part.updated")
|
|
25027
25027
|
return false;
|
|
25028
25028
|
const props = event.properties;
|
|
25029
25029
|
let sessionID;
|
|
25030
25030
|
let error;
|
|
25031
|
+
let retryAttempt;
|
|
25031
25032
|
if (event.type === "session.error") {
|
|
25032
25033
|
sessionID = props?.sessionID;
|
|
25033
25034
|
error = props?.error;
|
|
25034
|
-
} else {
|
|
25035
|
+
} else if (event.type === "message.updated") {
|
|
25035
25036
|
const info = props?.info;
|
|
25036
25037
|
sessionID = info?.sessionID;
|
|
25037
25038
|
error = info?.error;
|
|
25039
|
+
} else {
|
|
25040
|
+
const part = props?.part;
|
|
25041
|
+
if (part?.type !== "retry")
|
|
25042
|
+
return false;
|
|
25043
|
+
const retryPart = part;
|
|
25044
|
+
sessionID = retryPart.sessionID ?? props?.sessionID;
|
|
25045
|
+
error = retryPart.error;
|
|
25046
|
+
retryAttempt = retryPart.attempt;
|
|
25038
25047
|
}
|
|
25039
25048
|
if (!sessionID || error === undefined || error === null)
|
|
25040
25049
|
return false;
|
|
@@ -25049,7 +25058,8 @@ function createRuntimeFallbackHook(ctx, options) {
|
|
|
25049
25058
|
errorKeys: error && typeof error === "object" ? Object.keys(error) : [],
|
|
25050
25059
|
messageSnippet: classification.reason?.substring(0, 100),
|
|
25051
25060
|
sessionID,
|
|
25052
|
-
eventType: event.type
|
|
25061
|
+
eventType: event.type,
|
|
25062
|
+
retryAttempt
|
|
25053
25063
|
});
|
|
25054
25064
|
if (classification.category === "context_overflow") {
|
|
25055
25065
|
return false;
|
|
@@ -25058,17 +25068,26 @@ function createRuntimeFallbackHook(ctx, options) {
|
|
|
25058
25068
|
return false;
|
|
25059
25069
|
}
|
|
25060
25070
|
if (classification.category === "rate_limit") {
|
|
25061
|
-
const
|
|
25062
|
-
|
|
25063
|
-
|
|
25064
|
-
|
|
25065
|
-
|
|
25066
|
-
|
|
25067
|
-
}
|
|
25068
|
-
|
|
25069
|
-
|
|
25071
|
+
const effectiveAttempt = retryAttempt ?? retryStates.get(sessionID)?.attempt ?? 0;
|
|
25072
|
+
if (retryAttempt !== undefined) {
|
|
25073
|
+
if (effectiveAttempt >= config.max_retries_before_fallback) {
|
|
25074
|
+
retryStates.delete(sessionID);
|
|
25075
|
+
} else {
|
|
25076
|
+
return false;
|
|
25077
|
+
}
|
|
25078
|
+
} else {
|
|
25079
|
+
const state2 = retryStates.get(sessionID) ?? { attempt: 0, lastAttemptTime: Date.now() };
|
|
25080
|
+
const decision = calculateRetryDelay(state2.attempt, config, classification.retryAfterMs);
|
|
25081
|
+
if (decision.retryable && state2.attempt < config.max_retries_before_fallback) {
|
|
25082
|
+
retryStates.set(sessionID, {
|
|
25083
|
+
attempt: state2.attempt + 1,
|
|
25084
|
+
lastAttemptTime: Date.now()
|
|
25085
|
+
});
|
|
25086
|
+
await new Promise((resolve8) => setTimeout(resolve8, decision.delay_ms));
|
|
25087
|
+
return false;
|
|
25088
|
+
}
|
|
25089
|
+
retryStates.delete(sessionID);
|
|
25070
25090
|
}
|
|
25071
|
-
retryStates.delete(sessionID);
|
|
25072
25091
|
}
|
|
25073
25092
|
if (classification.category !== "quota" && classification.category !== "rate_limit") {
|
|
25074
25093
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skj1724/oh-my-opencode",
|
|
3
|
-
"version": "3.19.
|
|
3
|
+
"version": "3.19.13",
|
|
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",
|