From 67e55ec86828d598fa30e96944ca2b38a15a3bf9 Mon Sep 17 00:00:00 2001 From: Story Crater Bot <19826264+Riotpiaole@users.noreply.github.com> Date: Tue, 18 Aug 2026 18:57:18 -0700 Subject: [PATCH] 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. --- k8s/apps/agent-pod/coordinator-configmap.yaml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/k8s/apps/agent-pod/coordinator-configmap.yaml b/k8s/apps/agent-pod/coordinator-configmap.yaml index ca8a548..6634187 100644 --- a/k8s/apps/agent-pod/coordinator-configmap.yaml +++ b/k8s/apps/agent-pod/coordinator-configmap.yaml @@ -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