mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-05-04 00:35:58 +00:00
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__.
This commit is contained in:
parent
f65f788ab1
commit
84f0571e0d
@ -65,8 +65,7 @@ async def cmd_status(ctx: CommandContext) -> OutboundMessage:
|
|||||||
search_usage_text: str | None = None
|
search_usage_text: str | None = None
|
||||||
try:
|
try:
|
||||||
from nanobot.utils.searchusage import fetch_search_usage
|
from nanobot.utils.searchusage import fetch_search_usage
|
||||||
web_cfg = getattr(getattr(loop, "config", None), "tools", None)
|
web_cfg = getattr(loop, "web_config", None)
|
||||||
web_cfg = getattr(web_cfg, "web", None) if web_cfg else None
|
|
||||||
search_cfg = getattr(web_cfg, "search", None) if web_cfg else None
|
search_cfg = getattr(web_cfg, "search", None) if web_cfg else None
|
||||||
if search_cfg is not None:
|
if search_cfg is not None:
|
||||||
provider = getattr(search_cfg, "provider", "duckduckgo")
|
provider = getattr(search_cfg, "provider", "duckduckgo")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user