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

@@ -85,7 +85,6 @@ The full Ralph pattern with planning and building modes, matching the [Ralph Pla
```python
import asyncio
import subprocess
import sys
from pathlib import Path
@@ -97,14 +96,9 @@ async def ralph_loop(mode: str = "build", max_iterations: int = 50):
client = CopilotClient()
await client.start()
branch = subprocess.check_output(
["git", "branch", "--show-current"], text=True
).strip()
print("" * 40)
print(f"Mode: {mode}")
print(f"Prompt: {prompt_file}")
print(f"Branch: {branch}")
print(f"Max: {max_iterations} iterations")
print("" * 40)
@@ -125,16 +119,6 @@ async def ralph_loop(mode: str = "build", max_iterations: int = 50):
finally:
await session.destroy()
# Push changes after each iteration
try:
subprocess.run(
["git", "push", "origin", branch], check=True
)
except subprocess.CalledProcessError:
subprocess.run(
["git", "push", "-u", "origin", branch], check=True
)
print(f"\nIteration {i} complete.")
print(f"\nReached max iterations: {max_iterations}")

View File

@@ -19,7 +19,6 @@ Usage:
"""
import asyncio
import subprocess
import sys
from pathlib import Path
@@ -32,14 +31,9 @@ async def ralph_loop(mode: str = "build", max_iterations: int = 50):
client = CopilotClient()
await client.start()
branch = subprocess.check_output(
["git", "branch", "--show-current"], text=True
).strip()
print("" * 40)
print(f"Mode: {mode}")
print(f"Prompt: {prompt_file}")
print(f"Branch: {branch}")
print(f"Max: {max_iterations} iterations")
print("" * 40)
@@ -60,16 +54,6 @@ async def ralph_loop(mode: str = "build", max_iterations: int = 50):
finally:
await session.destroy()
# Push changes after each iteration
try:
subprocess.run(
["git", "push", "origin", branch], check=True
)
except subprocess.CalledProcessError:
subprocess.run(
["git", "push", "-u", "origin", branch], check=True
)
print(f"\nIteration {i} complete.")
print(f"\nReached max iterations: {max_iterations}")