summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmni Worker <bot@omni.agent>2025-11-21 22:59:58 -0500
committerOmni Worker <bot@omni.agent>2025-11-21 22:59:58 -0500
commit57635a9fbe5e217acd5ad609d7d9b97ce5cef232 (patch)
treef2285e63a80e3e7f370a99c4826230be4e9825b2
parent6f4b2c97a24967508f3970b46999052fd1f44e67 (diff)
feat(task): support updating deps in task update
Amp-Thread-ID: https://ampcode.com/threads/T-79499d9e-f4f4-40de-893c-524c32a45483 Co-authored-by: Amp <amp@ampcode.com>
-rw-r--r--.tasks/tasks.jsonl3
-rw-r--r--Omni/Task.hs21
-rw-r--r--Omni/Task/Core.hs6
3 files changed, 24 insertions, 6 deletions
diff --git a/.tasks/tasks.jsonl b/.tasks/tasks.jsonl
index d92021c..7803aba 100644
--- a/.tasks/tasks.jsonl
+++ b/.tasks/tasks.jsonl
@@ -164,9 +164,10 @@
{"taskCreatedAt":"2025-11-21T22:31:20.872934097Z","taskDependencies":[],"taskDescription":null,"taskId":"t-rWblzNdp4.3","taskNamespace":null,"taskParent":"t-rWblzNdp4","taskPriority":"P2","taskStatus":"Done","taskTitle":"Implement smart base branch selection in Worker","taskType":"WorkTask","taskUpdatedAt":"2025-11-21T22:36:36.614180518Z"}
{"taskCreatedAt":"2025-11-21T23:01:48.224051611Z","taskDependencies":[],"taskDescription":null,"taskId":"t-rWbnAjCJH","taskNamespace":null,"taskParent":null,"taskPriority":"P2","taskStatus":"Done","taskTitle":"Update start-worker.sh to use Haskell agent","taskType":"WorkTask","taskUpdatedAt":"2025-11-22T01:34:02.545292575Z"}
{"taskCreatedAt":"2025-11-22T01:34:07.407341455Z","taskDependencies":[],"taskDescription":"Omni/Bild.hs:776 has a TODO: wrapper should just be removed, instead rely on upstream nixpkgs builders to make wrappers. This simplifies the codebase by removing manual bash script generation.","taskId":"t-rWbMpcV4v","taskNamespace":"Omni/Bild.hs","taskParent":null,"taskPriority":"P2","taskStatus":"Done","taskTitle":"Remove manual wrapper generation in Omni/Bild","taskType":"WorkTask","taskUpdatedAt":"2025-11-22T03:21:49.357422745Z"}
-{"taskCreatedAt":"2025-11-22T01:34:12.233596517Z","taskDependencies":[],"taskDescription":"Implement a metrics view in the Admin dashboard (Biz/PodcastItLater/Admin.py). Show total users, active subscriptions, and recent submission counts. Ref: Biz/PodcastItLater/DESIGN.md","taskId":"t-rWbMpxaBk","taskNamespace":"Biz/PodcastItLater.hs","taskParent":null,"taskPriority":"P2","taskStatus":"InProgress","taskTitle":"Implement metrics view in Admin dashboard","taskType":"WorkTask","taskUpdatedAt":"2025-11-22T03:10:06.641517277Z"}
+{"taskCreatedAt":"2025-11-22T01:34:12.233596517Z","taskDependencies":[],"taskDescription":"Implement a metrics view in the Admin dashboard (Biz/PodcastItLater/Admin.py). Show total users, active subscriptions, and recent submission counts. Ref: Biz/PodcastItLater/DESIGN.md","taskId":"t-rWbMpxaBk","taskNamespace":"Biz/PodcastItLater.hs","taskParent":null,"taskPriority":"P2","taskStatus":"InProgress","taskTitle":"Implement metrics view in Admin dashboard","taskType":"WorkTask","taskUpdatedAt":"2025-11-22T03:54:20.066497502Z"}
{"taskCreatedAt":"2025-11-22T01:34:19.451799517Z","taskDependencies":[],"taskDescription":"Update Omni/Agent/start-worker.sh to invoke the new Haskell-based agent binary ('agent start <name>') instead of running the legacy bash loop. Ensure it still sets up the environment correctly. The agent binary handles the loop internally.","taskId":"t-rWbMq1snX","taskNamespace":"Omni/Agent.hs","taskParent":null,"taskPriority":"P2","taskStatus":"Done","taskTitle":"Update start-worker.sh to use Haskell agent","taskType":"WorkTask","taskUpdatedAt":"2025-11-22T01:57:09.161716208Z"}
{"taskCreatedAt":"2025-11-22T02:13:44.805917094Z","taskDependencies":[],"taskDescription":"Modify Omni/Agent/Git.hs to proactively clean up stale rebase/merge states before attempting operations. The worker should attempt 'git rebase --abort' (ignoring errors) before syncing to prevent 'already rebase-merge' errors.","taskId":"t-rWbP06f2O","taskNamespace":null,"taskParent":null,"taskPriority":"P2","taskStatus":"Done","taskTitle":"Make worker agent robust to stale git states","taskType":"WorkTask","taskUpdatedAt":"2025-11-22T02:14:40.413090556Z"}
{"taskCreatedAt":"2025-11-22T02:26:44.02456019Z","taskDependencies":[],"taskDescription":"Modify Omni/Agent/Git.hs to check for .git/rebase-merge or .git/rebase-apply before running git rebase --abort. This avoids blindly running abort commands.","taskId":"t-rWbPQPLps","taskNamespace":null,"taskParent":null,"taskPriority":"P2","taskStatus":"Done","taskTitle":"Detect in-progress rebase before aborting in Agent","taskType":"WorkTask","taskUpdatedAt":"2025-11-22T02:27:45.377866012Z"}
{"taskCreatedAt":"2025-11-22T03:01:36.84628158Z","taskDependencies":[],"taskDescription":"Modify Omni/Agent/Worker.hs to check if the task branch already exists before trying to create it. If it exists, simply checkout the branch. This prevents 'fatal: a branch named ... already exists' errors when restarting the worker.","taskId":"t-rWbS8t1Wv","taskNamespace":"Omni/Agent.hs","taskParent":null,"taskPriority":"P2","taskStatus":"Done","taskTitle":"Handle existing task branch in Worker Agent","taskType":"WorkTask","taskUpdatedAt":"2025-11-22T03:02:31.746506652Z"}
{"taskCreatedAt":"2025-11-22T03:09:54.022974779Z","taskDependencies":[],"taskDescription":"Implement the 2-line status UI described in Omni/Agent/DESIGN.md (Section 4.3). It should reserve 2 lines at the bottom for Meta (Task ID, Time) and Activity (current thought/action), allowing history to scroll above. Use ANSI codes for cursor management.","taskId":"t-rWbSG78jq","taskNamespace":"Omni/Agent/Log.hs","taskParent":null,"taskPriority":"P2","taskStatus":"Done","taskTitle":"Implement 2-line Agent Status UI","taskType":"WorkTask","taskUpdatedAt":"2025-11-22T03:21:54.480763142Z"}
+{"taskCreatedAt":"2025-11-22T03:58:00.9971476Z","taskDependencies":[],"taskDescription":"Update Omni/Agent/Worker.hs to spawn a background thread that tails '_/llm/amp.log' while the Amp agent is running. For each new line in the log: 1. Parse it (it's JSON). 2. Extract a user-friendly summary (e.g. 'Thinking...', 'Tool: Bash'). 3. Update the status bar activity line (AgentLog.updateActivity) with this summary. This provides real-time visibility into what the agent is doing.","taskId":"t-rWbVPuAaZ","taskNamespace":"Omni/Agent/Worker.hs","taskParent":null,"taskPriority":"P2","taskStatus":"Open","taskTitle":"Stream Amp logs to Agent status bar","taskType":"WorkTask","taskUpdatedAt":"2025-11-22T03:58:00.9971476Z"}
diff --git a/Omni/Task.hs b/Omni/Task.hs
index 36b318b..f19ab73 100644
--- a/Omni/Task.hs
+++ b/Omni/Task.hs
@@ -44,7 +44,7 @@ Usage:
task list [options]
task ready [--json]
task show <id> [--json]
- task update <id> <status> [--json]
+ task update <id> <status> [--deps=<ids>] [--dep-type=<type>] [--json]
task deps <id> [--json]
task tree [<id>] [--json]
task progress <id> [--json]
@@ -214,13 +214,30 @@ move args
| args `Cli.has` Cli.command "update" = do
tid <- getArgText args "id"
statusStr <- getArgText args "status"
+
+ -- Handle update dependencies
+ (deps, depType) <- do
+ -- Parse --deps and --dep-type
+ ids <- case Cli.getArg args (Cli.longOption "deps") of
+ Nothing -> pure []
+ Just depStr -> pure <| T.splitOn "," (T.pack depStr)
+ dtype <- case Cli.getArg args (Cli.longOption "dep-type") of
+ Nothing -> pure Blocks
+ Just "blocks" -> pure Blocks
+ Just "discovered-from" -> pure DiscoveredFrom
+ Just "parent-child" -> pure ParentChild
+ Just "related" -> pure Related
+ Just other -> panic <| "Invalid dependency type: " <> T.pack other <> ". Use: blocks, discovered-from, parent-child, or related"
+ pure (map (\d -> Dependency {depId = d, depType = dtype}) ids, dtype)
+
let newStatus = case statusStr of
"open" -> Open
"in-progress" -> InProgress
"review" -> Review
"done" -> Done
_ -> panic "Invalid status. Use: open, in-progress, review, or done"
- updateTaskStatus tid newStatus
+
+ updateTaskStatus tid newStatus deps
if isJsonMode args
then outputSuccess <| "Updated task " <> tid
else do
diff --git a/Omni/Task/Core.hs b/Omni/Task/Core.hs
index bab1912..9e4d2b4 100644
--- a/Omni/Task/Core.hs
+++ b/Omni/Task/Core.hs
@@ -343,15 +343,15 @@ createTask title taskType parent namespace priority deps description =
pure task
-- Update task status
-updateTaskStatus :: Text -> Status -> IO ()
-updateTaskStatus tid newStatus =
+updateTaskStatus :: Text -> Status -> [Dependency] -> IO ()
+updateTaskStatus tid newStatus newDeps =
withTaskWriteLock <| do
tasks <- loadTasksInternal
now <- getCurrentTime
let updatedTasks = map updateIfMatch tasks
updateIfMatch t =
if matchesId (taskId t) tid
- then t {taskStatus = newStatus, taskUpdatedAt = now}
+ then t {taskStatus = newStatus, taskUpdatedAt = now, taskDependencies = if null newDeps then taskDependencies t else newDeps}
else t
-- Rewrite the entire file (simple approach for MVP)
tasksFile <- getTasksFilePath