From 5ddaf58a46c832b2f937cebac1ec2a9368bd51e9 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Mon, 24 Nov 2025 12:46:56 -0500 Subject: Restore AGENTS.md instructions to worker --- Omni/Agent/Worker.hs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'Omni') 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 "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 -- cgit v1.2.3