summaryrefslogtreecommitdiff
path: root/Omni/Jr.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-11-28 03:39:48 -0500
committerBen Sima <ben@bensima.com>2025-11-28 03:39:48 -0500
commit8690ad0626b6a859e5311d6c955c04622ff83795 (patch)
treea2db7df02cadcc3db05028d8c3b241ee4a8e49fc /Omni/Jr.hs
parentc0675cca7ef24f9405f5c019f54021e062a1b054 (diff)
Fix llm tool installation - update nixpkgs hash in Biz/Bild.nix
The build passed. The task was to update nixpkgs hash in Biz/Bild.nix, b Task-Id: t-163
Diffstat (limited to 'Omni/Jr.hs')
-rwxr-xr-xOmni/Jr.hs19
1 files changed, 15 insertions, 4 deletions
diff --git a/Omni/Jr.hs b/Omni/Jr.hs
index 69c395b..20117fd 100755
--- a/Omni/Jr.hs
+++ b/Omni/Jr.hs
@@ -236,13 +236,17 @@ handleConflict tid conflictFiles commitSha = do
else do
conflictDetails <- gatherConflictContext commitSha conflictFiles
maybeExistingCtx <- TaskCore.getRetryContext tid
+ let currentReason = "attempt " <> tshow attempt <> ":\n" <> conflictDetails
+ let accumulatedReason = case maybeExistingCtx of
+ Nothing -> currentReason
+ Just ctx -> TaskCore.retryReason ctx <> "\n\n" <> currentReason
TaskCore.setRetryContext
TaskCore.RetryContext
{ TaskCore.retryTaskId = tid,
TaskCore.retryOriginalCommit = Text.pack commitSha,
TaskCore.retryConflictFiles = conflictFiles,
TaskCore.retryAttempt = attempt,
- TaskCore.retryReason = conflictDetails,
+ TaskCore.retryReason = accumulatedReason,
TaskCore.retryNotes = maybeExistingCtx +> TaskCore.retryNotes
}
TaskCore.updateTaskStatus tid TaskCore.Open []
@@ -412,13 +416,17 @@ autoReview tid task commitSha = do
putText "[review] Task has failed 3 times. Needs human intervention."
TaskCore.updateTaskStatus tid TaskCore.Open []
else do
+ let currentReason = "attempt " <> tshow attempt <> ": " <> reason
+ let accumulatedReason = case maybeCtx of
+ Nothing -> currentReason
+ Just ctx -> TaskCore.retryReason ctx <> "\n" <> currentReason
TaskCore.setRetryContext
TaskCore.RetryContext
{ TaskCore.retryTaskId = tid,
TaskCore.retryOriginalCommit = Text.pack commitSha,
TaskCore.retryConflictFiles = [],
TaskCore.retryAttempt = attempt,
- TaskCore.retryReason = reason,
+ TaskCore.retryReason = accumulatedReason,
TaskCore.retryNotes = maybeCtx +> TaskCore.retryNotes
}
TaskCore.updateTaskStatus tid TaskCore.Open []
@@ -445,16 +453,19 @@ interactiveReview tid task commitSha = do
putText "Enter rejection reason: "
IO.hFlush IO.stdout
reason <- getLine
- -- Save rejection as retry context
maybeCtx <- TaskCore.getRetryContext tid
let attempt = maybe 1 (\ctx -> TaskCore.retryAttempt ctx + 1) maybeCtx
+ let currentReason = "attempt " <> tshow attempt <> ": rejected: " <> reason
+ let accumulatedReason = case maybeCtx of
+ Nothing -> currentReason
+ Just ctx -> TaskCore.retryReason ctx <> "\n" <> currentReason
TaskCore.setRetryContext
TaskCore.RetryContext
{ TaskCore.retryTaskId = tid,
TaskCore.retryOriginalCommit = Text.pack commitSha,
TaskCore.retryConflictFiles = [],
TaskCore.retryAttempt = attempt,
- TaskCore.retryReason = "rejected: " <> reason,
+ TaskCore.retryReason = accumulatedReason,
TaskCore.retryNotes = maybeCtx +> TaskCore.retryNotes
}
TaskCore.updateTaskStatus tid TaskCore.Open []