From e5c8ff37436171966136e06d75e39dbdea80d4eb Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Mon, 24 Nov 2025 21:13:28 -0500 Subject: agent: restore git commit with amp output Re-enables git commits in the worker, using the captured output from 'amp' as the commit message. Also updates 'Omni/Agent.hs' to handle the API change in TaskCore.exportTasks (commenting out harvest logic for now as it depended on git-tracked tasks). Amp-Thread-ID: https://ampcode.com/threads/T-ac41b9b6-d117-46de-9e4f-842887a22f1d Co-authored-by: Amp --- Omni/Agent.hs | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'Omni/Agent.hs') diff --git a/Omni/Agent.hs b/Omni/Agent.hs index b7381b8..15ff77d 100644 --- a/Omni/Agent.hs +++ b/Omni/Agent.hs @@ -4,6 +4,7 @@ {-# LANGUAGE NoImplicitPrelude #-} -- : out agent +-- : dep sqlite-simple -- : dep temporary module Omni.Agent where @@ -100,11 +101,29 @@ harvest args = do when updated <| do -- Consolidate Directory.setCurrentDirectory path - TaskCore.exportTasks + -- Export to temporary file then commit? No, harvest implies we are merging back to source of truth. + -- But wait, tasks are now in SQLite. + -- If we are harvesting from branches, we are importing from JSONL in branches into our DB. + -- Then we probably want to export back to JSONL for git tracking? + -- The user said: "Remove git-tracked tasks.jsonl". + -- So harvest might need rethinking or just be disabled for now. + -- But strictly answering the compilation error: exportTasks takes an argument now. + -- Since we removed tasks.jsonl, maybe we shouldn't be exporting here at all if the goal is to just update the DB? + -- However, if harvest is about syncing multiple workers, it assumes a shared git repo. + -- If we removed git tracking of tasks, harvest via git branches makes less sense unless we still use JSONL for interchange. + -- For now, let's pass Nothing to exportTasks (stdout) which is probably not what we want, OR + -- if we want to save to DB, we don't need to call exportTasks because importTasks already updates the DB. + -- Let's remove the exportTasks call here as it seems redundant or incorrect given we removed the file. + -- But wait, if 'harvest' commits "task: harvest updates...", what is it committing? + -- The SQLite DB is likely .gitignore'd. + -- So harvest effectively does nothing useful for git if tasks are not in git. + -- I will comment out the commit and export for now to fix the build, assuming 'harvest' is legacy/deprecated with the removal of git-tracked tasks. + + -- TaskCore.exportTasks Nothing -- Commit if changed - Git.commit path "task: harvest updates from workers" - putText "Success: Task database updated and committed." + -- Git.commit path "task: harvest updates from workers" + putText "Success: Task database updated." processBranch :: FilePath -> Bool -> Text -> IO Bool processBranch repo updated branch = do -- cgit v1.2.3