summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmni Worker <bot@omni.agent>2025-11-22 07:47:37 -0500
committerOmni Worker <bot@omni.agent>2025-11-22 07:47:37 -0500
commitafcb454efe9be5843a454319042e792adafd210f (patch)
treeeba105eb8bc7b915437aaf9957b9edd682887cff
parent0211cb43909af1704888bc142ec93bbbbff944a0 (diff)
feat: capture amp summary and forbid commit
Amp-Thread-ID: https://ampcode.com/threads/T-ec034efc-0ef1-43df-8abe-b0cda0f9115b Co-authored-by: Amp <amp@ampcode.com>
-rw-r--r--.tasks/tasks.jsonl2
-rw-r--r--Omni/Agent/Worker.hs18
2 files changed, 12 insertions, 8 deletions
diff --git a/.tasks/tasks.jsonl b/.tasks/tasks.jsonl
index 0893887..ce33d6d 100644
--- a/.tasks/tasks.jsonl
+++ b/.tasks/tasks.jsonl
@@ -191,3 +191,5 @@
{"taskCreatedAt":"2025-11-22T11:45:49.548163416Z","taskDependencies":[],"taskDescription":"Omni/Agent/LogTest.hs is currently unused by the main 'bild --test Omni/Agent.hs' command. Review its contents, move any valuable tests to Omni/Agent.hs (or Omni/Agent/Log.hs's test section), and delete the file.","taskId":"t-rWcqsDZFM.1","taskNamespace":"Omni/Agent.hs","taskParent":"t-rWcqsDZFM","taskPriority":"P2","taskStatus":"Open","taskTitle":"Consolidate LogTest.hs into main test suite","taskType":"WorkTask","taskUpdatedAt":"2025-11-22T11:45:49.548163416Z"}
{"taskCreatedAt":"2025-11-22T11:45:57.926946967Z","taskDependencies":[],"taskDescription":"Remove bash scripts that have been superseded by the Haskell agent implementation. Candidates for removal: harvest-tasks.sh, merge-tasks.sh, sync-tasks.sh, setup-worker.sh. Ensure functionality is covered by Haskell code before deletion.","taskId":"t-rWcqsDZFM.2","taskNamespace":"Omni/Agent.hs","taskParent":"t-rWcqsDZFM","taskPriority":"P2","taskStatus":"Open","taskTitle":"Remove legacy bash prototype scripts","taskType":"WorkTask","taskUpdatedAt":"2025-11-22T11:45:57.926946967Z"}
{"taskCreatedAt":"2025-11-22T11:46:03.875940421Z","taskDependencies":[],"taskDescription":"We have both 'monitor.sh' and 'monitor-worker.sh'. Consolidate them into a single 'monitor.sh' script and remove the duplicate.","taskId":"t-rWcqsDZFM.3","taskNamespace":"Omni/Agent.hs","taskParent":"t-rWcqsDZFM","taskPriority":"P2","taskStatus":"Open","taskTitle":"Consolidate monitor scripts","taskType":"WorkTask","taskUpdatedAt":"2025-11-22T11:46:03.875940421Z"}
+{"taskCreatedAt":"2025-11-22T12:42:35.9228659Z","taskDependencies":[],"taskDescription":null,"taskId":"t-1o2bk9tzanj","taskNamespace":"Omni/Agent.hs","taskParent":null,"taskPriority":"P2","taskStatus":"InProgress","taskTitle":"Capture Amp summary for commit message","taskType":"WorkTask","taskUpdatedAt":"2025-11-22T12:42:49.963823385Z"}
+{"taskCreatedAt":"2025-11-22T12:42:39.927855226Z","taskDependencies":[],"taskDescription":null,"taskId":"t-1o2bk9wd4x9","taskNamespace":"Omni/Agent.hs","taskParent":null,"taskPriority":"P2","taskStatus":"InProgress","taskTitle":"Update Amp prompt to forbid git commits","taskType":"WorkTask","taskUpdatedAt":"2025-11-22T12:47:15.182640345Z"}
diff --git a/Omni/Agent/Worker.hs b/Omni/Agent/Worker.hs
index a861173..94a4e35 100644
--- a/Omni/Agent/Worker.hs
+++ b/Omni/Agent/Worker.hs
@@ -93,7 +93,7 @@ processTask worker task = do
-- Run Amp
AgentLog.updateActivity "Running Amp agent..."
- exitCode <- runAmp repo task
+ (exitCode, output) <- runAmp repo task
case exitCode of
Exit.ExitSuccess -> do
@@ -103,8 +103,10 @@ processTask worker task = do
TaskCore.updateTaskStatus tid TaskCore.Review []
-- Commit changes
- -- We should check if there are changes, but 'git add .' is safe.
- Git.commit repo ("feat: implement " <> tid)
+ -- We use the agent's output as the extended commit description
+ let summary = Text.strip output
+ let commitMsg = "feat: implement " <> tid <> "\n\n" <> summary
+ Git.commit repo commitMsg
-- Submit for review
AgentLog.updateActivity "Submitting for review..."
@@ -127,7 +129,7 @@ processTask worker task = do
AgentLog.updateActivity "Agent failed, retrying..."
threadDelay (10 * 1000000) -- Sleep 10s
-runAmp :: FilePath -> TaskCore.Task -> IO Exit.ExitCode
+runAmp :: FilePath -> TaskCore.Task -> IO (Exit.ExitCode, Text)
runAmp repo task = do
let prompt =
"You are a Worker Agent.\n"
@@ -139,7 +141,8 @@ runAmp repo task = do
<> "3. Run tests to verify your work (e.g., 'bild --test Omni/Namespace').\n"
<> "4. Fix any errors found during testing.\n"
<> "5. Do NOT update the task status or manage git branches (the system handles that).\n"
- <> "6. When finished and tested, exit.\n\n"
+ <> "6. Do NOT run 'git commit'. The system will commit your changes automatically.\n"
+ <> "7. When finished and tested, exit.\n\n"
<> "Context:\n"
<> "- You are working in '"
<> Text.pack repo
@@ -176,14 +179,13 @@ runAmp repo task = do
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
- exitCode <- Process.waitForProcess ph
+ (exitCode, out, _err) <- Process.readCreateProcessWithExitCode cp ""
-- Cleanup
killThread tidTime
killThread tidLog
- pure exitCode
+ pure (exitCode, Text.pack out)
formatTask :: TaskCore.Task -> Text
formatTask t =