Skip to content

[Bug] [Gemini] 客户端构造请求时的 schema错误,导致LLM调用全部失败 #6029

Closed

Description

@madoka-chann

What happened / 发生了什么

启用原生代码执行器可以解决这个问题,是升级到新版本之后出现的这个问题。

Image

Gemini 的 Function Calling (函数调用/工具调用) 功能时,向 API 提交的函数声明(Schema)格式不正确,导致gemini所有模型调用失败,provider可用性全部通过。

除了log插件外已禁用全部插件。经测试切换为默认人格也是同样的问题。

Reproduce / 如何复现?

配置文件(已移除敏感信息)

cmd配置.json

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

Windows Docker Desktop docker compose + napcat
v4.19.5
原生API

OS

Windows

Logs / 报错日志

私聊或者群聊触发词触发LLM报错的关键日志,更多的debug日志可以下载下面的文件

[2026-03-11 15:13:01.863] [Core] [WARN] [v4.19.5] [runners.tool_loop_agent_runner:268]: Chat Model google_gemini/gemini-3-flash-preview request error: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': '* GenerateContentRequest.tools[0].function_declarations[9].parameters.properties[source_uuids].items: missing field.\n', 'status': 'INVALID_ARGUMENT'}} Traceback (most recent call last): File "/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 243, in _iter_llm_responses_with_fallback async for resp in self._iter_llm_responses(include_model=idx == 0): File "/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 220, in _iter_llm_responses yield await self.provider.text_chat(**payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 769, in text_chat if await self._handle_api_error(e, keys): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 128, in _handle_api_error raise e File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 767, in text_chat return await self._query(payloads, func_tool) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 542, in _query result = await self.client.models.generate_content( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 1325, in _async_request_once await errors.APIError.raise_for_async_response(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': '* GenerateContentRequest.tools[0].function_declarations[9].parameters.properties[source_uuids].items: missing field.\n', 'status': 'INVALID_ARGUMENT'}} [2026-03-11 15:13:01.875] [Core] [WARN] [v4.19.5] [runners.tool_loop_agent_runner:235]: Switched from google_gemini/gemini-3-flash-preview to fallback chat provider: google_gemini/gemini-3.1-flash-lite-preview [2026-03-11 15:13:02.024] [Core] [WARN] [v4.19.5] [runners.tool_loop_agent_runner:268]: Chat Model google_gemini/gemini-3.1-flash-lite-preview request error: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': '* GenerateContentRequest.tools[0].function_declarations[9].parameters.properties[source_uuids].items: missing field.\n', 'status': 'INVALID_ARGUMENT'}} Traceback (most recent call last): File "/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 243, in _iter_llm_responses_with_fallback async for resp in self._iter_llm_responses(include_model=idx == 0): File "/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 220, in _iter_llm_responses yield await self.provider.text_chat(**payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 769, in text_chat if await self._handle_api_error(e, keys): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 128, in _handle_api_error raise e File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 767, in text_chat return await self._query(payloads, func_tool) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 542, in _query result = await self.client.models.generate_content( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 1325, in _async_request_once await errors.APIError.raise_for_async_response(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': '* GenerateContentRequest.tools[0].function_declarations[9].parameters.properties[source_uuids].items: missing field.\n', 'status': 'INVALID_ARGUMENT'}} [2026-03-11 15:13:02.036] [Core] [WARN] [v4.19.5] [runners.tool_loop_agent_runner:235]: Switched from google_gemini/gemini-3.1-flash-lite-preview to fallback chat provider: google_gemini/gemini-2.5-flash-lite-preview-09-2025 [2026-03-11 15:13:02.167] [Core] [WARN] [v4.19.5] [runners.tool_loop_agent_runner:268]: Chat Model google_gemini/gemini-2.5-flash-lite-preview-09-2025 request error: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': '* GenerateContentRequest.tools[0].function_declarations[9].parameters.properties[source_uuids].items: missing field.\n', 'status': 'INVALID_ARGUMENT'}} Traceback (most recent call last): File "/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 243, in _iter_llm_responses_with_fallback async for resp in self._iter_llm_responses(include_model=idx == 0): File "/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 220, in _iter_llm_responses yield await self.provider.text_chat(**payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 769, in text_chat if await self._handle_api_error(e, keys): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 128, in _handle_api_error raise e File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 767, in text_chat return await self._query(payloads, func_tool) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 542, in _query result = await self.client.models.generate_content( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 1325, in _async_request_once await errors.APIError.raise_for_async_response(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': '* GenerateContentRequest.tools[0].function_declarations[9].parameters.properties[source_uuids].items: missing field.\n', 'status': 'INVALID_ARGUMENT'}} [2026-03-11 15:13:02.178] [Core] [WARN] [v4.19.5] [runners.tool_loop_agent_runner:235]: Switched from google_gemini/gemini-2.5-flash-lite-preview-09-2025 to fallback chat provider: google_gemini/gemini-3.1-pro-preview [2026-03-11 15:13:02.313] [Core] [WARN] [v4.19.5] [runners.tool_loop_agent_runner:268]: Chat Model google_gemini/gemini-3.1-pro-preview request error: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': '* GenerateContentRequest.tools[0].function_declarations[9].parameters.properties[source_uuids].items: missing field.\n', 'status': 'INVALID_ARGUMENT'}} Traceback (most recent call last): File "/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 243, in _iter_llm_responses_with_fallback async for resp in self._iter_llm_responses(include_model=idx == 0): File "/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 220, in _iter_llm_responses yield await self.provider.text_chat(**payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 769, in text_chat if await self._handle_api_error(e, keys): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 128, in _handle_api_error raise e File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 767, in text_chat return await self._query(payloads, func_tool) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 542, in _query result = await self.client.models.generate_content( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 1325, in _async_request_once await errors.APIError.raise_for_async_response(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': '* GenerateContentRequest.tools[0].function_declarations[9].parameters.properties[source_uuids].items: missing field.\n', 'status': 'INVALID_ARGUMENT'}} [2026-03-11 15:13:02.325] [Core] [WARN] [v4.19.5] [runners.tool_loop_agent_runner:235]: Switched from google_gemini/gemini-3.1-pro-preview to fallback chat provider: google_gemini/gemini-3-pro-preview [2026-03-11 15:13:02.471] [Core] [WARN] [v4.19.5] [runners.tool_loop_agent_runner:268]: Chat Model google_gemini/gemini-3-pro-preview request error: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': '* GenerateContentRequest.tools[0].function_declarations[9].parameters.properties[source_uuids].items: missing field.\n', 'status': 'INVALID_ARGUMENT'}} Traceback (most recent call last): File "/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 243, in _iter_llm_responses_with_fallback async for resp in self._iter_llm_responses(include_model=idx == 0): File "/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 220, in _iter_llm_responses yield await self.provider.text_chat(**payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 769, in text_chat if await self._handle_api_error(e, keys): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 128, in _handle_api_error raise e File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 767, in text_chat return await self._query(payloads, func_tool) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/AstrBot/astrbot/core/provider/sources/gemini_source.py", line 542, in _query result = await self.client.models.generate_content( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 1325, in _async_request_once await errors.APIError.raise_for_async_response(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': '* GenerateContentRequest.tools[0].function_declarations[9].parameters.properties[source_uuids].items: missing field.\n', 'status': 'INVALID_ARGUMENT'}}

all_logs_20260311_152544.zip

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

  • Yes!

Code of Conduct

Activity

  1. added
    area:providerThe bug / feature is about AI Provider, Models, LLM Agent, LLM Agent Runner.
    on Mar 11, 2026
  2. changed the title [-][Bug] [Gemini] 客户端构造请求时的 schema错误[/-] [+][Bug] [Gemini] 客户端构造请求时的 schema错误,导致LLM调用全部失败[/+] on Mar 11, 2026
  3. dosubot commented on Mar 11, 2026

    @dosubot

    Hi @maodkaa! I'm Dosu and I’m helping the AstrBot team.

    你好!这是一个已知的问题类型。v4.19.5 已经修复了大多数 Gemini Function Calling schema 问题,但仍有几种可能的原因:

    可能原因:

    1. 使用了第三方 Gemini API 代理 - 很多 OpenAI 兼容的代理不完全支持 tools 字段,会返回 400 错误(相关 issue)
    2. 模型不支持 Function Calling - 部分 Gemini 模型(如 thinking 系列)不支持函数调用(#333)
    3. 启用了 Gemini 原生工具 - gm_native_coderunner、gm_native_search 等与自定义函数调用存在冲突

    建议排查步骤:

    • 确认使用的是官方 Gemini API 还是第三方代理
    • 尝试将「工具调用模式」切换为「skill-likes」作为临时解决方案(#5053)
    • 如果启用了 Gemini 原生工具,尝试关闭它们

    能否提供日志中的具体 API 错误响应?例如 400 错误的详细消息,这样可以更精确定位问题。

    To reply, just mention @dosu.


    Share context across your team and agents. Try Dosu.

    Leave Feedback Learn about AstrBot with Dosu Add Dosu to your team

  4. madoka-chann commented on Mar 11, 2026

    @madoka-chann
    Author

    如果不想看json的配置文件,这里提供图片版

    Image Image Image Image
  5. dosubot commented on Mar 11, 2026

    @dosubot

    感谢提供配置截图!看到问题了。

    问题原因: 你启用了 Gemini 原生工具(代码执行、URL上下文),这些与 Function Calling 存在架构级不兼容(#1354)。启用原生工具后,所有自定义函数工具会被禁用,可能导致 schema 冲突错误。

    另外,代码执行(Code execution)与 URL上下文(URL Context)不能同时开启(#1678),这是 Google API 的限制。

    解决方案:

    在 Gemini 提供商配置中关闭以下选项:

    • ❌ gm_native_coderunner(代码执行)
    • ❌ gm_url_context(URL 上下文)
    • ❌ gm_native_search(如有启用)

    关闭后 Function Calling 应该能正常工作(#4699)。如果之前有历史对话,建议也清理一下上下文。

    To reply, just mention @dosu.


    Share context across your team and agents. Try Dosu.

    Leave Feedback Learn about AstrBot with Dosu Add Dosu to your team

  6. madoka-chann commented on Mar 11, 2026

    @madoka-chann
    Author

    启用原生代码执行器可以修复,应该是新版本出现的问题。

  7. madoka-chann commented on Mar 11, 2026

    @madoka-chann
    Author

    该日志表示 Gemini API 请求参数格式错误,属于客户端构造请求时的 schema 问题,而不是模型本身的问题。

    核心错误:

    400 INVALID_ARGUMENT
    GenerateContentRequest.tools[0].function_declarations[9].parameters.properties[source_uuids].items: missing field
    

    1. 错误含义

    Gemini 在校验 tool function schema 时发现:

    source_uuids.items 缺少字段
    

    也就是说你在定义 tool function 参数时,声明了一个 array 类型字段 source_uuids,但没有给 items 指定类型。

    Gemini 的函数调用 schema 必须完整声明数组元素类型。

    2. 错误示例(错误写法)

    类似这种:

    {
      "type": "object",
      "properties": {
        "source_uuids": {
          "type": "array",
          "items": {}
        }
      }
    }

    或者

    "source_uuids": {
      "type": "array"
    }

    都会触发这个错误。

    3. 正确写法

    必须明确指定 items.type:

    {
      "type": "object",
      "properties": {
        "source_uuids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }

    如果是 UUID:

    "items": {
      "type": "string",
      "format": "uuid"
    }

    4. 为什么所有 Gemini 模型都失败

    日志里可以看到:

    gemini-3-flash-preview
    → fallback gemini-3.1-flash-lite-preview
    → fallback gemini-2.5-flash-lite-preview
    → fallback gemini-3.1-pro-preview
    → fallback gemini-3-pro-preview
    

    全部失败。

    原因:
    请求 payload 本身非法,所以换模型也没用。

    5. 触发位置

    根据日志:

    function_declarations[9]
    

    说明:

    • 第 10 个 tool function
    • 参数里有 source_uuids
    • schema 不完整

    大概率是:

    • AstrBot plugin
    • RAG tool
    • search tool
    • knowledge base tool

    6. 修复方法

    检查 tool 定义代码,例如:

    AstrBot
    plugins
    tool schema
    

    找到类似:

    "source_uuids": {
        "type": "array",
    }

    改成:

    "source_uuids": {
        "type": "array",
        "items": {
            "type": "string"
        }
    }

    7. 一句话总结

    这个报错的本质:

    Gemini function calling 的 JSON schema 不合法,数组参数 source_uuids 没有声明 items.type。

    不是模型问题,是 tool schema bug。


    如果你愿意,可以把 AstrBot 的 tool schema 或 plugin 代码发出来,我可以帮你直接定位是哪一段写错了。

  8. whatevertogo commented on Mar 11, 2026

    @whatevertogo
    Contributor

    为了定位问题所在,你能否告诉我开个新对话是否能好呢

  9. madoka-chann commented on Mar 11, 2026

    @madoka-chann
    Author

    为了定位问题所在,你能否告诉我开个新对话是否能好呢

    image
    必须打开原生代码执行器才行

  10. whatevertogo commented on Mar 11, 2026

    @whatevertogo
    Contributor

    不好意思,我想再请问一下其他模型是好的吗,只有Gemini出现这个错误吗,尤其是deepseek,能用deepseek再测一下最好不过了

  11. madoka-chann commented on Mar 11, 2026

    @madoka-chann
    Author

    不好意思,我想再请问一下其他模型是好的吗,只有Gemini出现这个错误吗,尤其是deepseek,能用deepseek再测一下最好不过了
    第三方接口的gpt也出问题

    [2026-03-11 20:15:17.864] [Core] [INFO] [core.event_bus:61]: [default] [艾洛(aiocqhttp)] 小圆/1691914478: 你好 
    [2026-03-11 20:15:17.869] [Core] [DBUG] [waking_check.stage:157]: enabled_plugins_name: ['*']
    [2026-03-11 20:15:17.885] [Core] [DBUG] [method.star_request:44]: plugin -> session_controller - handle_session_control_agent
    [2026-03-11 20:15:17.887] [Core] [DBUG] [method.star_request:44]: plugin -> session_controller - handle_empty_mention
    [2026-03-11 20:15:17.889] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot - on_message
    [2026-03-11 20:15:17.891] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_biliVideo - on_all_message
    [2026-03-11 20:15:17.892] [Plug] [INFO] [astrbot_plugin_bilivideo.main:241]: [AutoDetect] raw_message type=Event, truthy=True
    [2026-03-11 20:15:17.894] [Plug] [INFO] [astrbot_plugin_bilivideo.main:288]: [AutoDetect] 提取结果: bili_url='', bvid=None
    [2026-03-11 20:15:17.895] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_pokepro - on_message
    [2026-03-11 20:15:17.898] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_stealer - on_message
    [2026-03-11 20:15:17.899] [Plug] [DBUG] [core.event_handler:349]: EventHandler.on_message called with event type: <class 'astrbot.core.platform.sources.aiocqhttp.aiocqhttp_message_event.AiocqhttpMessageEvent'>
    [2026-03-11 20:15:17.901] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_wifepicker - track_active
    [2026-03-11 20:15:17.902] [Core] [DBUG] [method.star_request:44]: plugin -> cloudrank - record_message
    [2026-03-11 20:15:17.903] [Plug] [DBUG] [astrbot_plugin_cloudrank.main:677]: 收到私聊消息 - 会话ID: 艾洛:FriendMessage:1691914478, 发送者: 小圆(1691914478), 内容: 你好
    [2026-03-11 20:15:17.915] [Plug] [DBUG] [wordcloud_core.history_manager:155]: 消息保存成功 - 会话ID: 艾洛:FriendMessage:1691914478, 时间戳: 1773231317
    [2026-03-11 20:15:17.917] [Plug] [DBUG] [astrbot_plugin_cloudrank.main:693]: 成功保存消息到历史记录 - 会话ID: 艾洛:FriendMessage:1691914478
    [2026-03-11 20:15:17.926] [Core] [DBUG] [agent_sub_stages.internal:166]: ready to request llm provider
    [2026-03-11 20:15:17.928] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnWaitingLLMRequestEvent) -> astrbot_plugin_iamthinking - on_waiting_llm_request
    [2026-03-11 20:15:17.929] [Plug] [DBUG] [astrbot_plugin_iamthinking.main:120]: [iamthinking] on_waiting_llm_request 触发
    [2026-03-11 20:15:17.930] [Plug] [DBUG] [astrbot_plugin_iamthinking.main:125]: [iamthinking] 非 aiocqhttp 平台,跳过
    [2026-03-11 20:15:17.931] [Core] [DBUG] [agent_sub_stages.internal:185]: acquired session lock for llm request
    [2026-03-11 20:15:18.209] [Core] [DBUG] [core.astr_main_agent_resources:432]: [知识库] 使用全局配置,知识库数量: 0
    [2026-03-11 20:15:18.211] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMRequestEvent) -> astrbot - decorate_llm_req
    [2026-03-11 20:15:18.214] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMRequestEvent) -> astrbot_plugin_portrayal - on_llm_request
    [2026-03-11 20:15:18.217] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMRequestEvent) -> astrbot_plugin_stealer - _inject_emotion_instruction
    [2026-03-11 20:15:18.223] [Plug] [DBUG] [astrbot_plugin_stealer.main:856]: [Stealer] LLM模式已启用,跳过提示词注入,将使用轻量模型分析
    [2026-03-11 20:15:18.223] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMRequestEvent) -> astrbot_plugin_uni_nickname - replace_nickname_in_llm_request
    [2026-03-11 20:15:18.224] [Plug] [DBUG] [astrbot_plugin_uni_nickname.main:242]: [uni_nickname] 收到 LLM 请求拦截,发送者 ID: 1691914478
    [2026-03-11 20:15:18.225] [Plug] [INFO] [astrbot_plugin_uni_nickname.main:260]: [uni_nickname] 命中映射: 1691914478 -> 小圆 (平台获取到的原始昵称: 小圆)
    [2026-03-11 20:15:18.233] [Plug] [DBUG] [astrbot_plugin_uni_nickname.main:271]: [uni_nickname] 当前工作模式: system_replace
    [2026-03-11 20:15:18.234] [Plug] [DBUG] [astrbot_plugin_uni_nickname.main:296]: [uni_nickname] 系统标签替换模式激活
    [2026-03-11 20:15:18.236] [Plug] [WARN] [v4.19.5] [astrbot_plugin_uni_nickname.main:150]: [uni_nickname] 未检测到 <system_reminder> 身份标签。请检查 AstrBot 设置中是否已开启用户识别(provider_settings.identifier)。
    [2026-03-11 20:15:18.238] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMRequestEvent) -> astrbot_plugin_llm_amnesia - on_llm_request_cleanup
    [2026-03-11 20:15:18.239] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMRequestEvent) -> astrbot-web-searcher - edit_web_search_tools
    [2026-03-11 20:15:18.240] [Core] [DBUG] [runners.base:64]: Agent state transition: AgentState.IDLE -> AgentState.RUNNING
    [2026-03-11 20:15:18.241] [Core] [DBUG] [runners.tool_loop_agent_runner:297]: [BefCompact] RunCtx.messages -> [4] system,user,assistant,user
    [2026-03-11 20:15:18.244] [Core] [DBUG] [runners.tool_loop_agent_runner:297]: [AftCompact] RunCtx.messages -> [4] system,user,assistant,user
    [2026-03-11 20:15:19.319] [Core] [WARN] [v4.19.5] [runners.tool_loop_agent_runner:268]: Chat Model openai/gpt-5.2 request error: Error code: 400 - {'error': {'message': "Invalid schema for function 'save_group_knowledge': In context=('properties', 'source_uuids'), array schema missing items.", 'type': 'invalid_request_error', 'param': 'tools[6].parameters', 'code': 'invalid_function_parameters'}}
    Traceback (most recent call last):
      File "/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 243, in _iter_llm_responses_with_fallback
        async for resp in self._iter_llm_responses(include_model=idx == 0):
      File "/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 220, in _iter_llm_responses
        yield await self.provider.text_chat(**payload)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/AstrBot/astrbot/core/provider/sources/openai_source.py", line 763, in text_chat
        ) = await self._handle_api_error(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/AstrBot/astrbot/core/provider/sources/openai_source.py", line 714, in _handle_api_error
        raise e
      File "/AstrBot/astrbot/core/provider/sources/openai_source.py", line 751, in text_chat
        llm_response = await self._query(payloads, func_tool)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/AstrBot/astrbot/core/provider/sources/openai_source.py", line 251, in _query
        completion = await self.client.chat.completions.create(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.12/site-packages/openai/resources/chat/completions/completions.py", line 2700, 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.BadRequestError: Error code: 400 - {'error': {'message': "Invalid schema for function 'save_group_knowledge': In context=('properties', 'source_uuids'), array schema missing items.", 'type': 'invalid_request_error', 'param': 'tools[6].parameters', 'code': 'invalid_function_parameters'}}
    [2026-03-11 20:15:19.343] [Core] [WARN] [v4.19.5] [runners.tool_loop_agent_runner:235]: Switched from openai/gpt-5.2 to fallback chat provider: openai/gpt-5.1
    [2026-03-11 20:15:20.012] [Core] [DBUG] [aiocqhttp.aiocqhttp_platform_adapter:129]: [aiocqhttp] RawMessage <Event, {'self_id': 4443008, 'user_id': 2572646335, 'time': 1773231319, 'message_id': 2088638849, 'message_seq': 2088638849, 'real_id': 2088638849, 'real_seq': '572375', 'message_type': 'group', 'sender': {'user_id': 2572646335, 'nickname': '柳如烟✿ۣว', 'card': '', 'role': 'member'}, 'raw_message': '?', 'font': 14, 'sub_type': 'normal', 'message': [{'type': 'text', 'data': {'text': '?'}}], 'message_format': 'array', 'post_type': 'message', 'group_id': 737431101, 'group_name': '二重螺旋 晓宏护肝交流3群'}>
    [2026-03-11 20:15:20.015] [Core] [INFO] [core.event_bus:61]: [default] [艾洛(aiocqhttp)] 柳如烟✿ۣว/2572646335: ? 
    [2026-03-11 20:15:20.017] [Core] [DBUG] [waking_check.stage:157]: enabled_plugins_name: ['*']
    [2026-03-11 20:15:20.023] [Core] [DBUG] [aiocqhttp.aiocqhttp_platform_adapter:129]: [aiocqhttp] RawMessage <Event, {'self_id': 4443008, 'user_id': 3167416603, 'time': 1773231319, 'message_id': 1186858653, 'message_seq': 1186858653, 'real_id': 1186858653, 'real_seq': '2147008', 'message_type': 'group', 'sender': {'user_id': 3167416603, 'nickname': '大肥鸟', 'card': '👿👿不素鸟之饿魔👿👿', 'role': 'member'}, 'raw_message': '[CQ:reply,id=1570588236][CQ:at,qq=3195452081] ai本子', 'font': 14, 'sub_type': 'normal', 'message': [{'type': 'reply', 'data': {'id': '1570588236'}}, {'type': 'at', 'data': {'qq': '3195452081'}}, {'type': 'text', 'data': {'text': ' ai本子'}}], 'message_format': 'array', 'post_type': 'message', 'group_id': 825375018, 'group_name': 'A群的小子'}>
    [2026-03-11 20:15:20.033] [Core] [DBUG] [method.star_request:44]: plugin -> session_controller - handle_session_control_agent
    [2026-03-11 20:15:20.035] [Core] [DBUG] [method.star_request:44]: plugin -> session_controller - handle_empty_mention
    [2026-03-11 20:15:20.037] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_outputpro - on_message
    [2026-03-11 20:15:20.041] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot - on_message
    [2026-03-11 20:15:20.042] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_animewifex - on_all_messages
    [2026-03-11 20:15:20.044] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_biliVideo - on_all_message
    [2026-03-11 20:15:20.046] [Plug] [INFO] [astrbot_plugin_bilivideo.main:241]: [AutoDetect] raw_message type=Event, truthy=True
    [2026-03-11 20:15:20.047] [Plug] [INFO] [astrbot_plugin_bilivideo.main:288]: [AutoDetect] 提取结果: bili_url='', bvid=None
    [2026-03-11 20:15:20.048] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_emoji_like - on_message
    [2026-03-11 20:15:20.050] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_love_formula - on_group_message
    [2026-03-11 20:15:20.051] [Plug] [DBUG] [astrbot_plugin_love_formula.main:94]: [LoveFormula] on_group_message 触发: 2088638849
    [2026-03-11 20:15:20.064] [Core] [INFO] [core.event_bus:61]: [default] [艾洛(aiocqhttp)] 👿👿不素鸟之饿魔👿👿/3167416603: [引用消息] [At:3195452081] ai本子 
    
  12. whatevertogo commented on Mar 11, 2026

    @whatevertogo
    Contributor

    那就是工具的问题w(゚Д゚)w我回去看看吧

  13. madoka-chann commented on Mar 11, 2026

    @madoka-chann
    Author
    [2026-03-11 20:18:13.799] [Core] [DBUG] [aiocqhttp.aiocqhttp_platform_adapter:129]: [aiocqhttp] RawMessage <Event, {'self_id': 4443008, 'user_id': 1691914478, 'time': 1773231493, 'message_id': 1355870480, 'message_seq': 1355870480, 'real_id': 1355870480, 'real_seq': '1667', 'message_type': 'private', 'sender': {'user_id': 1691914478, 'nickname': '小圆', 'card': ''}, 'raw_message': '你好', 'font': 14, 'sub_type': 'friend', 'message': [{'type': 'text', 'data': {'text': '你好'}}], 'message_format': 'array', 'post_type': 'message', 'target_id': 1691914478}>
    [2026-03-11 20:18:13.802] [Core] [INFO] [core.event_bus:61]: [default] [艾洛(aiocqhttp)] 小圆/1691914478: 你好 
    [2026-03-11 20:18:13.805] [Core] [DBUG] [waking_check.stage:157]: enabled_plugins_name: ['*']
    [2026-03-11 20:18:13.821] [Core] [DBUG] [method.star_request:44]: plugin -> session_controller - handle_session_control_agent
    [2026-03-11 20:18:13.823] [Core] [DBUG] [method.star_request:44]: plugin -> session_controller - handle_empty_mention
    [2026-03-11 20:18:13.824] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot - on_message
    [2026-03-11 20:18:13.825] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_biliVideo - on_all_message
    [2026-03-11 20:18:13.827] [Plug] [INFO] [astrbot_plugin_bilivideo.main:241]: [AutoDetect] raw_message type=Event, truthy=True
    [2026-03-11 20:18:13.828] [Plug] [INFO] [astrbot_plugin_bilivideo.main:288]: [AutoDetect] 提取结果: bili_url='', bvid=None
    [2026-03-11 20:18:13.829] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_pokepro - on_message
    [2026-03-11 20:18:13.834] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_stealer - on_message
    [2026-03-11 20:18:13.835] [Plug] [DBUG] [core.event_handler:349]: EventHandler.on_message called with event type: <class 'astrbot.core.platform.sources.aiocqhttp.aiocqhttp_message_event.AiocqhttpMessageEvent'>
    [2026-03-11 20:18:13.836] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_wifepicker - track_active
    [2026-03-11 20:18:13.838] [Core] [DBUG] [method.star_request:44]: plugin -> cloudrank - record_message
    [2026-03-11 20:18:13.839] [Plug] [DBUG] [astrbot_plugin_cloudrank.main:677]: 收到私聊消息 - 会话ID: 艾洛:FriendMessage:1691914478, 发送者: 小圆(1691914478), 内容: 你好
    [2026-03-11 20:18:13.852] [Plug] [DBUG] [wordcloud_core.history_manager:155]: 消息保存成功 - 会话ID: 艾洛:FriendMessage:1691914478, 时间戳: 1773231493
    [2026-03-11 20:18:13.854] [Plug] [DBUG] [astrbot_plugin_cloudrank.main:693]: 成功保存消息到历史记录 - 会话ID: 艾洛:FriendMessage:1691914478
    [2026-03-11 20:18:13.861] [Core] [DBUG] [agent_sub_stages.internal:166]: ready to request llm provider
    [2026-03-11 20:18:13.863] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnWaitingLLMRequestEvent) -> astrbot_plugin_iamthinking - on_waiting_llm_request
    [2026-03-11 20:18:13.864] [Plug] [DBUG] [astrbot_plugin_iamthinking.main:120]: [iamthinking] on_waiting_llm_request 触发
    [2026-03-11 20:18:13.865] [Plug] [DBUG] [astrbot_plugin_iamthinking.main:125]: [iamthinking] 非 aiocqhttp 平台,跳过
    [2026-03-11 20:18:13.866] [Core] [DBUG] [agent_sub_stages.internal:185]: acquired session lock for llm request
    [2026-03-11 20:18:14.199] [Core] [DBUG] [core.astr_main_agent_resources:432]: [知识库] 使用全局配置,知识库数量: 0
    [2026-03-11 20:18:14.203] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMRequestEvent) -> astrbot - decorate_llm_req
    [2026-03-11 20:18:14.205] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMRequestEvent) -> astrbot_plugin_portrayal - on_llm_request
    [2026-03-11 20:18:14.207] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMRequestEvent) -> astrbot_plugin_stealer - _inject_emotion_instruction
    [2026-03-11 20:18:14.209] [Plug] [DBUG] [astrbot_plugin_stealer.main:856]: [Stealer] LLM模式已启用,跳过提示词注入,将使用轻量模型分析
    [2026-03-11 20:18:14.210] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMRequestEvent) -> astrbot_plugin_uni_nickname - replace_nickname_in_llm_request
    [2026-03-11 20:18:14.212] [Plug] [DBUG] [astrbot_plugin_uni_nickname.main:242]: [uni_nickname] 收到 LLM 请求拦截,发送者 ID: 1691914478
    [2026-03-11 20:18:14.213] [Plug] [INFO] [astrbot_plugin_uni_nickname.main:260]: [uni_nickname] 命中映射: 1691914478 -> 小圆 (平台获取到的原始昵称: 小圆)
    [2026-03-11 20:18:14.215] [Plug] [DBUG] [astrbot_plugin_uni_nickname.main:271]: [uni_nickname] 当前工作模式: system_replace
    [2026-03-11 20:18:14.216] [Plug] [DBUG] [astrbot_plugin_uni_nickname.main:296]: [uni_nickname] 系统标签替换模式激活
    [2026-03-11 20:18:14.217] [Plug] [WARN] [v4.19.5] [astrbot_plugin_uni_nickname.main:150]: [uni_nickname] 未检测到 <system_reminder> 身份标签。请检查 AstrBot 设置中是否已开启用户识别(provider_settings.identifier)。
    [2026-03-11 20:18:14.218] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMRequestEvent) -> astrbot_plugin_llm_amnesia - on_llm_request_cleanup
    [2026-03-11 20:18:14.219] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMRequestEvent) -> astrbot-web-searcher - edit_web_search_tools
    [2026-03-11 20:18:14.221] [Core] [DBUG] [runners.base:64]: Agent state transition: AgentState.IDLE -> AgentState.RUNNING
    [2026-03-11 20:18:14.222] [Core] [DBUG] [runners.tool_loop_agent_runner:297]: [BefCompact] RunCtx.messages -> [8] system,user,assistant,user,assistant,user,assistant,user
    [2026-03-11 20:18:14.223] [Core] [DBUG] [runners.tool_loop_agent_runner:297]: [AftCompact] RunCtx.messages -> [8] system,user,assistant,user,assistant,user,assistant,user
    [2026-03-11 20:18:14.750] [Core] [DBUG] [aiocqhttp.aiocqhttp_platform_adapter:129]: [aiocqhttp] RawMessage <Event, {'self_id': 4443008, 'user_id': 1500259617, 'time': 1773231494, 'message_id': 1749245324, 'message_seq': 1749245324, 'real_id': 1749245324, 'real_seq': '359345', 'message_type': 'group', 'sender': {'user_id': 1500259617, 'nickname': '沙拉@', 'card': '', 'role': 'member'}, 'raw_message': '我都合了一堆雷达了', 'font': 14, 'sub_type': 'normal', 'message': [{'type': 'text', 'data': {'text': '我都合了一堆雷达了'}}], 'message_format': 'array', 'post_type': 'message', 'group_id': 561794003, 'group_name': '阿库西斯教团(绿玩群)'}>
    [2026-03-11 20:18:14.753] [Core] [INFO] [core.event_bus:61]: [default] [艾洛(aiocqhttp)] 沙拉@/1500259617: 我都合了一堆雷达了 
    [2026-03-11 20:18:14.757] [Core] [DBUG] [waking_check.stage:157]: enabled_plugins_name: ['*']
    [2026-03-11 20:18:14.770] [Core] [DBUG] [method.star_request:44]: plugin -> session_controller - handle_session_control_agent
    [2026-03-11 20:18:14.772] [Core] [DBUG] [method.star_request:44]: plugin -> session_controller - handle_empty_mention
    [2026-03-11 20:18:14.774] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_outputpro - on_message
    [2026-03-11 20:18:14.777] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot - on_message
    [2026-03-11 20:18:14.779] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_animewifex - on_all_messages
    [2026-03-11 20:18:14.780] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_biliVideo - on_all_message
    [2026-03-11 20:18:14.782] [Plug] [INFO] [astrbot_plugin_bilivideo.main:241]: [AutoDetect] raw_message type=Event, truthy=True
    [2026-03-11 20:18:14.783] [Plug] [INFO] [astrbot_plugin_bilivideo.main:288]: [AutoDetect] 提取结果: bili_url='', bvid=None
    [2026-03-11 20:18:14.784] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_emoji_like - on_message
    [2026-03-11 20:18:14.785] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_love_formula - on_group_message
    [2026-03-11 20:18:14.786] [Plug] [DBUG] [astrbot_plugin_love_formula.main:94]: [LoveFormula] on_group_message 触发: 1749245324
    [2026-03-11 20:18:14.853] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_pokepro - on_message
    [2026-03-11 20:18:14.857] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_portrayal - get_portrayal
    [2026-03-11 20:18:14.860] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_stealer - on_message
    [2026-03-11 20:18:14.861] [Plug] [DBUG] [core.event_handler:349]: EventHandler.on_message called with event type: <class 'astrbot.core.platform.sources.aiocqhttp.aiocqhttp_message_event.AiocqhttpMessageEvent'>
    [2026-03-11 20:18:14.863] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_wifepicker - keyword_trigger
    [2026-03-11 20:18:14.865] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_wifepicker - track_active
    [2026-03-11 20:18:14.876] [Core] [DBUG] [method.star_request:44]: plugin -> cloudrank - record_message
    [2026-03-11 20:18:14.879] [Plug] [DBUG] [astrbot_plugin_cloudrank.utils:212]: 群 561794003 不在启用列表中
    [2026-03-11 20:18:14.880] [Plug] [DBUG] [astrbot_plugin_cloudrank.main:619]: 群 561794003 未启用词云功能,跳过消息记录
    [2026-03-11 20:18:14.882] [Core] [DBUG] [pipeline.scheduler:93]: pipeline 执行完毕。
    [2026-03-11 20:18:15.418] [Core] [DBUG] [aiocqhttp.aiocqhttp_platform_adapter:129]: [aiocqhttp] RawMessage <Event, {'self_id': 4443008, 'user_id': 2770619036, 'time': 1773231495, 'message_id': 939089686, 'message_seq': 939089686, 'real_id': 939089686, 'real_seq': '40535', 'message_type': 'group', 'sender': {'user_id': 2770619036, 'nickname': 'kx', 'card': '', 'role': 'member'}, 'raw_message': '乌托邦太乱了什么模组都要根本没有考虑过兼容性', 'font': 14, 'sub_type': 'normal', 'message': [{'type': 'text', 'data': {'text': '乌托邦太乱了什么模组都要根本没有考虑过兼容性'}}], 'message_format': 'array', 'post_type': 'message', 'group_id': 1049702540, 'group_name': '满城花语(落幕曲)'}>
    [2026-03-11 20:18:15.421] [Core] [INFO] [core.event_bus:61]: [default] [艾洛(aiocqhttp)] kx/2770619036: 乌托邦太乱了什么模组都要根本没有考虑过兼容性 
    [2026-03-11 20:18:15.424] [Core] [DBUG] [waking_check.stage:157]: enabled_plugins_name: ['*']
    [2026-03-11 20:18:15.438] [Core] [DBUG] [method.star_request:44]: plugin -> session_controller - handle_session_control_agent
    [2026-03-11 20:18:15.440] [Core] [DBUG] [method.star_request:44]: plugin -> session_controller - handle_empty_mention
    [2026-03-11 20:18:15.441] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_outputpro - on_message
    [2026-03-11 20:18:15.443] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot - on_message
    [2026-03-11 20:18:15.444] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_animewifex - on_all_messages
    [2026-03-11 20:18:15.446] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_biliVideo - on_all_message
    [2026-03-11 20:18:15.448] [Plug] [INFO] [astrbot_plugin_bilivideo.main:241]: [AutoDetect] raw_message type=Event, truthy=True
    [2026-03-11 20:18:15.449] [Plug] [INFO] [astrbot_plugin_bilivideo.main:288]: [AutoDetect] 提取结果: bili_url='', bvid=None
    [2026-03-11 20:18:15.450] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_emoji_like - on_message
    [2026-03-11 20:18:15.451] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_love_formula - on_group_message
    [2026-03-11 20:18:15.452] [Plug] [DBUG] [astrbot_plugin_love_formula.main:94]: [LoveFormula] on_group_message 触发: 939089686
    [2026-03-11 20:18:15.504] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_pokepro - on_message
    [2026-03-11 20:18:15.506] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_portrayal - get_portrayal
    [2026-03-11 20:18:15.507] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_stealer - on_message
    [2026-03-11 20:18:15.508] [Plug] [DBUG] [core.event_handler:349]: EventHandler.on_message called with event type: <class 'astrbot.core.platform.sources.aiocqhttp.aiocqhttp_message_event.AiocqhttpMessageEvent'>
    [2026-03-11 20:18:15.509] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_wifepicker - keyword_trigger
    [2026-03-11 20:18:15.510] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_wifepicker - track_active
    [2026-03-11 20:18:15.516] [Core] [DBUG] [method.star_request:44]: plugin -> cloudrank - record_message
    [2026-03-11 20:18:15.517] [Plug] [DBUG] [astrbot_plugin_cloudrank.utils:212]: 群 1049702540 不在启用列表中
    [2026-03-11 20:18:15.519] [Plug] [DBUG] [astrbot_plugin_cloudrank.main:619]: 群 1049702540 未启用词云功能,跳过消息记录
    [2026-03-11 20:18:15.521] [Core] [DBUG] [pipeline.scheduler:93]: pipeline 执行完毕。
    [2026-03-11 20:18:16.835] [Core] [DBUG] [aiocqhttp.aiocqhttp_platform_adapter:129]: [aiocqhttp] RawMessage <Event, {'time': 1773231496, 'self_id': 4443008, 'post_type': 'notice', 'notice_type': 'notify', 'sub_type': 'input_status', 'status_text': '对方正在输入...', 'event_type': 2, 'user_id': 1691914478, 'group_id': 0}>
    [2026-03-11 20:18:16.839] [Core] [INFO] [core.event_bus:61]: [default] [艾洛(aiocqhttp)] 1691914478/1691914478: 
    [2026-03-11 20:18:16.843] [Core] [DBUG] [waking_check.stage:157]: enabled_plugins_name: ['*']
    [2026-03-11 20:18:16.860] [Core] [DBUG] [method.star_request:44]: plugin -> session_controller - handle_session_control_agent
    [2026-03-11 20:18:16.863] [Core] [DBUG] [method.star_request:44]: plugin -> session_controller - handle_empty_mention
    [2026-03-11 20:18:16.864] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot - on_message
    [2026-03-11 20:18:16.866] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_biliVideo - on_all_message
    [2026-03-11 20:18:16.868] [Plug] [INFO] [astrbot_plugin_bilivideo.main:241]: [AutoDetect] raw_message type=Event, truthy=True
    [2026-03-11 20:18:16.869] [Plug] [INFO] [astrbot_plugin_bilivideo.main:288]: [AutoDetect] 提取结果: bili_url='', bvid=None
    [2026-03-11 20:18:16.870] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_pokepro - on_message
    [2026-03-11 20:18:16.880] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_stealer - on_message
    [2026-03-11 20:18:16.881] [Plug] [DBUG] [core.event_handler:349]: EventHandler.on_message called with event type: <class 'astrbot.core.platform.sources.aiocqhttp.aiocqhttp_message_event.AiocqhttpMessageEvent'>
    [2026-03-11 20:18:16.883] [Core] [DBUG] [method.star_request:44]: plugin -> astrbot_plugin_wifepicker - track_active
    [2026-03-11 20:18:16.884] [Core] [DBUG] [method.star_request:44]: plugin -> cloudrank - record_message
    [2026-03-11 20:18:16.885] [Plug] [DBUG] [astrbot_plugin_cloudrank.main:654]: 收到私聊消息 - 会话ID: 艾洛:FriendMessage:1691914478, 发送者: 1691914478(1691914478), 内容: [无文本内容]
    [2026-03-11 20:18:16.893] [Core] [DBUG] [agent_sub_stages.internal:163]: skip llm request: empty message and no provider_request
    [2026-03-11 20:18:16.894] [Core] [DBUG] [pipeline.scheduler:93]: pipeline 执行完毕。
    [2026-03-11 20:18:17.600] [Core] [DBUG] [sources.openai_source:262]: completion: ChatCompletion(id='a053a445-8922-4662-bfb2-58b8f7c056f7', choices=[Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content='(微微叹气,露出无奈的笑容)艾洛发现你好像只会说"你好"呢……这样下去对话可没办法继续下去哦~\n\n(轻轻晃了晃手指)试着说点别的好不好?比如说"今天天气不错"或者"我喜欢吃甜食"之类的~', refusal=None, role='assistant', annotations=None, audio=None, function_call=None, tool_calls=[]))], created=1773231497, model='deepseek-v3.2', object='chat.completion', service_tier=None, system_fingerprint=None, usage=CompletionUsage(completion_tokens=58, prompt_tokens=2964, total_tokens=3022, completion_tokens_details=None, prompt_tokens_details=None), extend_fields={'traceId': '2101fbe817732314943422459e1062', 'requestId': 'ffd113352dfd663dca6b20cdd4a62b03'})
    [2026-03-11 20:18:17.603] [Core] [DBUG] [runners.base:64]: Agent state transition: AgentState.RUNNING -> AgentState.DONE
    [2026-03-11 20:18:17.606] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMResponseEvent) -> astrbot - record_llm_resp_to_ltm
    [2026-03-11 20:18:17.609] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMResponseEvent) -> astrbot_plugin_iamthinking - on_llm_response
    [2026-03-11 20:18:17.611] [Core] [DBUG] [result_decorate.stage:165]: hook(on_decorating_result) -> astrbot_plugin_stealer - _prepare_emoji_response
    [2026-03-11 20:18:17.613] [Plug] [INFO] [astrbot_plugin_stealer.main:917]: [Stealer] _prepare_emoji_response 被调用
    [2026-03-11 20:18:17.615] [Plug] [DBUG] [astrbot_plugin_stealer.main:989]: [Stealer] LLM模式:保持消息链不变,异步分析语义
    [2026-03-11 20:18:17.616] [Core] [DBUG] [result_decorate.stage:165]: hook(on_decorating_result) -> astrbot_plugin_outputpro - on_decorating_result
    [2026-03-11 20:18:17.629] [Core] [INFO] [respond.stage:184]: Prepare to send - 小圆/1691914478: (微微叹气,露出无奈的笑容)艾洛发现你好像只会说"你好"呢……这样下去对话可没办法继续下去哦~
    
    (轻轻晃了晃手指)试着说点别的好不好?比如说"今天天气不错"或者"我喜欢吃甜食"之类的~ 
    [2026-03-11 20:18:17.634] [Plug] [DBUG] [astrbot_plugin_stealer.main:1167]: [Stealer] 智能模式:使用轻量模型分析情绪
    [2026-03-11 20:18:17.635] [Plug] [INFO] [core.natural_emotion_analyzer:134]: [情绪分析] 本地匹配: (微微叹气,露出无奈的笑容)艾洛发现你好像只会说"你好"呢…... → happy
    [2026-03-11 20:18:17.636] [Plug] [INFO] [astrbot_plugin_stealer.main:1179]: [Stealer] 智能分析结果: happy
    [2026-03-11 20:18:17.638] [Plug] [DBUG] [core.emoji_selector:751]: 表情包自动发送概率检查未通过 (0.3), 未触发图片发送
    [2026-03-11 20:18:17.785] [Core] [DBUG] [aiocqhttp.aiocqhttp_platform_adapter:129]: [aiocqhttp] RawMessage <Event, {'self_id': 4443008, 'user_id': 1515330700, 'time': 1773231496, 'message_id': 258135260, 'message_seq': 258135260, 'real_id': 258135260, 'real_seq': '2147026', 'message_type': 'group', 'sender': {'user_id': 1515330700, 'nickname': '倉田ましろ', 'card': '😈😈菌子之恶魔😈😈', 'role': 'admin'}, 'raw_message': '[CQ:video,file=9c3d1db08bdb8167ff84dba6c2659c6d.mp4,url=https://multimedia.nt.qq.com.cn/download?appid=1415&amp;format=origin&amp;orgfmt=t264&amp;spec=0&amp;rkey=CAQSoAFPYmnGrgKiopXBKyoSLMNr01hfxisO78ypeltPaGBPhdAQDvbOKTvrq67ueFhio-cBFFRtX1tUMOjZ2UAH8AXivJKwr3cWQVW0LdlUKSZdNE0AF6qOmudwaf4CQtvK7-I-XkarG5MXg9Q5Ioe8kUR_zxrFcykTDTa-Zm773AcoZSVEPyRK6sjD7G47JfUWbdKMjWfILzh7hc9BF7oj752f,file_size=3065223]', 'font': 14, 'sub_type': 'normal', 'message': [{'type': 'video', 'data': {'file': '9c3d1db08bdb8167ff84dba6c2659c6d.mp4', 'url': 'https://multimedia.nt.qq.com.cn/download?appid=1415&format=origin&orgfmt=t264&spec=0&rkey=CAQSoAFPYmnGrgKiopXBKyoSLMNr01hfxisO78ypeltPaGBPhdAQDvbOKTvrq67ueFhio-cBFFRtX1tUMOjZ2UAH8AXivJKwr3cWQVW0LdlUKSZdNE0AF6qOmudwaf4CQtvK7-I-XkarG5MXg9Q5Ioe8kUR_zxrFcykTDTa-Zm773AcoZSVEPyRK6sjD7G47JfUWbdKMjWfILzh7hc9BF7oj752f', 'file_size': '3065223'}}], 'message_format': 'array', 'post_type': 'message', 'group_id': 825375018, 'group_name': 'A群的小子'}>
    

    deepseek第三方的api没问题

  14. madoka-chann commented on Mar 11, 2026

    @madoka-chann
    Author

    kimi应该也没问题?你可以用iflow的模型自己试试

  15. whatevertogo commented on Mar 11, 2026

    @whatevertogo
    Contributor

    Σ( ° △ °|||)︴应该是你调用知识库工具调出来的东西损坏了?

  16. madoka-chann commented on Mar 11, 2026

    @madoka-chann
    Author
  17. zhengchalei commented on Mar 12, 2026

    @zhengchalei

    自我进化 (Self-Evolution) 你看看是不是这个插件的问题。 我停用了就正常了

  18. whatevertogo commented on Mar 12, 2026

    @whatevertogo
    Contributor

    可能是的,调用数据库里面的信息不知道为什么混入了空格,请你向插件方提issue,这个插件维护者很好的,也是astrbot的维护者之一,关于这个issue你可以跟他讲一讲,他应该比我更懂这一块

  19. madoka-chann commented on Mar 12, 2026

    @madoka-chann
    Author
  20. madoka-chann commented on Mar 12, 2026

    @madoka-chann
    Author
  21. ForceofwiII commented on Mar 15, 2026

    @ForceofwiII

    使用openai兼容api时出现相同问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions