From 8690ad0626b6a859e5311d6c955c04622ff83795 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 28 Nov 2025 03:39:48 -0500 Subject: 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 --- Omni/Agent/Worker.hs | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'Omni/Agent') diff --git a/Omni/Agent/Worker.hs b/Omni/Agent/Worker.hs index dabf45c..50ad2ae 100644 --- a/Omni/Agent/Worker.hs +++ b/Omni/Agent/Worker.hs @@ -125,13 +125,17 @@ processTask worker task = do TaskCore.logActivity tid TaskCore.Failed (Just (toMetadata [("reason", "max_retries_exceeded")])) TaskCore.updateTaskStatus tid TaskCore.Open [] else do + let currentReason = "attempt " <> tshow attempt <> ": commit_failed: " <> commitErr + let accumulatedReason = case maybeCtx of + Nothing -> currentReason + Just ctx -> TaskCore.retryReason ctx <> "\n" <> currentReason TaskCore.setRetryContext TaskCore.RetryContext { TaskCore.retryTaskId = tid, TaskCore.retryOriginalCommit = "", TaskCore.retryConflictFiles = [], TaskCore.retryAttempt = attempt, - TaskCore.retryReason = "commit_failed: " <> commitErr, + TaskCore.retryReason = accumulatedReason, TaskCore.retryNotes = maybeCtx +> TaskCore.retryNotes } TaskCore.logActivity tid TaskCore.Retrying (Just (toMetadata [("attempt", tshow attempt)])) @@ -329,19 +333,24 @@ formatCommitMessage task ampOutput = else subject <> "\n\n" <> body <> "\n\nTask-Id: " <> tid where cleanSubject s = - let stripped = Text.dropWhileEnd (`elem` ['.', ':', '!', '?', ' ']) s - truncated = if Text.length stripped > 52 then Text.take 49 stripped <> "..." else stripped - capitalized = case Text.uncons truncated of + let trailingPunct = ['.', ':', '!', '?', ',', ';', ' ', '-'] + stripped = Text.dropWhileEnd (`elem` trailingPunct) s + truncated = Text.take 72 stripped + noPunct = Text.dropWhileEnd (`elem` trailingPunct) truncated + capitalized = case Text.uncons noPunct of Just (c, rest) -> Text.cons (toUpper c) rest - Nothing -> truncated + Nothing -> noPunct in capitalized cleanBody :: Text -> Text cleanBody output = let stripped = Text.strip output - lns = Text.lines stripped - cleaned = map (Text.take 72) lns - in Text.intercalate "\n" cleaned + in if Text.null stripped + then "" + else + let lns = Text.lines stripped + cleaned = [Text.take 72 ln | ln <- lns] + in Text.intercalate "\n" cleaned monitorLog :: FilePath -> Process.ProcessHandle -> IO () monitorLog path ph = do -- cgit v1.2.3