Skip to content

[Bug] 百度AI搜索失效 #3676

@Linghumy

Description

@Linghumy

What happened / 发生了什么

在配置文件中把网络搜索提供商设置为百度AI搜索,并长时间开启AstrBot后(通常是几个小时)AI搜索回失效
重启AstrBot可短暂修复问题,但是过了几小时仍然会出现失效

Reproduce / 如何复现?

  1. 在配置文件中把网页搜索提供商设置为baidu_ai_search
  2. 使用Bot进行一次AI搜索的操作,大概率正常回复
  3. 等待数小时
  4. 再次进行AI搜索操作,问题复现

AstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器

4.5.8 手动部署 macOS 15.7 Python3.13.9
模型提供商 Google gemini (gemini-2.5-flash) 消息平台 aiocqhttp、telegram bot
4.5.8 Windows Launcher Python3.13.9 也可复现

OS

macOS

Logs / 报错日志

Image ``` [17:48:20] [Core] [INFO] [runners.tool_loop_agent_runner:247]: 使用工具:AIsearch,参数:{'query': '最近有什么新番值得看 推荐'}

[17:48:20] [Core] [WARN] [runners.tool_loop_agent_runner:388]: Traceback (most recent call last):
File "/Users/linghuservers/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 304, in _handle_function_tools
async for resp in executor: # type: ignore
File "/Users/linghuservers/AstrBot/astrbot/core/astr_agent_tool_exec.py", line 42, in execute
async for r in cls._execute_mcp(tool, run_context, **tool_args):
File "/Users/linghuservers/AstrBot/astrbot/core/astr_agent_tool_exec.py", line 180, in _execute_mcp
res = await tool.call(run_context, **tool_args)
File "/Users/linghuservers/AstrBot/astrbot/core/agent/mcp_client.py", line 252, in call
res = await session.call_tool(
File "/Users/linghuservers/AstrBot/.venv/lib/python3.10/site-packages/mcp/client/session.py", line 293, in call_tool
result = await self.send_request(
File "/Users/linghuservers/AstrBot/.venv/lib/python3.10/site-packages/mcp/shared/session.py", line 261, in send_request
await self._write_stream.send(SessionMessage(message=JSONRPCMessage(jsonrpc_request), metadata=metadata))
File "/Users/linghuservers/AstrBot/.venv/lib/python3.10/site-packages/anyio/streams/memory.py", line 243, in send
self.send_nowait(item)
File "/Users/linghuservers/AstrBot/.venv/lib/python3.10/site-packages/anyio/streams/memory.py", line 212, in send_nowait
raise ClosedResourceError
anyio.ClosedResourceError



### Are you willing to submit a PR? / 你愿意提交 PR 吗?

- [ ] Yes!

### Code of Conduct

- [x] I have read and agree to abide by the project's [Code of Conduct](https://docs.github.com/zh/site-policy/github-terms/github-community-code-of-conduct)。

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions