@skj1724/oh-my-opencode 3.19.11 → 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 +42 -14
- 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,11 +25023,28 @@ function createRuntimeFallbackHook(ctx, options) {
|
|
|
25023
25023
|
}
|
|
25024
25024
|
return false;
|
|
25025
25025
|
}
|
|
25026
|
-
if (event.type !== "session.error")
|
|
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
|
-
|
|
25030
|
-
|
|
25029
|
+
let sessionID;
|
|
25030
|
+
let error;
|
|
25031
|
+
let retryAttempt;
|
|
25032
|
+
if (event.type === "session.error") {
|
|
25033
|
+
sessionID = props?.sessionID;
|
|
25034
|
+
error = props?.error;
|
|
25035
|
+
} else if (event.type === "message.updated") {
|
|
25036
|
+
const info = props?.info;
|
|
25037
|
+
sessionID = info?.sessionID;
|
|
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;
|
|
25047
|
+
}
|
|
25031
25048
|
if (!sessionID || error === undefined || error === null)
|
|
25032
25049
|
return false;
|
|
25033
25050
|
if (options?.sessionRecovery?.isRecoverableError(error)) {
|
|
@@ -25040,7 +25057,9 @@ function createRuntimeFallbackHook(ctx, options) {
|
|
|
25040
25057
|
errorType: typeof error,
|
|
25041
25058
|
errorKeys: error && typeof error === "object" ? Object.keys(error) : [],
|
|
25042
25059
|
messageSnippet: classification.reason?.substring(0, 100),
|
|
25043
|
-
sessionID
|
|
25060
|
+
sessionID,
|
|
25061
|
+
eventType: event.type,
|
|
25062
|
+
retryAttempt
|
|
25044
25063
|
});
|
|
25045
25064
|
if (classification.category === "context_overflow") {
|
|
25046
25065
|
return false;
|
|
@@ -25049,17 +25068,26 @@ function createRuntimeFallbackHook(ctx, options) {
|
|
|
25049
25068
|
return false;
|
|
25050
25069
|
}
|
|
25051
25070
|
if (classification.category === "rate_limit") {
|
|
25052
|
-
const
|
|
25053
|
-
|
|
25054
|
-
|
|
25055
|
-
|
|
25056
|
-
|
|
25057
|
-
|
|
25058
|
-
}
|
|
25059
|
-
|
|
25060
|
-
|
|
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);
|
|
25061
25090
|
}
|
|
25062
|
-
retryStates.delete(sessionID);
|
|
25063
25091
|
}
|
|
25064
25092
|
if (classification.category !== "quota" && classification.category !== "rate_limit") {
|
|
25065
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",
|