Fix path handling: Explorer and Planner now emphasize full absolute paths
Browse files
codepilot/agents/explorer_agent.py
CHANGED
|
@@ -44,11 +44,12 @@ NEVER use read_file - it wastes tokens by reading entire files!
|
|
| 44 |
|
| 45 |
=== RESPONSE FORMAT ===
|
| 46 |
After finding the answer, respond with:
|
| 47 |
-
1.
|
| 48 |
-
2. Brief explanation of
|
| 49 |
3. Key code snippets if relevant
|
| 50 |
|
| 51 |
-
|
|
|
|
| 52 |
"""
|
| 53 |
|
| 54 |
|
|
|
|
| 44 |
|
| 45 |
=== RESPONSE FORMAT ===
|
| 46 |
After finding the answer, respond with:
|
| 47 |
+
1. FULL ABSOLUTE PATHS (e.g., /tmp/codepilot_repos/flask_abc123/examples/app.py)
|
| 48 |
+
2. Brief explanation of what you found
|
| 49 |
3. Key code snippets if relevant
|
| 50 |
|
| 51 |
+
CRITICAL: Always include the FULL path starting with /tmp/codepilot_repos or the repo root.
|
| 52 |
+
The Planner and Coder need exact paths to create files in the right location.
|
| 53 |
"""
|
| 54 |
|
| 55 |
|
codepilot/agents/planner_agent.py
CHANGED
|
@@ -62,9 +62,16 @@ Use the EXPLORATION RESULTS to understand the codebase structure and create your
|
|
| 62 |
- Be COMPLETE: Cover all aspects of the task
|
| 63 |
|
| 64 |
=== CRITICAL FOR CODER ===
|
| 65 |
-
The Coder will use your paths EXACTLY as written. Include the FULL path
|
| 66 |
-
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
You do NOT write code - just create the plan for the Coder agent to follow.
|
| 70 |
"""
|
|
|
|
| 62 |
- Be COMPLETE: Cover all aspects of the task
|
| 63 |
|
| 64 |
=== CRITICAL FOR CODER ===
|
| 65 |
+
The Coder will use your paths EXACTLY as written. Include the FULL ABSOLUTE path.
|
| 66 |
+
|
| 67 |
+
1. Find the repo path in the exploration context (e.g., "Path: /tmp/codepilot_repos/flask_abc123")
|
| 68 |
+
2. Use that path as prefix for ALL file paths in your plan
|
| 69 |
+
|
| 70 |
+
Example: If repo path is /tmp/codepilot_repos/flask_abc123
|
| 71 |
+
- CORRECT: "Create file: /tmp/codepilot_repos/flask_abc123/examples/health_check/app.py"
|
| 72 |
+
- WRONG: "Create file: examples/health_check/app.py"
|
| 73 |
+
|
| 74 |
+
The Coder CANNOT write files without the full absolute path!
|
| 75 |
|
| 76 |
You do NOT write code - just create the plan for the Coder agent to follow.
|
| 77 |
"""
|