mirror of
https://github.com/github/awesome-copilot.git
synced 2026-02-20 10: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:
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user