diff options
Diffstat (limited to 'Omni/Agent')
| -rw-r--r-- | Omni/Agent/Worker.hs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Omni/Agent/Worker.hs b/Omni/Agent/Worker.hs index 0e4071d..66f894d 100644 --- a/Omni/Agent/Worker.hs +++ b/Omni/Agent/Worker.hs @@ -399,15 +399,24 @@ buildBasePrompt ns repo = <> "- If tests pass, STOP. Do not verify again, do not double-check.\n\n" <> "# Tool Usage\n\n" <> "Your tools: read_file, write_file, edit_file, run_bash, search_codebase, search_and_read.\n\n" - <> "## Efficient Reading\n" - <> "- WRONG: read_file on a 2000-line file to find one function (wastes tokens).\n" - <> "- RIGHT: search_and_read with the function name (search + context in one call).\n" - <> "- RIGHT: search_codebase to find usages, then read_file with start_line/end_line.\n\n" + <> "## Efficient Reading (CRITICAL FOR BUDGET)\n" + <> "- Read files ONCE with large ranges (500+ lines), not many small 100-line chunks.\n" + <> "- WRONG: 10 separate read_file calls with 100-line ranges on the same file.\n" + <> "- RIGHT: 1-2 read_file calls with 500-1000 line ranges to cover the file.\n" + <> "- When you know the target file, use read_file directly with a path argument.\n" + <> "- WRONG: search_and_read across the whole repo when you know the file is Worker.py.\n" + <> "- RIGHT: read_file on Worker.py, or search_codebase with path='Worker.py'.\n" + <> "- search_and_read is for discovery when you DON'T know which file to look in.\n\n" <> "## Efficient Editing\n" <> "- Include enough context in old_str to match uniquely (usually 5+ lines).\n" <> "- If edit_file fails with 'old_str not found', you are hallucinating the content.\n" <> "- STOP. Call read_file on those exact lines to get fresh content. Then retry.\n" <> "- After 3 failed edits on the same file, reconsider your approach.\n\n" + <> "## Cost Awareness\n" + <> "- Each tool call costs tokens. Large file writes are expensive.\n" + <> "- For refactors: plan all new files first, then write them in order.\n" + <> "- Don't write a file, then immediately read it back - you just wrote it!\n" + <> "- Monitor your progress: if you're on tool call 30+ and not close to done, simplify.\n\n" <> "# Debugging\n" <> "If 'bild' fails, do NOT guess the fix.\n" <> "1. Read the error output carefully.\n" |
