From 4919cf825d4fdbcecc1f69fcf2a32176dfdde5ac Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Mon, 1 Dec 2025 07:40:49 -0500 Subject: Add author field to task comments (Human vs Junior) Comments now track whether they were made by a Human or by Junior (the agent). The CommentAuthor type is stored in the database and displayed in the web UI with styled badges. Task-Id: t-201 --- Omni/Jr.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Omni/Jr.hs') diff --git a/Omni/Jr.hs b/Omni/Jr.hs index a5bc48b..dc6ded0 100755 --- a/Omni/Jr.hs +++ b/Omni/Jr.hs @@ -232,7 +232,7 @@ handleConflict tid conflictFiles commitSha = do let attempt = maybe 1 (\c -> TaskCore.retryAttempt c + 1) maybeCtx let conflictComment = buildConflictComment commitSha conflictFiles attempt - _ <- TaskCore.addComment tid conflictComment + _ <- TaskCore.addComment tid conflictComment TaskCore.Junior if attempt > 3 then do @@ -419,7 +419,7 @@ autoReview tid task commitSha = do Exit.ExitSuccess -> do putText "[review] ✓ Tests passed." let reviewComment = buildReviewComment commitSha testTarget True testOut testErr - _ <- TaskCore.addComment tid reviewComment + _ <- TaskCore.addComment tid reviewComment TaskCore.Junior TaskCore.clearRetryContext tid TaskCore.updateTaskStatus tid TaskCore.Done [] putText ("[review] Task " <> tid <> " -> Done") @@ -434,7 +434,7 @@ autoReview tid task commitSha = do let attempt = maybe 1 (\ctx -> TaskCore.retryAttempt ctx + 1) maybeCtx let reviewComment = buildReviewComment commitSha testTarget False testOut testErr - _ <- TaskCore.addComment tid reviewComment + _ <- TaskCore.addComment tid reviewComment TaskCore.Junior if attempt > 3 then do @@ -500,7 +500,7 @@ interactiveReview tid task commitSha = do c | "a" `Text.isPrefixOf` c -> do let acceptComment = buildHumanReviewComment commitSha True Nothing - _ <- TaskCore.addComment tid acceptComment + _ <- TaskCore.addComment tid acceptComment TaskCore.Human TaskCore.clearRetryContext tid TaskCore.updateTaskStatus tid TaskCore.Done [] putText ("Task " <> tid <> " marked as Done.") @@ -512,7 +512,7 @@ interactiveReview tid task commitSha = do IO.hFlush IO.stdout reason <- getLine let rejectComment = buildHumanReviewComment commitSha False (Just reason) - _ <- TaskCore.addComment tid rejectComment + _ <- TaskCore.addComment tid rejectComment TaskCore.Human maybeCtx <- TaskCore.getRetryContext tid let attempt = maybe 1 (\ctx -> TaskCore.retryAttempt ctx + 1) maybeCtx let currentReason = "attempt " <> tshow attempt <> ": rejected: " <> reason @@ -620,7 +620,7 @@ addCompletionSummary tid commitSha = do Right msg -> do let summary = Text.strip (Engine.msgContent msg) unless (Text.null summary) <| do - _ <- TaskCore.addComment tid ("## Completion Summary\n\n" <> summary) + _ <- TaskCore.addComment tid ("## Completion Summary\n\n" <> summary) TaskCore.Junior putText "[review] Added completion summary comment" -- | Build prompt for LLM to generate completion summary @@ -753,7 +753,7 @@ generateEpicSummary epicId epic children = do putText ("[epic] Failed to generate summary: " <> err) Right msg -> do let summary = Engine.msgContent msg - _ <- TaskCore.addComment epicId summary + _ <- TaskCore.addComment epicId summary TaskCore.Junior putText "[epic] Summary comment added to epic" -- | Build a prompt for the LLM to summarize an epic -- cgit v1.2.3