Skip to content

[Bug]gemini循环调用工具 #8773

@Yao-lin101

Description

@Yao-lin101

What happened / 发生了什么

当使用gemini模型供应商时会出现无限循环调用工具的情况,使用openai兼容的gemini端点则完全无法使用工具

Reproduce / 如何复现?

配置一个gemini供应商,并要求bot使用工具即可复现

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

linux,dockercompose部署,AstrBot 版本v4.25.5,消息平台OneBot v1l

OS

Linux

Logs / 报错日志

[2026-06-14 11:43:37.844] [Core][INFO][respond.stage:183]: Prepare to send - 影/1614170952:

[2026-06-14 11:43:37.844] [Core][INFO][runners.tool_loop_agent_runner:983]: Agent 使用工具: ['steal_meme']

[2026-06-14 11:43:37.845] [Core][INFO][runners.tool_loop_agent_runner:1037]: 使用工具:steal_meme,参数:{}

[2026-06-14 11:43:37.851] [Plug][INFO][handlers.meme_stealer:135]: [meme_manager] 人格 甜筒爱丽丝 的表情包收集偏好: 【表情包收集偏好】

允许:

  • 像素风
  • RPG风格
    -…

[2026-06-14 11:43:37.907] [Plug][INFO][handlers.meme_stealer:239]: [meme_manager] 手动偷图被相似度检测拦截: 与 stolen_1781408477.webp 相似度 0.9977

[2026-06-14 11:43:37.909] [Core][INFO][runners.tool_loop_agent_runner:1234]: Tool steal_meme Result: 该表情包已存在相似度极高的版本(文件名:stolen_1781408477.webp,相似度:99.77%),且当前人格已拥有该表情包使用权限,拒绝重复收录。

[SYSTEM NOTICE] Important: you have executed the same tool steal_meme 18 times consecutively. Repetition is now very high. Continue only if each call is clearly producing new information. Otherwise, change strategy, adjust arguments, or explain the limitation to the user.

[2026-06-14 11:43:45.533] [Core][INFO][respond.stage:183]: Prepare to send - 影/1614170952:

[2026-06-14 11:43:45.534] [Core][INFO][runners.tool_loop_agent_runner:983]: Agent 使用工具: ['steal_meme']

[2026-06-14 11:43:45.534] [Core][INFO][runners.tool_loop_agent_runner:1037]: 使用工具:steal_meme,参数:{}

[2026-06-14 11:43:45.541] [Plug][INFO][handlers.meme_stealer:135]: [meme_manager] 人格 甜筒爱丽丝 的表情包收集偏好: 【表情包收集偏好】

允许:

  • 像素风
  • RPG风格
    -…

[2026-06-14 11:43:45.596] [Plug][INFO][handlers.meme_stealer:239]: [meme_manager] 手动偷图被相似度检测拦截: 与 stolen_1781408477.webp 相似度 0.9977

[2026-06-14 11:43:45.598] [Core][INFO][runners.tool_loop_agent_runner:1234]: Tool steal_meme Result: 该表情包已存在相似度极高的版本(文件名:stolen_1781408477.webp,相似度:99.77%),且当前人格已拥有该表情包使用权限,拒绝重复收录。

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

  • Yes!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:providerThe bug / feature is about AI Provider, Models, LLM Agent, LLM Agent Runner.bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions