AstrBot icon indicating copy to clipboard operation
AstrBot copied to clipboard

[Bug] 工具调用前发送 *No response*

Open yuanshanhua opened this issue 7 months ago • 3 comments

What happened / 发生了什么

在每次进行工具调用前, 机器人会发送内容为 *No response* 的无意义文本

Reproduce / 如何复现?

Image

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

v4.23.6 deepseek-v4-flash 官方 API

OS

Linux

Logs / 报错日志

[2026-04-29 23:35:46.519] [Core] [INFO] [core.event_bus:61]: [default] [napcat_chaijun(aiocqhttp)] user/<qq>: [At: 群号] 用户信息 
[2026-04-29 23:35:54.074] [Core] [INFO] [respond.stage:183]: Prepare to send - user/<qq>: *No response* 
[2026-04-29 23:35:54.569] [Core] [INFO] [runners.tool_loop_agent_runner:975]: Agent 使用工具: ['search_memes_by_keyword']
[2026-04-29 23:35:54.571] [Core] [INFO] [runners.tool_loop_agent_runner:1025]: 使用工具:search_memes_by_keyword,参数:{'keyword': 'kkk', 'count': 20}
[2026-04-29 23:36:03.945] [Core] [INFO] [runners.tool_loop_agent_runner:1222]: Tool `search_memes_by_keyword` Result: [{"id":"192","content":"...}]
[2026-04-29 23:36:06.350] [Core] [INFO] [respond.stage:183]: Prepare to send - user/<qq>: *No response* 
[2026-04-29 23:36:06.822] [Core] [INFO] [runners.tool_loop_agent_runner:975]: Agent 使用工具: ['get_hot_memes_24h']
[2026-04-29 23:36:06.824] [Core] [INFO] [runners.tool_loop_agent_runner:1025]: 使用工具:get_hot_memes_24h,参数:{}
[2026-04-29 23:36:07.007] [Core] [INFO] [runners.tool_loop_agent_runner:1222]: Tool `get_hot_memes_24h` Result: [{"id":"19458","content":..."}]
[2026-04-29 23:36:17.523] [Core] [INFO] [respond.stage:183]: Prepare to send - user/<qq>: 🤔 思考: The user asked for the ...

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

  • [ ] Yes!

Code of Conduct

yuanshanhua avatar Apr 29 '26 16:04 yuanshanhua

补充: 结合 ai 分析, 问题很可能出在工具调用的 prompt 上 https://github.com/AstrBotDevs/AstrBot/blob/7c185f8e40ae1b2e974f7ce5cffce6b0fc47da7b/astrbot/core/astr_main_agent_resources.py#L25-L35 这里要求 ai 必须返回一点东西, 我不知道为什么要这样写, agent 连续调用很多次工具而不产生回复是很正常的行为

yuanshanhua avatar Apr 29 '26 16:04 yuanshanhua

换新的对话也会有同样的问题吗?这个看起来更像是上下文污染或者模型注意力的问题

daniel5u avatar Apr 30 '26 02:04 daniel5u

看起来是旧版本的上下文污染了

yuanshanhua avatar Apr 30 '26 02:04 yuanshanhua