prloom 0.1.4 → 0.1.5
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 +41 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -17916,6 +17916,30 @@ async function processActivePlans(repoRoot, config, state, botLogin, options2 =
|
|
|
17916
17916
|
if (!isManualAgent && plan.frontmatter.status !== "blocked" && plan.frontmatter.status !== "done") {
|
|
17917
17917
|
const todo = findNextUnchecked(plan);
|
|
17918
17918
|
if (todo) {
|
|
17919
|
+
const MAX_TODO_RETRIES = 3;
|
|
17920
|
+
if (ps.lastTodoIndex === todo.index) {
|
|
17921
|
+
ps.todoRetryCount = (ps.todoRetryCount ?? 0) + 1;
|
|
17922
|
+
console.log(` [retry ${ps.todoRetryCount}/${MAX_TODO_RETRIES} for TODO #${todo.index}]`);
|
|
17923
|
+
if (ps.todoRetryCount >= MAX_TODO_RETRIES) {
|
|
17924
|
+
console.error(`❌ TODO #${todo.index} failed ${MAX_TODO_RETRIES} times, blocking plan`);
|
|
17925
|
+
const planPath2 = join9(ps.worktree, ps.planRelpath);
|
|
17926
|
+
setStatus(planPath2, "blocked");
|
|
17927
|
+
ps.lastError = `TODO #${todo.index} failed after ${MAX_TODO_RETRIES} retries - worker did not mark it complete`;
|
|
17928
|
+
if (ps.pr) {
|
|
17929
|
+
await postPRComment(repoRoot, ps.pr, `❌ **Plan blocked**: TODO #${todo.index} failed after ${MAX_TODO_RETRIES} attempts.
|
|
17930
|
+
|
|
17931
|
+
The worker did not mark this TODO as complete. Please investigate manually.
|
|
17932
|
+
|
|
17933
|
+
\`\`\`
|
|
17934
|
+
prloom unpause ${planId}
|
|
17935
|
+
\`\`\``);
|
|
17936
|
+
}
|
|
17937
|
+
continue;
|
|
17938
|
+
}
|
|
17939
|
+
} else {
|
|
17940
|
+
ps.lastTodoIndex = todo.index;
|
|
17941
|
+
ps.todoRetryCount = 0;
|
|
17942
|
+
}
|
|
17919
17943
|
console.log(`\uD83D\uDD27 Running TODO #${todo.index} for ${planId}: ${todo.text}`);
|
|
17920
17944
|
const prompt = renderWorkerPrompt(repoRoot, plan, todo);
|
|
17921
17945
|
const agentName = plan.frontmatter.agent ?? config.agents.default;
|
|
@@ -17925,10 +17949,26 @@ async function processActivePlans(repoRoot, config, state, botLogin, options2 =
|
|
|
17925
17949
|
ps.tmuxSession = tmuxConfig.sessionName;
|
|
17926
17950
|
console.log(` [spawned in tmux session: ${tmuxConfig.sessionName}]`);
|
|
17927
17951
|
}
|
|
17928
|
-
await adapter.execute({
|
|
17952
|
+
const execResult = await adapter.execute({
|
|
17953
|
+
cwd: ps.worktree,
|
|
17954
|
+
prompt,
|
|
17955
|
+
tmux: tmuxConfig
|
|
17956
|
+
});
|
|
17929
17957
|
if (tmuxConfig) {
|
|
17930
17958
|
ps.tmuxSession = undefined;
|
|
17931
17959
|
}
|
|
17960
|
+
if (execResult.exitCode !== 0) {
|
|
17961
|
+
console.warn(` ⚠️ Worker exited with code ${execResult.exitCode}`);
|
|
17962
|
+
}
|
|
17963
|
+
const updatedPlan = parsePlan(planPath);
|
|
17964
|
+
const updatedTodo = updatedPlan.todos[todo.index];
|
|
17965
|
+
if (!updatedTodo?.done) {
|
|
17966
|
+
console.warn(` ⚠️ TODO #${todo.index} was NOT marked complete by worker`);
|
|
17967
|
+
continue;
|
|
17968
|
+
}
|
|
17969
|
+
ps.lastTodoIndex = undefined;
|
|
17970
|
+
ps.todoRetryCount = undefined;
|
|
17971
|
+
console.log(` ✓ TODO #${todo.index} marked complete`);
|
|
17932
17972
|
const committed = await commitAll(ps.worktree, `[prloom] ${planId}: TODO #${todo.index}`);
|
|
17933
17973
|
if (committed) {
|
|
17934
17974
|
await push(ps.worktree, ps.branch);
|