diff options
| author | Ben Sima <ben@bensima.com> | 2025-11-24 12:46:56 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bensima.com> | 2025-11-24 12:46:56 -0500 |
| commit | 5ddaf58a46c832b2f937cebac1ec2a9368bd51e9 (patch) | |
| tree | da2dedf1bf9608ce10104efd2f5be6bb2ec2973a /Omni/Agent | |
| parent | 4fb7306364b86321f7dc95d0619f4bd2e841ad94 (diff) | |
Restore AGENTS.md instructions to worker
Diffstat (limited to 'Omni/Agent')
| -rw-r--r-- | Omni/Agent/Worker.hs | 15 |
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 |
