[2026-07-12 14:16:53.537] [Core] [DBUG] [aiocqhttp.aiocqhttp_platform_adapter:129]: [aiocqhttp] RawMessage <Event, {'self_id': 2********2, 'user_id': 3********6, 'time': 1783837013, 'message_id': 32689838, 'message_seq': 32689838, 'real_id': 32689838, 'real_seq': '11232', 'message_type': 'private', 'sender': {'user_id': 3********6, 'nickname': '白隐Hakuin', 'card': ''}, 'raw_message': '好热啊阿莱——', 'font': 14, 'sub_type': 'friend', 'message': [{'type': 'text', 'data': {'text': '好热啊阿莱——'}}], 'message_format': 'array', 'post_type': 'message', 'target_id': 3********6}>
[2026-07-12 14:16:53.538] [Core]
[INFO]
[core.event_bus:74]: [default] [AstrBot(aiocqhttp)] 白隐Hakuin/3********6: 好热啊阿莱——
[2026-07-12 14:16:53.538] [Core] [DBUG] [waking_check.stage:158]: enabled_plugins_name: ['*']
[2026-07-12 14:16:53.541] [Core] [DBUG] [method.star_request:46]: plugin -> astrbot_plugin_whitelistpro - check_whitelist
[2026-07-12 14:16:53.541] [Plug] [DBUG] [astrbot_plugin_whitelistpro.main:456]: [白名单检查] 消息类型: MessageType.FRIEND_MESSAGE, 会话: AstrBot:FriendMessage:3********6
[2026-07-12 14:16:53.542] [Plug] [DBUG] [astrbot_plugin_whitelistpro.main:460]: [白名单检查] AstrBot:FriendMessage:3********6 在全局白名单中,允许通过
[2026-07-12 14:16:53.542] [Core] [DBUG] [method.star_request:46]: plugin -> astrbot - handle_session_control_agent
[2026-07-12 14:16:53.542] [Core] [DBUG] [method.star_request:46]: plugin -> astrbot - handle_empty_mention
[2026-07-12 14:16:53.542] [Core] [DBUG] [method.star_request:46]: plugin -> astrbot_plugin_continuous_message - handle_private_msg
[2026-07-12 14:16:53.542] [Plug]
[INFO]
[astrbot_plugin_continuous_message.main:285]: [消息防抖动] 开始收集 - 用户: AstrBot:FriendMessage:3********6
[2026-07-12 14:16:53.542] [Plug] [DBUG] [astrbot_plugin_continuous_message.main:286]: [消息防抖动] 新建会话 | message_id: 32689838 | 图片: 0张 | 防抖时长: 1.5s
[2026-07-12 14:16:53.542] [Plug] [DBUG] [astrbot_plugin_continuous_message.main:291]: [消息防抖动] 首条消息文本: 好热啊阿莱——
[2026-07-12 14:16:55.044] [Plug] [DBUG] [astrbot_plugin_continuous_message.link_parser_adapter:101]: [link_parser] no supported links matched in merged text
[2026-07-12 14:16:55.045] [Plug]
[INFO]
[astrbot_plugin_continuous_message.main:312]: [消息防抖动] 结算触发 - 共 1 条 -> 发送
[2026-07-12 14:16:55.045] [Plug]
[INFO]
[astrbot_plugin_continuous_message.main:313]: [消息防抖动] 图片统计 | 原图数量: 0 | 解析追加图数量: 0
[2026-07-12 14:16:55.045] [Plug] [DBUG] [astrbot_plugin_continuous_message.main:316]: [消息防抖动] 合并后的完整消息:
好热啊阿莱——
[2026-07-12 14:16:55.045] [Core] [DBUG] [method.star_request:46]: plugin -> astrbot_plugin_bilibili - parse_miniapp
[2026-07-12 14:16:55.045] [Core] [DBUG] [method.star_request:46]: plugin -> astrbot_plugin_pokepro - on_message
[2026-07-12 14:16:55.047] [Core] [DBUG] [method.star_request:46]: plugin -> astrbot - on_message
[2026-07-12 14:16:55.050] [Core] [DBUG] [agent_sub_stages.internal:193]: ready to request llm provider
[2026-07-12 14:16:55.050] [Core] [DBUG] [agent_sub_stages.internal:217]: acquired session lock for llm request
[2026-07-12 14:16:55.601] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMRequestEvent) -> should_I_respond - interest_analyzer
[2026-07-12 14:16:55.601] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMRequestEvent) -> astrbot_plugin_uni_nickname - replace_nickname_in_llm_request
[2026-07-12 14:16:55.601] [Plug] [DBUG] [astrbot_plugin_uni_nickname.main:339]: [uni_nickname] 收到 LLM 请求拦截,发送者 ID: 3********6
[2026-07-12 14:16:55.602] [Plug]
[INFO]
[astrbot_plugin_uni_nickname.main:357]: [uni_nickname] 命中映射: 3********6 -> 白熊 (平台获取到的原始昵称: 白隐Hakuin)
[2026-07-12 14:16:55.602] [Plug] [DBUG] [astrbot_plugin_uni_nickname.main:368]: [uni_nickname] 当前工作模式: global_replace
[2026-07-12 14:16:55.602] [Plug] [DBUG] [astrbot_plugin_uni_nickname.main:408]: [uni_nickname] 全局替换模式激活
[2026-07-12 14:16:55.602] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMRequestEvent) -> astrbot - decorate_llm_req
[2026-07-12 14:16:57.843] [Core] [DBUG] [runners.base:64]: Agent state transition: AgentState.IDLE -> AgentState.RUNNING
[2026-07-12 14:16:57.843] [Core] [DBUG] [runners.tool_loop_agent_runner:618]: [BefCompact] messages -> [2] system,user
[2026-07-12 14:16:57.844] [Core] [DBUG] [runners.tool_loop_agent_runner:618]: [AftCompact] messages -> [2] system,user
[2026-07-12 14:16:57.851] [Core] [DBUG] [aiocqhttp.aiocqhttp_platform_adapter:129]: [aiocqhttp] RawMessage <Event, {'time': 1783837016, 'self_id': 2********2, 'post_type': 'notice', 'notice_type': 'notify', 'sub_type': 'input_status', 'status_text': '对方正在输入...', 'event_type': 2, 'user_id': 3********6, 'group_id': 0}>
[2026-07-12 14:16:57.851] [Core] [DBUG] [aiocqhttp.aiocqhttp_platform_adapter:129]: [aiocqhttp] RawMessage <Event, {'time': 1783837016, 'self_id': 2********2, 'post_type': 'notice', 'notice_type': 'notify', 'sub_type': 'input_status', 'status_text': '', 'event_type': 2, 'user_id': 3********6, 'group_id': 0}>
[2026-07-12 14:16:57.852] [Core]
[INFO]
[core.event_bus:74]: [default] [AstrBot(aiocqhttp)] 3********6/3********6:
[2026-07-12 14:16:57.852] [Core]
[INFO]
[core.event_bus:74]: [default] [AstrBot(aiocqhttp)] 3********6/3********6:
[2026-07-12 14:16:57.852] [Core] [DBUG] [waking_check.stage:158]: enabled_plugins_name: ['*']
[2026-07-12 14:16:57.854] [Core] [DBUG] [waking_check.stage:158]: enabled_plugins_name: ['*']
[2026-07-12 14:16:57.861] [Core] [DBUG] [method.star_request:46]: plugin -> astrbot_plugin_whitelistpro - check_whitelist
[2026-07-12 14:16:57.861] [Plug] [DBUG] [astrbot_plugin_whitelistpro.main:456]: [白名单检查] 消息类型: MessageType.FRIEND_MESSAGE, 会话: AstrBot:FriendMessage:3********6
[2026-07-12 14:16:57.862] [Plug] [DBUG] [astrbot_plugin_whitelistpro.main:460]: [白名单检查] AstrBot:FriendMessage:3********6 在全局白名单中,允许通过
[2026-07-12 14:16:57.862] [Core] [DBUG] [method.star_request:46]: plugin -> astrbot - handle_session_control_agent
[2026-07-12 14:16:57.862] [Core] [DBUG] [method.star_request:46]: plugin -> astrbot - handle_empty_mention
[2026-07-12 14:16:57.862] [Core] [DBUG] [method.star_request:46]: plugin -> astrbot_plugin_continuous_message - handle_private_msg
[2026-07-12 14:16:57.862] [Plug] [DBUG] [astrbot_plugin_continuous_message.main:121]: [消息防抖动] 输入状态通知 | user_id: 3********6 | status_text: 对方正在输入... | is_typing: True | 有活跃会话: False | event_type: 2
[2026-07-12 14:16:57.862] [Core] [DBUG] [pipeline.scheduler:55]: 阶段 ProcessStage 已终止事件传播。
[2026-07-12 14:16:57.863] [Core]
[INFO]
[respond.stage:206]: Prepare to send - 3********6/3********6:
[2026-07-12 14:16:57.863] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnAfterMessageSentEvent) -> astrbot - after_message_sent
[2026-07-12 14:16:57.863] [Core]
[INFO]
[pipeline.context_utils:103]: astrbot - after_message_sent 终止了事件传播。
[2026-07-12 14:16:57.863] [Core] [DBUG] [pipeline.scheduler:75]: 阶段 RespondStage 已终止事件传播。
[2026-07-12 14:16:57.863] [Core] [DBUG] [pipeline.scheduler:93]: pipeline execution completed.
[2026-07-12 14:16:57.864] [Core] [DBUG] [method.star_request:46]: plugin -> astrbot_plugin_whitelistpro - check_whitelist
[2026-07-12 14:16:57.864] [Plug] [DBUG] [astrbot_plugin_whitelistpro.main:456]: [白名单检查] 消息类型: MessageType.FRIEND_MESSAGE, 会话: AstrBot:FriendMessage:3********6
[2026-07-12 14:16:57.864] [Plug] [DBUG] [astrbot_plugin_whitelistpro.main:460]: [白名单检查] AstrBot:FriendMessage:3********6 在全局白名单中,允许通过
[2026-07-12 14:16:57.864] [Core] [DBUG] [method.star_request:46]: plugin -> astrbot - handle_session_control_agent
[2026-07-12 14:16:57.864] [Core] [DBUG] [method.star_request:46]: plugin -> astrbot - handle_empty_mention
[2026-07-12 14:16:57.865] [Core] [DBUG] [method.star_request:46]: plugin -> astrbot_plugin_continuous_message - handle_private_msg
[2026-07-12 14:16:57.865] [Plug] [DBUG] [astrbot_plugin_continuous_message.main:121]: [消息防抖动] 输入状态通知 | user_id: 3********6 | status_text: | is_typing: False | 有活跃会话: False | event_type: 2
[2026-07-12 14:16:57.865] [Core] [DBUG] [pipeline.scheduler:55]: 阶段 ProcessStage 已终止事件传播。
[2026-07-12 14:16:57.865] [Core]
[INFO]
[respond.stage:206]: Prepare to send - 3********6/3********6:
[2026-07-12 14:16:57.865] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnAfterMessageSentEvent) -> astrbot - after_message_sent
[2026-07-12 14:16:57.865] [Core]
[INFO]
[pipeline.context_utils:103]: astrbot - after_message_sent 终止了事件传播。
[2026-07-12 14:16:57.866] [Core] [DBUG] [pipeline.scheduler:75]: 阶段 RespondStage 已终止事件传播。
[2026-07-12 14:16:57.866] [Core] [DBUG] [pipeline.scheduler:93]: pipeline execution completed.
[2026-07-12 14:17:00.515] [Core] [DBUG] [sources.gemini_source:623]: genai result: sdk_http_response=HttpResponse(
headers=<dict len=19>
) candidates=[Candidate(
content=Content(
parts=[
Part(
function_call=FunctionCall(
args={
'command': 'cat /AstrBot/data/skills/web-search-guide/SKILL.md'
},
id='6hq6a1j7',
name='astrbot_execute_shell'
),
thought_signature=b"\x124\n2\x01\x11M2\x0fB\x1f3\x16So\xd1\xbd\x95S\xec\x9c\x85\n\xd3:[m\x87q\xbd\x92\xb0P\x81\x06X\x04\xb7g\xb5H'\xffx?\xa4{\xfe}\x19\xa9\x00B\xe7"
),
],
role='model'
),
finish_reason=<FinishReason.STOP: 'STOP'>,
index=0
)] create_time=None model_version='gemini-3-flash-preview' prompt_feedback=None response_id='WzFTasv8A-PhnsEPmNrq4AM' usage_metadata=GenerateContentResponseUsageMetadata(
candidates_token_count=37,
prompt_token_count=8868,
prompt_tokens_details=[
ModalityTokenCount(
modality=<MediaModality.TEXT: 'TEXT'>,
token_count=8868
),
],
total_token_count=8905
) automatic_function_calling_history=None parsed=None
[2026-07-12 14:17:00.516] [Core]
[INFO]
[respond.stage:206]: Prepare to send - 白隐Hakuin/3********6:
[2026-07-12 14:17:00.516] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnAfterMessageSentEvent) -> astrbot - after_message_sent
[2026-07-12 14:17:01.876] [Core] [DBUG] [sources.gemini_source:623]: genai result: sdk_http_response=HttpResponse(
headers=<dict len=18>
) candidates=[Candidate(
content=Content(
parts=[
Part(
function_call=FunctionCall(
args={
'command': 'cat /AstrBot/data/skills/web-search-guide/SKILL.md'
},
id='yo4btw7s',
name='astrbot_execute_shell'
),
thought_signature=b'\x124\n2\x01\x11M2\x0f\x8c\xcfz\x0fL?H/\x9a;"9Ph\x98\xbc[\xf0Kg\x7f\xb2\xcb\x04s\x86g\xe8$y\x86\x14\x99\'\'`\xdd+.\x90\'E\xd5\xcf\x87'
),
],
role='model'
),
finish_reason=<FinishReason.STOP: 'STOP'>,
index=0
)] create_time=None model_version='gemini-3-flash-preview' prompt_feedback=None response_id='XDFTas3GKYuDkdUPkr7BmA8' usage_metadata=GenerateContentResponseUsageMetadata(
candidates_token_count=37,
prompt_token_count=2334,
prompt_tokens_details=[
ModalityTokenCount(
modality=<MediaModality.TEXT: 'TEXT'>,
token_count=2334
),
],
total_token_count=2371
) automatic_function_calling_history=None parsed=None
[2026-07-12 14:17:01.876] [Core]
[INFO]
[runners.tool_loop_agent_runner:1003]: Agent 使用工具: ['astrbot_execute_shell']
[2026-07-12 14:17:02.143] [Core]
[INFO]
[runners.tool_loop_agent_runner:1056]: 使用工具:astrbot_execute_shell,参数:{'command': 'cat /AstrBot/data/skills/web-search-guide/SKILL.md'}
[2026-07-12 14:17:02.151] [Core]
[INFO]
[runners.tool_loop_agent_runner:1253]: Tool `astrbot_execute_shell` Result: {"stdout": "---\nname: web-search-guide\ndescription: 当你需要执行任何搜索或信息查询时必须阅读此 Skill,包括常规搜索、网页访问、Wiki 查询和天气查询。\n---\n\n# Search Skill\n\n## 概述\n\n本 Skill 指导如何根据不同的查询类型选择并调用正确的搜索工具。在执行任何搜索前,先判断查询类型,再选择对应工具。\n\n---\n\n## 工具选择决策树\n\n```\n需要搜索信息?\n│\n├─ 查询天气? → 使用 OpenWeather MCP(见下方\"天气查询\")\n│\n├─ 需要访问某个已知 URL? → 使用 fetch MCP\n│\n├─ 需要查明日方舟游戏内原文? → 使用 PRTS.wiki(MediaWiki MCP)\n│\n├─ 需要查二次元内容(番剧/梗/游戏)? → 使用萌娘百科(MediaWiki MCP)\n│\n└─ 其他常规搜索? → 使用 AISearch 工具\n```\n\n---\n\n## 各工具使用规范\n\n### 1. 常规搜索 —— AISearch\n\n**使用场景:** 搜索新闻、知识、事实、产品、人物、事件等一般性内容。\n\n**调用方式:** 直接调用 `AISearch` 工具,传入搜索关键词。\n\n**示例场景:**\n- \"Python 怎么读取 CSV 文件\"\n- \"2025年诺贝尔奖得主是谁\"\n\n---\n\n### 2. 访问特定网页 —— fetch MCP\n\n**使用场景:** 用户提供了明确的 URL,或需要获取某个特定页面的完整内容。\n\n**调用方式:** 调用 `fetch` MCP,传入目标 URL。\n\n**示例场景:**\n- \"帮我读一下这个链接的内容:https://...\"\n- \"访问这个页面并总结\"\n\n---\n\n### 3. 明日方舟 / 二次元 Wiki —— MediaWiki MCP\n\n根据查询内容,切换到对应的 Wiki:\n\n#### PRTS.wiki(明日方舟)\n\n**使用场景:** 查询明日方舟游戏相关的**官方原文内容**,包括:\n- 干员档案、技能、语音台词\n- 敌人档案\n- 活动介绍、关卡信息\n- 剧情原文\n- 官方公告\n\n**调用步骤:**\n1. 调用 `set-wiki`,切换到 PRTS.wiki\n2. 使用 `search-page` 搜索页面标题,或 `get-page` 直接获取已知页面\n3. 获取内容后提取所需信息\n\n**示例场景:**\n- \"阿米娅的三技能是什么效果\"\n- \"帮我看看《将进酒》活动的剧情简介\"\n- \"源石虫的敌人档案原文\"\n\n#### 萌娘百科(二次元内容)\n\n**使用场景:** 查询动漫、游戏、梗、二次元文化相关内容。\n\n**调用步骤:**\n1. 调用 `set-wiki`,切换到萌娘百科\n2. 使用 `search-page` 或 `get-page` 查询内容\n\n**示例场景:**\n- \"介绍一下EVA\"\n- \"OMORI是哪一年发布的\"\n- \"米哈游著名演员是什么梗\"\n\n#### MediaWiki 常用工具说明\n\n| 工具 | 用途 |\n|------|------|\n| `set-wiki` | 切换当前使用的 Wiki |\n| `get-page` | 获取指定页面的完整内容 |\n| `search-page` | 按关键词搜索页面标题和内容 |\n| `search-page-by-prefix` | 按标题前缀搜索(适合知道页面名称开头时) |\n| `get-category-members` | 获取某个分类下的所有页面 |\n\n---\n\n### 4. 天气查询 —— OpenWeather MCP\n\n**使用场景:** 查询任何地点的当前天气或历史天气。\n\n**调用步骤(必须按顺序):**\n\n1. **第一步:获取坐标**\n 调用 `get_coordinates_from_location`,传入地名。\n - 支持中国大陆县级及以上行政区\n - 支持国际城市名称\n\n2. **第二步:查询天气**\n - 当前天气 → 调用 `get_current_weather`,传入上一步获得的坐标\n - 历史天气 → 调用 `get_weather_history`,传入坐标和时间范围\n\n**注意:** 不要跳过坐标查询步骤,直接用地名查天气会失败。\n\n---\n\n## 注意事项\n\n- **明日方舟内容**:区分\"官方原文\"和\"百科介绍\"。需要游戏内出现的原始文字用 PRTS.wiki;需要综合攻略、角色分析等用萌娘百科或 AISearch。\n- **Wiki 切换**:使用 MediaWiki MCP 前务必用 `set-wiki` 切换到正确的 Wiki。\n- **已知 URL**:只要有明确的网页地址,优先用 fetch MCP 直接获取,比搜索更准确。当返回的内容超过fetch MCP 的最大返回长度限制时,如果没有获取到完整内容则从断开的部分接续获取。", "stderr": "", "exit_code": 0}
[2026-07-12 14:17:02.152] [Core] [DBUG] [runners.tool_loop_agent_runner:618]: [BefCompact] messages -> [4] system,user,assistant,tool
[2026-07-12 14:17:02.152] [Core] [DBUG] [runners.tool_loop_agent_runner:618]: [AftCompact] messages -> [4] system,user,assistant,tool
[2026-07-12 14:17:02.758] [Core]
[WARN]
[v4.26.5] [runners.tool_loop_agent_runner:558]: Chat Model {Cloudflare}/gemini-3-flash-preview request error: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': 'Function call is missing a thought_signature in functionCall parts. This is required for tools to work correctly, and missing thought_signature may lead to degraded model performance. Additional data, function call `default_api:astrbot_execute_shell` , position 2. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.', 'status': 'INVALID_ARGUMENT'}}
Traceback (most recent call last):
File "/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 512, in _iter_llm_responses_with_fallback
async for attempt in retrying:
File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 170, in __anext__
do = await self.iter(retry_state=self._retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 157, in iter
result = await action(retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/_utils.py", line 111, in inner
return call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/__init__.py", line 393, in <lambda>
self._add_action_func(lambda rs: rs.outcome.result())
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 516, in _iter_llm_responses_with_fallback
async for resp in self._iter_llm_responses(
File "/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 479, in _iter_llm_responses
yield await self.provider.text_chat(**payload)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 877, in text_chat
if await self._handle_api_error(e, keys):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 158, in _handle_api_error
raise e
File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 871, in text_chat
return await self._query(
^^^^^^^^^^^^^^^^^^
File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 614, in _query
result = await retry_provider_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/AstrBot/astrbot/core/provider/sources/request_retry.py", line 124, in retry_provider_request
async for attempt in retrying:
File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 170, in __anext__
do = await self.iter(retry_state=self._retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 157, in iter
result = await action(retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/_utils.py", line 111, in inner
return call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/__init__.py", line 393, in <lambda>
self._add_action_func(lambda rs: rs.outcome.result())
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/AstrBot/astrbot/core/provider/sources/request_retry.py", line 126, in retry_provider_request
return await request_factory()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/google/genai/models.py", line 7542, in generate_content
return await self._generate_content(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/google/genai/models.py", line 6330, in _generate_content
response = await self._api_client.async_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/google/genai/_api_client.py", line 1447, in async_request
result = await self._async_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/google/genai/_api_client.py", line 1380, in _async_request
return await self._async_retry( # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 112, in __call__
do = await self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 157, in iter
result = await action(retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/_utils.py", line 111, in inner
return call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/__init__.py", line 413, in exc_check
raise retry_exc.reraise()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/__init__.py", line 184, in reraise
raise self.last_attempt.result()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 116, in __call__
result = await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/google/genai/_api_client.py", line 1360, in _async_request_once
await errors.APIError.raise_for_async_response(client_response)
File "/usr/local/lib/python3.12/site-packages/google/genai/errors.py", line 216, in raise_for_async_response
await cls.raise_error_async(status_code, response_json, response)
File "/usr/local/lib/python3.12/site-packages/google/genai/errors.py", line 238, in raise_error_async
raise ClientError(status_code, response_json, response)
google.genai.errors.ClientError: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': 'Function call is missing a thought_signature in functionCall parts. This is required for tools to work correctly, and missing thought_signature may lead to degraded model performance. Additional data, function call `default_api:astrbot_execute_shell` , position 2. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.', 'status': 'INVALID_ARGUMENT'}}
[2026-07-12 14:17:02.765] [Core]
[WARN]
[v4.26.5] [runners.tool_loop_agent_runner:494]: Switched from {Cloudflare}/gemini-3-flash-preview to fallback chat provider: DeepSeek/deepseek-v4-pro
[2026-07-12 14:17:03.390] [Core]
[WARN]
[v4.26.5] [runners.tool_loop_agent_runner:558]: Chat Model DeepSeek/deepseek-v4-pro request error: Error code: 402 - {'error': {'message': 'Insufficient Balance', 'type': 'unknown_error', 'param': None, 'code': 'invalid_request_error'}}
Traceback (most recent call last):
File "/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 512, in _iter_llm_responses_with_fallback
async for attempt in retrying:
File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 170, in __anext__
do = await self.iter(retry_state=self._retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 157, in iter
result = await action(retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/_utils.py", line 111, in inner
return call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/__init__.py", line 393, in <lambda>
self._add_action_func(lambda rs: rs.outcome.result())
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 516, in _iter_llm_responses_with_fallback
async for resp in self._iter_llm_responses(
File "/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 479, in _iter_llm_responses
yield await self.provider.text_chat(**payload)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/AstrBot/astrbot/core/provider/sources/openai_source.py", line 1217, in text_chat
) = await self._handle_api_error(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/AstrBot/astrbot/core/provider/sources/openai_source.py", line 1158, in _handle_api_error
raise e
File "/AstrBot/astrbot/core/provider/sources/openai_source.py", line 1201, in text_chat
llm_response = await self._query(
^^^^^^^^^^^^^^^^^^
File "/AstrBot/astrbot/core/provider/sources/openai_source.py", line 552, in _query
completion = await retry_provider_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/AstrBot/astrbot/core/provider/sources/request_retry.py", line 124, in retry_provider_request
async for attempt in retrying:
File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 170, in __anext__
do = await self.iter(retry_state=self._retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 157, in iter
result = await action(retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/_utils.py", line 111, in inner
return call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/__init__.py", line 393, in <lambda>
self._add_action_func(lambda rs: rs.outcome.result())
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/AstrBot/astrbot/core/provider/sources/request_retry.py", line 126, in retry_provider_request
return await request_factory()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/openai/resources/chat/completions/completions.py", line 2714, in create
return await self._post(
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/openai/_base_client.py", line 1884, in post
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/openai/_base_client.py", line 1669, in request
raise self._make_status_error_from_response(err.response) from None
openai.APIStatusError: Error code: 402 - {'error': {'message': 'Insufficient Balance', 'type': 'unknown_error', 'param': None, 'code': 'invalid_request_error'}}
[2026-07-12 14:17:03.396] [Core]
[WARN]
[v4.26.5] [runners.tool_loop_agent_runner:494]: Switched from DeepSeek/deepseek-v4-pro to fallback chat provider: Gemini Free/gemini-3-flash-preview
[2026-07-12 14:17:04.714] [Core]
[WARN]
[v4.26.5] [runners.tool_loop_agent_runner:558]: Chat Model Gemini Free/gemini-3-flash-preview request error: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': 'Function call is missing a thought_signature in functionCall parts. This is required for tools to work correctly, and missing thought_signature may lead to degraded model performance. Additional data, function call `default_api:astrbot_execute_shell` , position 2. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.', 'status': 'INVALID_ARGUMENT'}}
Traceback (most recent call last):
File "/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 512, in _iter_llm_responses_with_fallback
async for attempt in retrying:
File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 170, in __anext__
do = await self.iter(retry_state=self._retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 157, in iter
result = await action(retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/_utils.py", line 111, in inner
return call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/__init__.py", line 393, in <lambda>
self._add_action_func(lambda rs: rs.outcome.result())
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 516, in _iter_llm_responses_with_fallback
async for resp in self._iter_llm_responses(
File "/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 479, in _iter_llm_responses
yield await self.provider.text_chat(**payload)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 877, in text_chat
if await self._handle_api_error(e, keys):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 158, in _handle_api_error
raise e
File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 871, in text_chat
return await self._query(
^^^^^^^^^^^^^^^^^^
File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 614, in _query
result = await retry_provider_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/AstrBot/astrbot/core/provider/sources/request_retry.py", line 124, in retry_provider_request
async for attempt in retrying:
File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 170, in __anext__
do = await self.iter(retry_state=self._retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 157, in iter
result = await action(retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/_utils.py", line 111, in inner
return call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/__init__.py", line 393, in <lambda>
self._add_action_func(lambda rs: rs.outcome.result())
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/AstrBot/astrbot/core/provider/sources/request_retry.py", line 126, in retry_provider_request
return await request_factory()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/google/genai/models.py", line 7542, in generate_content
return await self._generate_content(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/google/genai/models.py", line 6330, in _generate_content
response = await self._api_client.async_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/google/genai/_api_client.py", line 1447, in async_request
result = await self._async_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/google/genai/_api_client.py", line 1380, in _async_request
return await self._async_retry( # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 112, in __call__
do = await self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 157, in iter
result = await action(retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/_utils.py", line 111, in inner
return call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/__init__.py", line 413, in exc_check
raise retry_exc.reraise()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/tenacity/__init__.py", line 184, in reraise
raise self.last_attempt.result()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/usr/local/lib/python3.12/site-packages/tenacity/asyncio/__init__.py", line 116, in __call__
result = await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/google/genai/_api_client.py", line 1360, in _async_request_once
await errors.APIError.raise_for_async_response(client_response)
File "/usr/local/lib/python3.12/site-packages/google/genai/errors.py", line 216, in raise_for_async_response
await cls.raise_error_async(status_code, response_json, response)
File "/usr/local/lib/python3.12/site-packages/google/genai/errors.py", line 238, in raise_error_async
raise ClientError(status_code, response_json, response)
google.genai.errors.ClientError: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': 'Function call is missing a thought_signature in functionCall parts. This is required for tools to work correctly, and missing thought_signature may lead to degraded model performance. Additional data, function call `default_api:astrbot_execute_shell` , position 2. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.', 'status': 'INVALID_ARGUMENT'}}
[2026-07-12 14:17:04.721] [Core] [DBUG] [runners.base:64]: Agent state transition: AgentState.RUNNING -> AgentState.ERROR
[2026-07-12 14:17:04.723] [Core]
[INFO]
[respond.stage:206]: Prepare to send - 白隐Hakuin/3********6: [引用消息] LLM 响应错误: All chat models failed: ClientError: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': 'Function call is missing a thought_signature in functionCall parts. This is required for tools to work correctly, and missing thought_signature may lead to degraded model performance. Additional data, function call `default_api:astrbot_execute_shell` , position 2. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.', 'status': 'INVALID_ARGUMENT'}}
[2026-07-12 14:17:04.995] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnAfterMessageSentEvent) -> astrbot - after_message_sent
[2026-07-12 14:17:04.996] [Core] [DBUG] [pipeline.scheduler:93]: pipeline execution completed.
What happened / 发生了什么
使用 Google AI Studio API 时,当模型尝试调用任意工具时,遇到缺失思考签名报错
Function call is missing a thought_signature in functionCall parts在构造发送给 Gemini 的上一轮 assistant 消息时,只保留了
function_call部分,而丢弃了thought_signatureReproduce / 如何复现?
AstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器
v4.26.5 Docker
OS
Linux
Logs / 报错日志
Are you willing to submit a PR? / 你愿意提交 PR 吗?
Code of Conduct