diff options
| author | Ben Sima <ben@bensima.com> | 2025-12-01 16:13:00 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bensima.com> | 2025-12-01 16:13:00 -0500 |
| commit | 66529950ff99fd96b8e15f1e0da3a6b6add98bd3 (patch) | |
| tree | 62c383e19843d340347f3ba36399abcdc9db5904 | |
| parent | 69d3313c39e739aab725ac9fbdd421620ae19d69 (diff) | |
Add prompt guidance for large file editing
Instructs the agent to:
- Use line ranges when reading large files (>500 lines)
- Use minimal context for edit_file old_str matching
- Re-read exact lines after failed edits
- Stop after 2-3 failed edits to reconsider approach
- Flag very large files (>2000 lines) for refactoring
Task-Id: t-225
| -rw-r--r-- | Omni/Agent/Worker.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Omni/Agent/Worker.hs b/Omni/Agent/Worker.hs index d79adaa..c52d4a9 100644 --- a/Omni/Agent/Worker.hs +++ b/Omni/Agent/Worker.hs @@ -377,6 +377,12 @@ buildBasePrompt task ns repo = <> "- Do not re-run passing tests\n" <> "- Do not test files individually when namespace test covers them\n" <> "- Aim to complete the task in under 50 tool calls\n\n" + <> "LARGE FILE HANDLING:\n" + <> "- When reading large files (>500 lines), use line ranges to read only relevant sections\n" + <> "- For edit_file, use minimal unique context - just enough lines to match uniquely\n" + <> "- If edit_file fails with 'old_str not found', re-read the exact lines you need to edit\n" + <> "- After 2-3 failed edits on the same file, STOP and reconsider your approach\n" + <> "- Very large files (>2000 lines) may need refactoring - note this for human review\n\n" <> "Context:\n" <> "- Working directory: " <> Text.pack repo |
