akseljoonas HF Staff commited on
Commit
e296da8
·
1 Parent(s): eba82cc

Only show plan_tool output in CLI, hide all other tool outputs

Browse files
Files changed (1) hide show
  1. agent/main.py +5 -7
agent/main.py CHANGED
@@ -291,11 +291,9 @@ async def event_listener(
291
  elif event.event_type == "tool_output":
292
  output = event.data.get("output", "") if event.data else ""
293
  success = event.data.get("success", False) if event.data else False
294
- # Skip research output sub-agent progress shown via tool_log,
295
- # and the main agent will summarize the findings in its response
296
- if last_tool_name[0] != "research" and output:
297
- should_truncate = last_tool_name[0] != "plan_tool"
298
- print_tool_output(output, success, truncate=should_truncate)
299
  shimmer.start()
300
  elif event.event_type == "turn_complete":
301
  shimmer.stop()
@@ -966,8 +964,8 @@ async def headless_main(prompt: str, model: str | None = None) -> None:
966
  elif event.event_type == "tool_output":
967
  output = event.data.get("output", "") if event.data else ""
968
  success = event.data.get("success", False) if event.data else False
969
- if _hl_last_tool[0] != "research" and output:
970
- print_tool_output(output, success, truncate=True)
971
  shimmer.start()
972
  elif event.event_type == "tool_log":
973
  tool = event.data.get("tool", "") if event.data else ""
 
291
  elif event.event_type == "tool_output":
292
  output = event.data.get("output", "") if event.data else ""
293
  success = event.data.get("success", False) if event.data else False
294
+ # Only show output for plan_tool everything else is noise
295
+ if last_tool_name[0] == "plan_tool" and output:
296
+ print_tool_output(output, success, truncate=False)
 
 
297
  shimmer.start()
298
  elif event.event_type == "turn_complete":
299
  shimmer.stop()
 
964
  elif event.event_type == "tool_output":
965
  output = event.data.get("output", "") if event.data else ""
966
  success = event.data.get("success", False) if event.data else False
967
+ if _hl_last_tool[0] == "plan_tool" and output:
968
+ print_tool_output(output, success, truncate=False)
969
  shimmer.start()
970
  elif event.event_type == "tool_log":
971
  tool = event.data.get("tool", "") if event.data else ""