mirror of
https://github.com/github/awesome-copilot.git
synced 2026-02-22 11:25:13 +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:
@@ -92,7 +92,6 @@ This is all you need to get started. The prompt file tells the agent what to do;
|
||||
The full Ralph pattern with planning and building modes, matching the [Ralph Playbook](https://github.com/ClaytonFarr/ralph-playbook) architecture:
|
||||
|
||||
```csharp
|
||||
using System.Diagnostics;
|
||||
using GitHub.Copilot.SDK;
|
||||
|
||||
// Parse args: dotnet run [plan] [max_iterations]
|
||||
@@ -104,16 +103,9 @@ var promptFile = mode == "plan" ? "PROMPT_plan.md" : "PROMPT_build.md";
|
||||
var client = new CopilotClient();
|
||||
await client.StartAsync();
|
||||
|
||||
var branchInfo = new ProcessStartInfo("git", "branch --show-current")
|
||||
{ RedirectStandardOutput = true };
|
||||
var branch = Process.Start(branchInfo)!;
|
||||
var branchName = (await branch.StandardOutput.ReadToEndAsync()).Trim();
|
||||
await branch.WaitForExitAsync();
|
||||
|
||||
Console.WriteLine(new string('━', 40));
|
||||
Console.WriteLine($"Mode: {mode}");
|
||||
Console.WriteLine($"Prompt: {promptFile}");
|
||||
Console.WriteLine($"Branch: {branchName}");
|
||||
Console.WriteLine($"Max: {maxIterations} iterations");
|
||||
Console.WriteLine(new string('━', 40));
|
||||
|
||||
@@ -145,16 +137,6 @@ try
|
||||
await session.DisposeAsync();
|
||||
}
|
||||
|
||||
// Push changes after each iteration
|
||||
try
|
||||
{
|
||||
Process.Start("git", $"push origin {branchName}")!.WaitForExit();
|
||||
}
|
||||
catch
|
||||
{
|
||||
Process.Start("git", $"push -u origin {branchName}")!.WaitForExit();
|
||||
}
|
||||
|
||||
Console.WriteLine($"\nIteration {i} complete.");
|
||||
}
|
||||
|
||||
|
||||
@@ -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.");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user