opencode-auto-resume 1.0.18 → 1.0.19
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/index.js +16 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12878,6 +12878,22 @@ var AutoResumePlugin = async (ctx, options) => {
|
|
|
12878
12878
|
}
|
|
12879
12879
|
}
|
|
12880
12880
|
if (containsToolCallAsText(text)) {
|
|
12881
|
+
const toolMatch = text.match(/<function=([a-zA-Z_]+)/) || text.match(/<invoke\s+name=([a-zA-Z_]+)/) || text.match(/"name":\s*"([a-zA-Z_]+)/);
|
|
12882
|
+
if (toolMatch) {
|
|
12883
|
+
const toolName2 = toolMatch[1] || "unknown";
|
|
12884
|
+
const isLoop = trackToolCall(w, toolName2);
|
|
12885
|
+
if (isLoop && w.toolLoopAttempts < 2) {
|
|
12886
|
+
w.toolLoopAttempts++;
|
|
12887
|
+
const loopCandidate = {
|
|
12888
|
+
prompt: TOOL_LOOP_RECOVERY_PROMPT,
|
|
12889
|
+
source: "tool-text-loop",
|
|
12890
|
+
priority: 0
|
|
12891
|
+
};
|
|
12892
|
+
if (!bestCandidate || loopCandidate.priority < bestCandidate.priority) {
|
|
12893
|
+
bestCandidate = loopCandidate;
|
|
12894
|
+
}
|
|
12895
|
+
}
|
|
12896
|
+
}
|
|
12881
12897
|
const candidate = {
|
|
12882
12898
|
prompt: isReasoning ? THINKING_TOOL_RECOVERY_PROMPT : TOOL_TEXT_RECOVERY_PROMPT,
|
|
12883
12899
|
source: isReasoning ? "reasoning" : "text",
|
package/package.json
CHANGED