diff options
| author | Ben Sima <ben@bensima.com> | 2025-12-01 12:34:34 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bensima.com> | 2025-12-01 12:34:34 -0500 |
| commit | 726f71e6c2b697d198eb35f2ba9e3f19ee7b2482 (patch) | |
| tree | 0c1671d9e4b44de6d0502bcbc6aef59268ba89a2 /Omni/Jr.hs | |
| parent | a16de8c9884f7eab639d1e5b016c9d6846866e03 (diff) | |
Add actor tracking for status changes and use unified timeline
- updateTaskStatusWithActor logs status_change events to agent_events
- Worker uses Junior actor for status changes - Jr review uses
System/Human actors appropriately - CLI task update uses Human actor
- Remove task_activity table schema (migrated to agent_events) -
addComment now inserts into agent_events with event_type='comment'
Task-Id: t-213
Diffstat (limited to 'Omni/Jr.hs')
| -rwxr-xr-x | Omni/Jr.hs | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -209,7 +209,7 @@ runLoop delaySec = do then do putText "[review] No commit found for this task." putText "[review] Resetting to Open for retry." - TaskCore.updateTaskStatus tid TaskCore.Open [] + TaskCore.updateTaskStatusWithActor tid TaskCore.Open [] TaskCore.System else do let commitSha = case List.lines shaOut of (x : _) -> x @@ -237,7 +237,7 @@ handleConflict tid conflictFiles commitSha = do if attempt > 3 then do putText "[review] Task has failed 3 times. Needs human intervention." - TaskCore.updateTaskStatus tid TaskCore.Open [] + TaskCore.updateTaskStatusWithActor tid TaskCore.Open [] TaskCore.System else do conflictDetails <- gatherConflictContext commitSha conflictFiles maybeExistingCtx <- TaskCore.getRetryContext tid @@ -254,7 +254,7 @@ handleConflict tid conflictFiles commitSha = do TaskCore.retryReason = accumulatedReason, TaskCore.retryNotes = maybeExistingCtx +> TaskCore.retryNotes } - TaskCore.updateTaskStatus tid TaskCore.Open [] + TaskCore.updateTaskStatusWithActor tid TaskCore.Open [] TaskCore.System putText ("[review] Task " <> tid <> " returned to queue (attempt " <> tshow attempt <> "/3).") -- | Build a review comment for merge conflicts @@ -421,7 +421,7 @@ autoReview tid task commitSha = do let reviewComment = buildReviewComment commitSha testTarget True testOut testErr _ <- TaskCore.addComment tid reviewComment TaskCore.Junior TaskCore.clearRetryContext tid - TaskCore.updateTaskStatus tid TaskCore.Done [] + TaskCore.updateTaskStatusWithActor tid TaskCore.Done [] TaskCore.System putText ("[review] Task " <> tid <> " -> Done") addCompletionSummary tid commitSha extractFacts tid commitSha @@ -439,7 +439,7 @@ autoReview tid task commitSha = do if attempt > 3 then do putText "[review] Task has failed 3 times. Needs human intervention." - TaskCore.updateTaskStatus tid TaskCore.Open [] + TaskCore.updateTaskStatusWithActor tid TaskCore.Open [] TaskCore.System else do let currentReason = "attempt " <> tshow attempt <> ": " <> reason let accumulatedReason = case maybeCtx of @@ -454,7 +454,7 @@ autoReview tid task commitSha = do TaskCore.retryReason = accumulatedReason, TaskCore.retryNotes = maybeCtx +> TaskCore.retryNotes } - TaskCore.updateTaskStatus tid TaskCore.Open [] + TaskCore.updateTaskStatusWithActor tid TaskCore.Open [] TaskCore.System putText ("[review] Task " <> tid <> " reopened (attempt " <> tshow attempt <> "/3).") -- | Build a review comment summarizing what was tested and the result @@ -502,7 +502,7 @@ interactiveReview tid task commitSha = do let acceptComment = buildHumanReviewComment commitSha True Nothing _ <- TaskCore.addComment tid acceptComment TaskCore.Human TaskCore.clearRetryContext tid - TaskCore.updateTaskStatus tid TaskCore.Done [] + TaskCore.updateTaskStatusWithActor tid TaskCore.Done [] TaskCore.Human putText ("Task " <> tid <> " marked as Done.") addCompletionSummary tid commitSha extractFacts tid commitSha @@ -528,7 +528,7 @@ interactiveReview tid task commitSha = do TaskCore.retryReason = accumulatedReason, TaskCore.retryNotes = maybeCtx +> TaskCore.retryNotes } - TaskCore.updateTaskStatus tid TaskCore.Open [] + TaskCore.updateTaskStatusWithActor tid TaskCore.Open [] TaskCore.Human putText ("Task " <> tid <> " reopened (attempt " <> tshow attempt <> "/3).") | otherwise -> putText "Skipped; no status change." @@ -850,7 +850,7 @@ checkEpicCompletion task = allDone = all (\t -> TaskCore.taskStatus t == TaskCore.Done) children when (allDone && not (null children)) <| do putText ("[review] All children of epic " <> parentId <> " are Done.") - TaskCore.updateTaskStatus parentId TaskCore.Review [] + TaskCore.updateTaskStatusWithActor parentId TaskCore.Review [] TaskCore.System putText ("[review] Epic " <> parentId <> " -> Review") -- Generate summary comment for the epic generateEpicSummary parentId parentTask children |
