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

@@ -1,7 +1,6 @@
#:package GitHub.Copilot.SDK@*
#:property PublishAot=false
using System.Diagnostics;
using GitHub.Copilot.SDK;
// Ralph loop: autonomous AI task loop with fresh context per iteration.
@@ -28,15 +27,9 @@ var promptFile = mode == "plan" ? "PROMPT_plan.md" : "PROMPT_build.md";
var client = new CopilotClient();
await client.StartAsync();
var branchProc = Process.Start(new ProcessStartInfo("git", "branch --show-current")
{ RedirectStandardOutput = true })!;
var branch = (await branchProc.StandardOutput.ReadToEndAsync()).Trim();
await branchProc.WaitForExitAsync();
Console.WriteLine(new string('━', 40));
Console.WriteLine($"Mode: {mode}");
Console.WriteLine($"Prompt: {promptFile}");
Console.WriteLine($"Branch: {branch}");
Console.WriteLine($"Max: {maxIterations} iterations");
Console.WriteLine(new string('━', 40));
@@ -69,16 +62,6 @@ try
await session.DisposeAsync();
}
// Push changes after each iteration
try
{
Process.Start("git", $"push origin {branch}")!.WaitForExit();
}
catch
{
Process.Start("git", $"push -u origin {branch}")!.WaitForExit();
}
Console.WriteLine($"\nIteration {i} complete.");
}