Remove git commands from Ralph loop recipes

Git operations (commit, push) belong in the prompt instructions, not
hardcoded in the loop orchestrator. The SDK recipes should focus purely
on the SDK API: create client, create session, send prompt, destroy.
This commit is contained in:
Anthony Shaw
2026-02-11 11:32:42 -08:00
parent 952372c1ec
commit 92df16da5a
8 changed files with 1 additions and 109 deletions

View File

@@ -82,7 +82,6 @@ The full Ralph pattern with planning and building modes, matching the [Ralph Pla
```typescript
import { readFile } from "fs/promises";
import { execSync } from "child_process";
import { CopilotClient } from "@github/copilot-sdk";
type Mode = "plan" | "build";
@@ -92,8 +91,7 @@ async function ralphLoop(mode: Mode, maxIterations: number = 50) {
const client = new CopilotClient();
await client.start();
const branch = execSync("git branch --show-current", { encoding: "utf-8" }).trim();
console.log(`Mode: ${mode} | Prompt: ${promptFile} | Branch: ${branch}`);
console.log(`Mode: ${mode} | Prompt: ${promptFile}`);
try {
const prompt = await readFile(promptFile, "utf-8");
@@ -109,13 +107,6 @@ async function ralphLoop(mode: Mode, maxIterations: number = 50) {
await session.destroy();
}
// Push changes after each iteration
try {
execSync(`git push origin ${branch}`, { stdio: "inherit" });
} catch {
execSync(`git push -u origin ${branch}`, { stdio: "inherit" });
}
console.log(`Iteration ${i} complete.`);
}
} finally {