diff options
| author | Omni Worker <bot@omni.agent> | 2025-11-22 06:36:53 -0500 |
|---|---|---|
| committer | Omni Worker <bot@omni.agent> | 2025-11-22 06:36:53 -0500 |
| commit | 7107e038ec661e5e121e226250f85771b0fd5ff4 (patch) | |
| tree | cca72309e80d04da484380e2436a7536a30aad21 /Omni | |
| parent | 63003a01dd9c17bf354f8468746aac6c7b7725cd (diff) | |
feat: include AGENTS.md in worker prompt
Diffstat (limited to 'Omni')
| -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 3504765..a861173 100644 --- a/Omni/Agent/Worker.hs +++ b/Omni/Agent/Worker.hs @@ -151,6 +151,19 @@ runAmp repo task = do Directory.createDirectoryIfMissing True (repo </> "_/llm") 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 + -- Clean up previous log exists <- Directory.doesFileExist logFile when exists (Directory.removeFile logFile) @@ -160,7 +173,7 @@ runAmp repo task = do tidLog <- forkIO (monitorLog logFile) -- 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 |
