akseljoonas HF Staff commited on
Commit
9f009a3
·
1 Parent(s): 267a941

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
@@ -279,11 +279,9 @@ async def event_listener(
279
  elif event.event_type == "tool_output":
280
  output = event.data.get("output", "") if event.data else ""
281
  success = event.data.get("success", False) if event.data else False
282
- # Skip research output sub-agent progress shown via tool_log,
283
- # and the main agent will summarize the findings in its response
284
- if last_tool_name[0] != "research" and output:
285
- should_truncate = last_tool_name[0] != "plan_tool"
286
- print_tool_output(output, success, truncate=should_truncate)
287
  shimmer.start()
288
  elif event.event_type == "turn_complete":
289
  shimmer.stop()
@@ -954,8 +952,8 @@ async def headless_main(prompt: str, model: str | None = None) -> None:
954
  elif event.event_type == "tool_output":
955
  output = event.data.get("output", "") if event.data else ""
956
  success = event.data.get("success", False) if event.data else False
957
- if _hl_last_tool[0] != "research" and output:
958
- print_tool_output(output, success, truncate=True)
959
  shimmer.start()
960
  elif event.event_type == "tool_log":
961
  tool = event.data.get("tool", "") if event.data else ""
 
279
  elif event.event_type == "tool_output":
280
  output = event.data.get("output", "") if event.data else ""
281
  success = event.data.get("success", False) if event.data else False
282
+ # Only show output for plan_tool everything else is noise
283
+ if last_tool_name[0] == "plan_tool" and output:
284
+ print_tool_output(output, success, truncate=False)
 
 
285
  shimmer.start()
286
  elif event.event_type == "turn_complete":
287
  shimmer.stop()
 
952
  elif event.event_type == "tool_output":
953
  output = event.data.get("output", "") if event.data else ""
954
  success = event.data.get("success", False) if event.data else False
955
+ if _hl_last_tool[0] == "plan_tool" and output:
956
+ print_tool_output(output, success, truncate=False)
957
  shimmer.start()
958
  elif event.event_type == "tool_log":
959
  tool = event.data.get("tool", "") if event.data else ""