akseljoonas HF Staff commited on
Commit
f362c92
·
1 Parent(s): c9b20bb

Sub-agent log: tool_name → output_preview on one line

Browse files
Files changed (1) hide show
  1. agent/tools/research_tool.py +2 -4
agent/tools/research_tool.py CHANGED
@@ -290,16 +290,14 @@ async def research_handler(
290
  brief = f"fetch_hf_docs(...{url[-50:]})" if len(url) > 50 else f"fetch_hf_docs({url})"
291
  elif tool_name == "hf_inspect_dataset":
292
  brief = f"hf_inspect_dataset({tool_args.get('dataset', '')})"
293
- await _log(brief)
294
-
295
  output, _success = await session.tool_router.call_tool(
296
  tool_name, tool_args, session=session
297
  )
298
- # Log a short preview of the output
299
  preview = output.replace("\n", " ").strip()[:20]
300
  if len(output.strip()) > 20:
301
  preview += "…"
302
- await _log(f" → {preview}")
303
  # Truncate tool output for the research context
304
  if len(output) > 8000:
305
  output = (
 
290
  brief = f"fetch_hf_docs(...{url[-50:]})" if len(url) > 50 else f"fetch_hf_docs({url})"
291
  elif tool_name == "hf_inspect_dataset":
292
  brief = f"hf_inspect_dataset({tool_args.get('dataset', '')})"
 
 
293
  output, _success = await session.tool_router.call_tool(
294
  tool_name, tool_args, session=session
295
  )
296
+ # Log tool name + output preview on one line
297
  preview = output.replace("\n", " ").strip()[:20]
298
  if len(output.strip()) > 20:
299
  preview += "…"
300
+ await _log(f"{tool_name} → {preview}")
301
  # Truncate tool output for the research context
302
  if len(output) > 8000:
303
  output = (