summaryrefslogtreecommitdiff
path: root/Omni
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-11-24 12:46:56 -0500
committerBen Sima <ben@bensima.com>2025-11-24 12:46:56 -0500
commit5ddaf58a46c832b2f937cebac1ec2a9368bd51e9 (patch)
treeda2dedf1bf9608ce10104efd2f5be6bb2ec2973a /Omni
parent4fb7306364b86321f7dc95d0619f4bd2e841ad94 (diff)
Restore AGENTS.md instructions to worker
Diffstat (limited to 'Omni')
-rw-r--r--Omni/Agent/Worker.hs15
1 files changed, 14 insertions, 1 deletions
diff --git a/Omni/Agent/Worker.hs b/Omni/Agent/Worker.hs
index a29feb4..7266162 100644
--- a/Omni/Agent/Worker.hs
+++ b/Omni/Agent/Worker.hs
@@ -145,6 +145,19 @@ runAmp repo task = do
let logFile = repo </> "_/llm/amp.log"
+ -- Read AGENTS.md
+ agentsMd <-
+ fmap (fromMaybe "") <| do
+ exists <- Directory.doesFileExist (repo </> "AGENTS.md")
+ if exists
+ then Just </ readFile (repo </> "AGENTS.md")
+ else pure Nothing
+
+ let fullPrompt =
+ prompt
+ <> "\n\nREPOSITORY GUIDELINES (AGENTS.md):\n"
+ <> agentsMd
+
-- Remove old log file
exists <- Directory.doesFileExist logFile
when exists (Directory.removeFile logFile)
@@ -152,7 +165,7 @@ runAmp repo task = do
Directory.createDirectoryIfMissing True (repo </> "_/llm")
-- Assume amp is in PATH
- let args = ["--log-level", "debug", "--log-file", "_/llm/amp.log", "--dangerously-allow-all", "-x", Text.unpack prompt]
+ let args = ["--log-level", "debug", "--log-file", "_/llm/amp.log", "--dangerously-allow-all", "-x", Text.unpack fullPrompt]
let cp = (Process.proc "amp" args) {Process.cwd = Just repo}
(_, _, _, ph) <- Process.createProcess cp