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
fix(cli): keep direct-call rendering compatible in tests
Xubin Rena8176ef2c6a0
diff --git a/nanobot/cli/commands.py b/nanobot/cli/commands.pyindex 5604bab08..28d33a7f4 100644--- a/nanobot/cli/commands.py+++ b/nanobot/cli/commands.py@@ -2,6 +2,7 @@import asynciofrom contextlib import contextmanager, nullcontext+import inspectimport osimport selectimport signal@@ -767,17 +768,27 @@ def agent(nonlocal _thinking_thinking = _ThinkingSpinner(enabled=not logs)with _thinking:- response = await agent_loop.process_direct_outbound(- message,- session_id,- on_progress=_cli_progress,- )+ direct_outbound = getattr(agent_loop, "process_direct_outbound", None)+ if inspect.iscoroutinefunction(direct_outbound):+ response = await agent_loop.process_direct_outbound(+ message,+ session_id,+ on_progress=_cli_progress,+ )+ response_content = response.content if response else ""+ response_meta = response.metadata if response else None+ else:+ response_content = await agent_loop.process_direct(+ message,+ session_id,+ on_progress=_cli_progress,+ )+ response_meta = None_thinking = None- _print_agent_response(- response.content if response else "",- render_markdown=markdown,- metadata=response.metadata if response else None,- )+ kwargs = {"render_markdown": markdown}+ if response_meta is not None:+ kwargs["metadata"] = response_meta+ _print_agent_response(response_content, **kwargs)await agent_loop.close_mcp()asyncio.run(run_once())