mirror of
https://github.com/github/awesome-copilot.git
synced 2026-02-21 02:45:12 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user