From 6731230d7340b5ae093454f0dbf06ff7b86e32b3 Mon Sep 17 00:00:00 2001 From: teknium1 Date: Tue, 17 Feb 2026 03:18:27 -0800 Subject: [PATCH] Add special handling for 'process' tool in _build_tool_preview function - Enhanced the _build_tool_preview function to include specific formatting for the 'process' tool, displaying action, session_id, data, and timeout when applicable. - This update improves the clarity of tool previews, particularly for actions that require session tracking and timeout management. --- run_agent.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/run_agent.py b/run_agent.py index 17d28565..344edca4 100644 --- a/run_agent.py +++ b/run_agent.py @@ -850,6 +850,21 @@ def _build_tool_preview(tool_name: str, args: dict, max_len: int = 40) -> str: "schedule_cronjob": "name", } + # Special handling for the process tool -- show action + session_id + if tool_name == "process": + action = args.get("action", "") + session_id = args.get("session_id", "") + data = args.get("data", "") + timeout = args.get("timeout") + parts = [action] + if session_id: + parts.append(session_id[:16]) + if data: + parts.append(f'"{data[:20]}"') + if timeout and action == "wait": + parts.append(f"{timeout}s") + return " ".join(parts) if parts else None + key = primary_args.get(tool_name) if not key: # Try common arg names as fallback