From 0c3b77c06028205aac0184973037355689fc3c9e Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Mon, 1 Dec 2025 22:28:30 -0500 Subject: Compact amp-style timeline rendering and targeted file reading MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Timeline tool display: - Grep/search: ✓ Grep pattern in filepath - Read file: ✓ Read filepath @start-end - Edit file: ✓ Edit filepath - Bash: ϟ command (lightning bolt prompt) - Tool results only shown for meaningful output New search_and_read tool: - Combines search + read in one operation - Uses ripgrep --context for surrounding lines - More efficient than separate search then read Worker prompt updated to prefer search_and_read over separate search + read_file calls --- Omni/Agent/Worker.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Omni/Agent/Worker.hs') diff --git a/Omni/Agent/Worker.hs b/Omni/Agent/Worker.hs index 07293c5..45caf9b 100644 --- a/Omni/Agent/Worker.hs +++ b/Omni/Agent/Worker.hs @@ -399,12 +399,14 @@ 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" + <> "EFFICIENT FILE READING:\n" + <> "- PREFER search_and_read over separate search + read_file calls\n" + <> "- search_and_read finds code AND returns context around matches in one call\n" + <> "- Only use read_file with line ranges (start_line/end_line) for targeted reads\n" + <> "- NEVER read entire large files - always search first, then read specific 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" + <> "- After 2-3 failed edits on the same file, STOP and reconsider your approach\n\n" <> "Context:\n" <> "- Working directory: " <> Text.pack repo -- cgit v1.2.3