← Back to task

Commit 45841c3f

commit 45841c3f948dabcc177d2306246020bc339709ae
Author: Ben Sima <ben@bensima.com>
Date:   Mon Dec 1 14:13:41 2025

    Show tool call arguments inline instead of JSON blob
    
    - Add formatToolCallSummary to extract key argument from JSON
    - Shows run_bash command, file paths for read/edit/write, patterns for search
    - Display summary inline in tool call header (e.g., run_bash: `ls -la`)
    - Increase token guardrail from 1M to 2M to prevent premature stops
    
    Task-Id: t-212

diff --git a/Omni/Agent/Worker.hs b/Omni/Agent/Worker.hs
index 286836a4..0ad5a564 100644
--- a/Omni/Agent/Worker.hs
+++ b/Omni/Agent/Worker.hs
@@ -316,7 +316,7 @@ runWithEngine worker repo task = do
       let guardrails =
             Engine.Guardrails
               { Engine.guardrailMaxCostCents = 200.0,
-                Engine.guardrailMaxTokens = 1000000,
+                Engine.guardrailMaxTokens = 2000000,
                 Engine.guardrailMaxDuplicateToolCalls = 20,
                 Engine.guardrailMaxTestFailures = 3
               }
diff --git a/Omni/Jr/Web.hs b/Omni/Jr/Web.hs
index aa97d96e..94b5766b 100644
--- a/Omni/Jr/Web.hs
+++ b/Omni/Jr/Web.hs
@@ -2527,11 +2527,12 @@ renderAssistantTimelineEvent content _actor timestamp now =
 renderToolCallTimelineEvent :: (Monad m) => Text -> TaskCore.CommentAuthor -> UTCTime -> UTCTime -> Lucid.HtmlT m ()
 renderToolCallTimelineEvent content _actor timestamp now =
   let (toolName, args) = parseToolCallContent content
+      summary = formatToolCallSummary toolName args
    in Lucid.details_ [Lucid.class_ "timeline-tool-call"] <| do
         Lucid.summary_ <| do
           Lucid.span_ [Lucid.class_ "event-icon"] "🔧"
           Lucid.span_ [Lucid.class_ "tool-name"] (Lucid.toHtml toolName)
-          renderActorLabel TaskCore.Junior
+          Lucid.span_ [Lucid.class_ "tool-summary"] (Lucid.toHtml summary)
           renderRelativeTimestamp now timestamp
         Lucid.div_ [Lucid.class_ "event-content tool-args"] <| do
           renderCollapsibleOutput args
@@ -2596,6 +2597,24 @@ parseToolCallContent content =
       | Text.null rest -> (content, "")
       | otherwise -> (Text.strip name, Text.strip (Text.drop 1 rest))
 
+formatToolCallSummary :: Text -> Text -> Text
+formatToolCallSummary toolName argsJson =
+  case Aeson.decode (LBS.fromStrict (str argsJson)) of
+    Just (Aeson.Object obj) ->
+      let keyArg = case toolName of
+            "run_bash" -> KeyMap.lookup "command" obj
+            "read_file" -> KeyMap.lookup "path" obj
+            "edit_file" -> KeyMap.lookup "path" obj
+            "write_file" -> KeyMap.lookup "path" obj
+            "search_codebase" -> KeyMap.lookup "pattern" obj
+            "glob_files" -> KeyMap.lookup "pattern" obj
+            "list_directory" -> KeyMap.lookup "path" obj
+            _ -> Nothing
+       in case keyArg of
+            Just (Aeson.String s) -> "`" <> Text.take 100 s <> "`"
+            _ -> Text.take 80 argsJson
+    _ -> Text.take 80 argsJson
+
 renderCollapsibleOutput :: (Monad m) => Text -> Lucid.HtmlT m ()
 renderCollapsibleOutput content =
   let lineCount = length (Text.lines content)
diff --git a/Omni/Jr/Web/Style.hs b/Omni/Jr/Web/Style.hs
index 9a0c12d8..bb74ce92 100644
--- a/Omni/Jr/Web/Style.hs
+++ b/Omni/Jr/Web/Style.hs
@@ -1488,6 +1488,11 @@ timelineEventStyles = do
   ".tool-name" ? do
     fontFamily ["SF Mono", "Monaco", "Consolas", "monospace"] [monospace]
     color "#3b82f6"
+  ".tool-summary" ? do
+    fontFamily ["SF Mono", "Monaco", "Consolas", "monospace"] [monospace]
+    fontSize (px 12)
+    color "#6b7280"
+    marginLeft (px 8)
   ".tool-args" ? do
     marginTop (px 4)
     paddingLeft (px 20)