opencode-auto-resume 1.0.15 → 1.0.16
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 +26 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12414,7 +12414,9 @@ var DONE_CLAIM_PATTERNS = [
|
|
|
12414
12414
|
/^finished[.!]*$/im,
|
|
12415
12415
|
/^complete[.!]*$/im,
|
|
12416
12416
|
/^task\s+complete[.!]*$/im,
|
|
12417
|
+
/^task\s+completed[.!]*$/im,
|
|
12417
12418
|
/^all\s+tasks?\s+complete[.!]*$/im,
|
|
12419
|
+
/^all\s+tasks?\s+completed[.!]*$/im,
|
|
12418
12420
|
/^(?:i['']?m\s+)?done\s+with\s+task/im
|
|
12419
12421
|
];
|
|
12420
12422
|
var DONE_WITHOUT_WORK_PROMPT = "I need you to verify more carefully that you have actually completed all the required tasks. " + "Your response indicated you're done, but no work was detected. Please check your todo list " + "and complete any remaining work.";
|
|
@@ -12842,6 +12844,18 @@ var AutoResumePlugin = async (ctx, options) => {
|
|
|
12842
12844
|
bestCandidate = candidate;
|
|
12843
12845
|
}
|
|
12844
12846
|
}
|
|
12847
|
+
if (!bestCandidate && containsDoneClaimPattern(text)) {
|
|
12848
|
+
const todos = w.todos || [];
|
|
12849
|
+
const hasOpenTodos = todos.some((t) => t.status === "pending" || t.status === "in_progress");
|
|
12850
|
+
if (hasOpenTodos) {
|
|
12851
|
+
await log("info", `${short(sid)} - model claims done but todos remain open. Sending recovery prompt...`);
|
|
12852
|
+
bestCandidate = {
|
|
12853
|
+
prompt: DONE_WITHOUT_WORK_PROMPT,
|
|
12854
|
+
source: "done-claim-no-emoji",
|
|
12855
|
+
priority: 1
|
|
12856
|
+
};
|
|
12857
|
+
}
|
|
12858
|
+
}
|
|
12845
12859
|
}
|
|
12846
12860
|
}
|
|
12847
12861
|
const trimmedText = allAssistantText.trim();
|
|
@@ -12855,6 +12869,18 @@ var AutoResumePlugin = async (ctx, options) => {
|
|
|
12855
12869
|
}
|
|
12856
12870
|
return;
|
|
12857
12871
|
}
|
|
12872
|
+
if (!bestCandidate) {
|
|
12873
|
+
const todos = w.todos || [];
|
|
12874
|
+
const hasOpenTodos = todos.some((t) => t.status === "pending" || t.status === "in_progress");
|
|
12875
|
+
if (hasOpenTodos) {
|
|
12876
|
+
await log("info", `${short(sid)} - no activity detected but todos remain open (${todos.filter((t) => t.status === "pending" || t.status === "in_progress").length} tasks). Sending continue...`);
|
|
12877
|
+
bestCandidate = {
|
|
12878
|
+
prompt: "continue",
|
|
12879
|
+
source: "idle-with-open-todos",
|
|
12880
|
+
priority: 2
|
|
12881
|
+
};
|
|
12882
|
+
}
|
|
12883
|
+
}
|
|
12858
12884
|
if (!bestCandidate)
|
|
12859
12885
|
return;
|
|
12860
12886
|
w.toolTextRecovered = true;
|
package/package.json
CHANGED