-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Fix #1059: Ralph loop recipe doesn't create IMPLEMENTATION_PLAN.md #1281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -22,7 +22,7 @@ | |||||||||||
| import sys | ||||||||||||
| from pathlib import Path | ||||||||||||
|
|
||||||||||||
| from copilot import CopilotClient, MessageOptions, SessionConfig, PermissionHandler | ||||||||||||
| from copilot import CopilotClient, MessageOptions, SessionConfig | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| async def ralph_loop(mode: str = "build", max_iterations: int = 50): | ||||||||||||
|
|
@@ -47,8 +47,8 @@ async def ralph_loop(mode: str = "build", max_iterations: int = 50): | |||||||||||
| model="gpt-5.1-codex-mini", | ||||||||||||
| # Pin the agent to the project directory | ||||||||||||
| working_directory=str(Path.cwd()), | ||||||||||||
| # Auto-approve tool calls for unattended operation | ||||||||||||
| on_permission_request=PermissionHandler.approve_all, | ||||||||||||
| # Auto-approve all tool calls (including file writes) for unattended operation | ||||||||||||
| on_permission_request=lambda _req, _ctx: {"kind": "approved", "rules": []}, | ||||||||||||
| )) | ||||||||||||
|
|
||||||||||||
| # Log tool usage for visibility | ||||||||||||
|
|
@@ -62,7 +62,7 @@ def log_tool_event(event): | |||||||||||
| MessageOptions(prompt=prompt), timeout=600 | ||||||||||||
| ) | ||||||||||||
| finally: | ||||||||||||
|
||||||||||||
| finally: | |
| finally: | |
| # Prefer `disconnect()` for session cleanup in examples/recipes. | |
| # This keeps the lifecycle guidance aligned and avoids encouraging | |
| # copy/paste use of the older `destroy()` cleanup pattern. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The recipe now uses
session.disconnect()for cleanup, but the accompanying Ralph loop docs still showsession.destroy()(e.g.cookbook/copilot-sdk/nodejs/ralph-loop.md) and most other Node.js recipes still calldestroy(). To avoid confusing readers and keep examples consistent, either update the docs/examples to usedisconnect()(and explain the deprecation) or stick with the recommended cleanup method across the cookbook.