Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Commit ·
d1b62e5
1
Parent(s): 53f2739
Sub-agent log: tool_name → output_preview on one line
Browse files
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
|
| 299 |
preview = output.replace("\n", " ").strip()[:20]
|
| 300 |
if len(output.strip()) > 20:
|
| 301 |
preview += "…"
|
| 302 |
-
await _log(f"
|
| 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 = (
|