From 84f0571e0d1773947d06b3f1bfd06da8ecc80efb Mon Sep 17 00:00:00 2001 From: yanghan-cyber Date: Mon, 6 Apr 2026 18:47:38 +0800 Subject: [PATCH] fix(status): use correct AgentLoop attribute for web search config The /status command tried to access web search config via `loop.config.tools.web.search`, but AgentLoop has no `config` attribute. This caused the search usage lookup to silently return None, so web search provider usage was never displayed. Fix: use `loop.web_config.search` which is the actual attribute set during AgentLoop.__init__. --- nanobot/command/builtin.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nanobot/command/builtin.py b/nanobot/command/builtin.py index 8ead6a131..94e46320b 100644 --- a/nanobot/command/builtin.py +++ b/nanobot/command/builtin.py @@ -65,8 +65,7 @@ async def cmd_status(ctx: CommandContext) -> OutboundMessage: search_usage_text: str | None = None try: from nanobot.utils.searchusage import fetch_search_usage - web_cfg = getattr(getattr(loop, "config", None), "tools", None) - web_cfg = getattr(web_cfg, "web", None) if web_cfg else None + web_cfg = getattr(loop, "web_config", None) search_cfg = getattr(web_cfg, "search", None) if web_cfg else None if search_cfg is not None: provider = getattr(search_cfg, "provider", "duckduckgo")