fix(agent-pod): clone deterministically, not through a headless LLM call
git clone is mechanical -- routing it through spawnPi meant a crash gave zero diagnostic output, just a silent exit code. Direct runGit call now, same as commitPending/the squash-merge sequence. Drops the now-unused runStageWithResolver.
This commit is contained in:
@@ -159,14 +159,6 @@ data:
|
||||
return parseVerdictLine(result.lastText, "RESOLUTION");
|
||||
}
|
||||
|
||||
async function runStageWithResolver(cwd, stage, prompt, task) {
|
||||
let result = await spawnPi({ agent: stage, prompt, cwd });
|
||||
if (result.code === 0) return result;
|
||||
const resolution = await askResolver(cwd, task, `Stage "${stage}" exited with code ${result.code}. Its stderr tail:\n${result.stderrTail}`);
|
||||
if (resolution === "RETRY") result = await spawnPi({ agent: stage, prompt, cwd });
|
||||
return result;
|
||||
}
|
||||
|
||||
function taskSessionLabel(task) {
|
||||
return `task-${task.replace(/[^a-zA-Z0-9]/g, "-")}`;
|
||||
}
|
||||
@@ -666,8 +658,16 @@ data:
|
||||
return pipelineSession;
|
||||
};
|
||||
|
||||
const clone = await runStageWithResolver(cwd, "planner", `Run exactly this command, verbatim, no variation: git clone --branch ${baseBranch} ${repo} . -- the trailing dot is required, it clones directly into the current directory instead of creating a subdirectory. Do not cd anywhere first or after. Do nothing else.`, "clone");
|
||||
if (clone.code !== 0) return finish("clone-crashed");
|
||||
// Deterministic, not routed through an LLM -- clone is 100% mechanical
|
||||
// (same reasoning as commitPending/the squash-merge sequence below), and
|
||||
// was the one place left that broke that pattern: a headless spawnPi
|
||||
// call here meant a crash gave zero diagnostic output, just a silent
|
||||
// exit code with nothing to debug from.
|
||||
const clone = await runGit(cwd, ["clone", "--branch", baseBranch, repo, "."]);
|
||||
if (clone.code !== 0) {
|
||||
pipelineSession.gitError = clone.out;
|
||||
return finish("clone-crashed");
|
||||
}
|
||||
if (!fs.existsSync(path.join(cwd, ".git"))) return finish("clone-missing");
|
||||
|
||||
// No --tasks given: discover the phase/task board from the repo's own
|
||||
|
||||
Reference in New Issue
Block a user