refactor: move search_usage to utils/searchusage, remove brave stub

- Rename agent/tools/search_usage.py → utils/searchusage.py
  (not an LLM tool, matches utils/ naming convention)
- Remove redundant _fetch_brave_usage — handled by else branch
- Move test to tests/utils/test_searchusage.py

Made-with: Cursor
This commit is contained in:
Xubin Ren
2026-04-06 13:37:55 +08:00
committed by Xubin Ren
parent bc0ff7f214
commit 7ffd93f48d
3 changed files with 3 additions and 15 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ async def cmd_status(ctx: CommandContext) -> OutboundMessage:
# Fetch web search provider usage (best-effort, never blocks the response)
search_usage_text: str | None = None
try:
from nanobot.agent.tools.search_usage import fetch_search_usage
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
search_cfg = getattr(web_cfg, "search", None) if web_cfg else None