Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
refactor: compress tool hint args handling to two lines
Re-bin89c0f4cae99a
diff --git a/nanobot/agent/loop.py b/nanobot/agent/loop.pyindex b93c47714..b605ae4a9 100644--- a/nanobot/agent/loop.py+++ b/nanobot/agent/loop.py@@ -163,10 +163,8 @@ class AgentLoop:def _tool_hint(tool_calls: list) -> str:"""Format tool calls as concise hint, e.g. 'web_search("query")'."""def _fmt(tc):- args = tc.arguments- if isinstance(args, list) and args:- args = args[0]- val = next(iter(args.values()), None) if isinstance(args, dict) and args else None+ args = (tc.arguments[0] if isinstance(tc.arguments, list) else tc.arguments) or {}+ val = next(iter(args.values()), None) if isinstance(args, dict) else Noneif not isinstance(val, str):return tc.namereturn f'{tc.name}("{val[:40]}…")' if len(val) > 40 else f'{tc.name}("{val}")'