AstrBot icon indicating copy to clipboard operation
AstrBot copied to clipboard

[Bug] 在越来越多的群里发消息的人在日志中会被认作是unkown

Open TheAutomatic opened this issue 1 year ago • 6 comments

发生了什么

不清楚是gewe的问题还是bot的问题,微信如果不艾特机器人的话(监听触发机器人或者用/触发),日志里说话人的名字会变成unknown。开始在一个群里出现,现在越来越多的群里都出现了

如何复现?

开始是玩牛牛插件发现的,所有人注册牛牛都会叫unkown,开始以为是牛牛插件的问题,后面感觉好像是bot的问题,因为就算不触发牛牛,我在日志里看,群友聊天的昵称也是unknown,虽然后面的微信id是正确的。除非你艾特机器人,突然昵称就对了。

AstrBot 版本与部署方式

群晖Docker部署v3.4.26

操作系统

Other

额外信息

Image

你愿意提交 PR 吗?

  • [x] 是的,我愿意提交 PR!

Code of Conduct

  • [x] 我已阅读并同意遵守该项目的 行为准则。

TheAutomatic avatar Feb 13 '25 12:02 TheAutomatic

请问可以提供类似

Image

这样的 debug 日志吗?

Soulter avatar Feb 13 '25 16:02 Soulter

这个是用/的,名字识别不对 [09:20:31| INFO] [event_bus.py:21]: [gewechat] unknown/wxidrs22: /困了 [09:20:31| DEBUG] [scheduler.py:22]: 执行阶段 WakingCheckStage [09:20:31| DEBUG] [scheduler.py:22]: 执行阶段 WhitelistCheckStage [09:20:31| DEBUG] [scheduler.py:22]: 执行阶段 RateLimitStage [09:20:31| DEBUG] [scheduler.py:22]: 执行阶段 ContentSafetyCheckStage [09:20:31| DEBUG] [scheduler.py:22]: 执行阶段 PreProcessStage [09:20:31| DEBUG] [scheduler.py:22]: 执行阶段 ProcessStage [09:20:31| DEBUG] [star_request.py:34]: 执行插件 handler data.plugins.astrbot_plugin_cr4zythursday.main_on_message [09:20:31| DEBUG] [star_request.py:34]: 执行插件 handler data.plugins.astrbot_plugin_essential.main_handle_search_anime [09:20:31| DEBUG] [scheduler.py:22]: 执行阶段 ResultDecorateStage [09:20:31| DEBUG] [scheduler.py:22]: 执行阶段 RespondStage [09:20:31| DEBUG] [star_request.py:34]: 执行插件 handler data.plugins.astrbot_plugin_niuniu.main_on_group_message [09:20:31| DEBUG] [star_request.py:34]: 执行插件 handler packages.astrbot.main_on_message [09:20:31| DEBUG] [llm_request.py:80]: 提供商请求 Payload: ProviderRequest(prompt= [User ID: wxid_b0rs22, Nickname: unknown] 困了, session_id=4fc8c0ca-b2ca-40f1-95e4-a878fdaab200, image_urls=[], func_tool=[FuncTool(name='get_cos_pic', parameters={'type': 'object', 'properties': {'name': {'type': 'string', 'description': '获取照片的角色名'}, 'count': {'type': 'number', 'description': '获取的数量'}}}, description='获取cos图片\n', handler=functools.partial(<function MihoyoCos.get_cos_pic at 0x7f8959b2fc70>, <data.plugins.astrbot_plugin_mohoyo_cos.main.MihoyoCos object at 0x7f8959a3d960>), handler_module_path='data.plugins.astrbot_plugin_mohoyo_cos.main', active=True), FuncTool(name='python_interpreter', parameters={'type': 'object', 'properties': {}}, description='Use this tool only if user really want to solve a complex problem and the problem can be solved very well by Python code. \nFor example, user can use this tool to solve math problems, edit image, docx, pptx, pdf, etc.', handler=functools.partial(<function Main.python_interpreter at 0x7f8959848040>, <packages.python_interpreter.main.Main object at 0x7f8959a3ded0>), handler_module_path='packages.python_interpreter.main', active=False), FuncTool(name='reminder', parameters={'type': 'object', 'properties': {'text': {'type': 'string', 'description': 'Must Required. The content of the reminder.'}, 'datetime_str': {'type': 'string', 'description': "Required when user's reminder is a single reminder. The datetime string of the reminder, Must format with %Y-%m-%d %H:%M"}, 'cron_expression': {'type': 'string', 'description': "Required when user's reminder is a repeated reminder. The cron expression of the reminder."}, 'human_readable_cron': {'type': 'string', 'description': 'Optional. The human readable cron expression of the reminder.'}}}, description='Call this function when user is asking for setting a reminder.\n', handler=functools.partial(<function Main.reminder_tool at 0x7f89598c8790>, <packages.reminder.main.Main object at 0x7f8959bdbe50>), handler_module_path='packages.reminder.main', active=True), FuncTool(name='web_search', parameters={'type': 'object', 'properties': {'query': {'type': 'string', 'description': "A search query which will be used to fetch the most relevant snippets regarding the user's query"}}}, description="Search the web for answers to the user's query\n", handler=functools.partial(<function Main.search_from_search_engine at 0x7f8958da0ee0>, <packages.web_searcher.main.Main object at 0x7f89599b1450>), handler_module_path='packages.web_searcher.main', active=True), FuncTool(name='fetch_url', parameters={'type': 'object', 'properties': {'url': {'type': 'string', 'description': 'The url of the website to fetch content from'}}}, description='fetch the content of a website with the given web url\n', handler=functools.partial(<function Main.fetch_website_content at 0x7f8958da0f70>, <packages.web_searcher.main.Main object at 0x7f89599b1450>), handler_module_path='packages.web_searcher.main', active=True)], contexts=[], system_prompt= Current datetime: 2025-02-14 09:20 你的默认对话语言是中文。请使用纯文本回答,不要使用任何 Markdown 格式(如星号、加粗、斜体、标题、代码块等)。) [09:20:31| DEBUG] [gemini_source.py:143]: google_genai_conversation: [{'role': 'user', 'parts': [{'text': '\n[User ID: wxid_b0s22, Nickname: unknown]\n困了'}]}] [09:20:31| DEBUG] [gemini_source.py:48]: payload: {'system_instruction': {'parts': {'text': '\nCurrent datetime: 2025-02-14 09:20\n你的默认对话语言是中文。请使用纯文本回答,不要使用任何 Markdown 格式(如星号、加粗、斜体、标题、代码块等)。'}}, 'tools': [{'function_declarations': [{'name': 'get_cos_pic', 'description': '获取cos图片\n', 'parameters': {'type': 'object', 'properties': {'name': {'type': 'string', 'description': '获取照片的角色名'}, 'count': {'type': 'number', 'description': '获取的数量'}}}}, {'name': 'reminder', 'description': 'Call this function when user is asking for setting a reminder.\n', 'parameters': {'type': 'object', 'properties': {'text': {'type': 'string', 'description': 'Must Required. The content of the reminder.'}, 'datetime_str': {'type': 'string', 'description': "Required when user's reminder is a single reminder. The datetime string of the reminder, Must format with %Y-%m-%d %H:%M"}, 'cron_expression': {'type': 'string', 'description': "Required when user's reminder is a repeated reminder. The cron expression of the reminder."}, 'human_readable_cron': {'type': 'string', 'description': 'Optional. The human readable cron expression of the reminder.'}}}}, {'name': 'web_search', 'description': "Search the web for answers to the user's query\n", 'parameters': {'type': 'object', 'properties': {'query': {'type': 'string', 'description': "A search query which will be used to fetch the most relevant snippets regarding the user's query"}}}}, {'name': 'fetch_url', 'description': 'fetch the content of a website with the given web url\n', 'parameters': {'type': 'object', 'properties': {'url': {'type': 'string', 'description': 'The url of the website to fetch content from'}}}}]}], 'contents': [{'role': 'user', 'parts': [{'text': '\n[User ID: wxid_b0m22, Nickname: unknown]\n困了'}]}]} [09:20:32| DEBUG] [gemini_source.py:151]: result: {'candidates': [{'content': {'parts': [{'text': '要不要我帮你设置一个提醒,稍后提醒你休息一下?\n'}], 'role': 'model'}, 'finishReason': 'STOP', 'avgLogprobs': -0.3737712224324544}], 'usageMetadata': {'promptTokenCount': 256, 'candidatesTokenCount': 15, 'totalTokenCount': 271, 'promptTokensDetails': [{'modality': 'TEXT', 'tokenCount': 256}], 'candidatesTokensDetails': [{'modality': 'TEXT', 'tokenCount': 15}]}, 'modelVersion': 'gemini-2.0-flash'} [09:20:33| DEBUG] [scheduler.py:22]: 执行阶段 ResultDecorateStage [09:20:33| DEBUG] [scheduler.py:22]: 执行阶段 RespondStage [09:20:33| ERROR] [gewechat_event.py:137]: gewechat 暂不支持发送消息类型: Reply [09:20:33| DEBUG] [client.py:332]: 发送消息结果: {'ret': 200, 'msg': '操作成功', 'data': {'toWxid': '21356084455@chatroom', 'createTime': 1739496033, 'msgId': 0, 'newMsgId': 4000401746643784214, 'type': 1}} [09:20:34| INFO] [stage.py:71]: AstrBot -> unknown/wxrs22: [Reply]要不要我帮你设置一个提醒,稍后提醒你休息一下?

TheAutomatic avatar Feb 14 '25 01:02 TheAutomatic

这个是用了艾特的,名字识别正常 [09:21:27| INFO] [event_bus.py:21]: [gewechat] 阿超/wxid_79tzgq222: [At:wxid_wi22]泥豪 [09:21:27| DEBUG] [scheduler.py:22]: 执行阶段 WakingCheckStage [09:21:27| DEBUG] [scheduler.py:22]: 执行阶段 WhitelistCheckStage [09:21:27| DEBUG] [scheduler.py:22]: 执行阶段 RateLimitStage [09:21:27| DEBUG] [scheduler.py:22]: 执行阶段 ContentSafetyCheckStage [09:21:27| DEBUG] [scheduler.py:22]: 执行阶段 PreProcessStage [09:21:27| DEBUG] [scheduler.py:22]: 执行阶段 ProcessStage [09:21:27| DEBUG] [star_request.py:34]: 执行插件 handler data.plugins.astrbot_plugin_cr4zythursday.main_on_message [09:21:27| DEBUG] [star_request.py:34]: 执行插件 handler data.plugins.astrbot_plugin_essential.main_handle_search_anime [09:21:27| DEBUG] [scheduler.py:22]: 执行阶段 ResultDecorateStage [09:21:27| DEBUG] [scheduler.py:22]: 执行阶段 RespondStage [09:21:27| DEBUG] [star_request.py:34]: 执行插件 handler data.plugins.astrbot_plugin_niuniu.main_on_group_message [09:21:27| DEBUG] [star_request.py:34]: 执行插件 handler packages.astrbot.main_on_message [09:21:27| DEBUG] [llm_request.py:80]: 提供商请求 Payload: ProviderRequest(prompt= [User ID: wxid_79222, Nickname: 阿超] 泥豪, session_id=343f72cd-94fe-4b5f-b1e4-0eb7ac0e29e3, image_urls=[], func_tool=[FuncTool(name='get_cos_pic', parameters={'type': 'object', 'properties': {'name': {'type': 'string', 'description': '获取照片的角色名'}, 'count': {'type': 'number', 'description': '获取的数量'}}}, description='获取cos图片\n', handler=functools.partial(<function MihoyoCos.get_cos_pic at 0x7f8959b2fc70>, <data.plugins.astrbot_plugin_mohoyo_cos.main.MihoyoCos object at 0x7f8959a3d960>), handler_module_path='data.plugins.astrbot_plugin_mohoyo_cos.main', active=True), FuncTool(name='python_interpreter', parameters={'type': 'object', 'properties': {}}, description='Use this tool only if user really want to solve a complex problem and the problem can be solved very well by Python code. \nFor example, user can use this tool to solve math problems, edit image, docx, pptx, pdf, etc.', handler=functools.partial(<function Main.python_interpreter at 0x7f8959848040>, <packages.python_interpreter.main.Main object at 0x7f8959a3ded0>), handler_module_path='packages.python_interpreter.main', active=False), FuncTool(name='reminder', parameters={'type': 'object', 'properties': {'text': {'type': 'string', 'description': 'Must Required. The content of the reminder.'}, 'datetime_str': {'type': 'string', 'description': "Required when user's reminder is a single reminder. The datetime string of the reminder, Must format with %Y-%m-%d %H:%M"}, 'cron_expression': {'type': 'string', 'description': "Required when user's reminder is a repeated reminder. The cron expression of the reminder."}, 'human_readable_cron': {'type': 'string', 'description': 'Optional. The human readable cron expression of the reminder.'}}}, description='Call this function when user is asking for setting a reminder.\n', handler=functools.partial(<function Main.reminder_tool at 0x7f89598c8790>, <packages.reminder.main.Main object at 0x7f8959bdbe50>), handler_module_path='packages.reminder.main', active=True), FuncTool(name='web_search', parameters={'type': 'object', 'properties': {'query': {'type': 'string', 'description': "A search query which will be used to fetch the most relevant snippets regarding the user's query"}}}, description="Search the web for answers to the user's query\n", handler=functools.partial(<function Main.search_from_search_engine at 0x7f8958da0ee0>, <packages.web_searcher.main.Main object at 0x7f89599b1450>), handler_module_path='packages.web_searcher.main', active=True), FuncTool(name='fetch_url', parameters={'type': 'object', 'properties': {'url': {'type': 'string', 'description': 'The url of the website to fetch content from'}}}, description='fetch the content of a website with the given web url\n', handler=functools.partial(<function Main.fetch_website_content at 0x7f8958da0f70>, <packages.web_searcher.main.Main object at 0x7f89599b1450>), handler_module_path='packages.web_searcher.main', active=True)], contexts=[{'role': 'user', 'content': '\n[User ID: liuyizhip, Nickname: ᅟᅠ]\n你聪明个鸡儿'}, {'role': 'assistant', 'content': '我是一个大型语言模型,由 Google 训练。'}], system_prompt= Current datetime: 2025-02-14 09:21 你的默认对话语言是中文。请使用纯文本回答,不要使用任何 Markdown 格式(如星号、加粗、斜体、标题、代码块等)。) [09:21:27| DEBUG] [gemini_source.py:143]: google_genai_conversation: [{'role': 'user', 'parts': [{'text': '\n[User ID: liuyizhip, Nickname: ᅟᅠ]\n你聪明个鸡儿'}]}, {'role': 'model', 'parts': [{'text': '我是一个大型语言模型,由 Google 训练。'}]}, {'role': 'user', 'parts': [{'text': '\n[User ID: wxid_7q222, Nickname: 阿超]\n泥豪'}]}] [09:21:27| DEBUG] [gemini_source.py:48]: payload: {'system_instruction': {'parts': {'text': '\nCurrent datetime: 2025-02-14 09:21\n你的默认对话语言是中文。请使用纯文本回答,不要使用任何 Markdown 格式(如星号、加粗、斜体、标题、代码块等)。'}}, 'tools': [{'function_declarations': [{'name': 'get_cos_pic', 'description': '获取cos图片\n', 'parameters': {'type': 'object', 'properties': {'name': {'type': 'string', 'description': '获取照片的角色名'}, 'count': {'type': 'number', 'description': '获取的数量'}}}}, {'name': 'reminder', 'description': 'Call this function when user is asking for setting a reminder.\n', 'parameters': {'type': 'object', 'properties': {'text': {'type': 'string', 'description': 'Must Required. The content of the reminder.'}, 'datetime_str': {'type': 'string', 'description': "Required when user's reminder is a single reminder. The datetime string of the reminder, Must format with %Y-%m-%d %H:%M"}, 'cron_expression': {'type': 'string', 'description': "Required when user's reminder is a repeated reminder. The cron expression of the reminder."}, 'human_readable_cron': {'type': 'string', 'description': 'Optional. The human readable cron expression of the reminder.'}}}}, {'name': 'web_search', 'description': "Search the web for answers to the user's query\n", 'parameters': {'type': 'object', 'properties': {'query': {'type': 'string', 'description': "A search query which will be used to fetch the most relevant snippets regarding the user's query"}}}}, {'name': 'fetch_url', 'description': 'fetch the content of a website with the given web url\n', 'parameters': {'type': 'object', 'properties': {'url': {'type': 'string', 'description': 'The url of the website to fetch content from'}}}}]}], 'contents': [{'role': 'user', 'parts': [{'text': '\n[User ID: liuyizhip, Nickname: ᅟᅠ]\n你聪明个鸡儿'}]}, {'role': 'model', 'parts': [{'text': '我是一个大型语言模型,由 Google 训练。'}]}, {'role': 'user', 'parts': [{'text': '\n[User ID: wxid_79tgq222, Nickname: 阿超]\n泥豪'}]}]} [09:21:29| DEBUG] [gemini_source.py:151]: result: {'candidates': [{'content': {'parts': [{'text': '你好!有什么我可以帮到你?\n'}], 'role': 'model'}, 'finishReason': 'STOP', 'avgLogprobs': -0.21539735794067383}], 'usageMetadata': {'promptTokenCount': 292, 'candidatesTokenCount': 8, 'totalTokenCount': 300, 'promptTokensDetails': [{'modality': 'TEXT', 'tokenCount': 292}], 'candidatesTokensDetails': [{'modality': 'TEXT', 'tokenCount': 8}]}, 'modelVersion': 'gemini-2.0-flash'} [09:21:30| DEBUG] [scheduler.py:22]: 执行阶段 ResultDecorateStage [09:21:30| DEBUG] [scheduler.py:22]: 执行阶段 RespondStage [09:21:30| ERROR] [gewechat_event.py:137]: gewechat 暂不支持发送消息类型: Reply [09:21:30| DEBUG] [client.py:332]: 发送消息结果: {'ret': 200, 'msg': '操作成功', 'data': {'toWxid': '20364447643@chatroom', 'createTime': 1739496090, 'msgId': 0, 'newMsgId': 339005516518251942, 'type': 1}} [09:21:31| INFO] [stage.py:71]: AstrBot -> 阿超/wxid_7gq222: [Reply]你好!有什么我可以帮到你?

TheAutomatic avatar Feb 14 '25 01:02 TheAutomatic

这个部分是用牛牛插件的对话,日志短一点,和上一条回复的阿超是同一个微信用户,wxid都被我删了一部分 [09:25:29| INFO] [event_bus.py:21]: [gewechat] unknown/wxid_7q222: 打胶 [09:25:29| DEBUG] [scheduler.py:22]: 执行阶段 WakingCheckStage [09:25:29| DEBUG] [scheduler.py:22]: 执行阶段 WhitelistCheckStage [09:25:29| DEBUG] [scheduler.py:22]: 执行阶段 RateLimitStage [09:25:29| DEBUG] [scheduler.py:22]: 执行阶段 ContentSafetyCheckStage [09:25:29| DEBUG] [scheduler.py:22]: 执行阶段 PreProcessStage [09:25:29| DEBUG] [scheduler.py:22]: 执行阶段 ProcessStage [09:25:29| DEBUG] [star_request.py:34]: 执行插件 handler data.plugins.astrbot_plugin_cr4zythursday.main_on_message [09:25:29| DEBUG] [star_request.py:34]: 执行插件 handler data.plugins.astrbot_plugin_essential.main_handle_search_anime [09:25:29| DEBUG] [scheduler.py:22]: 执行阶段 ResultDecorateStage [09:25:29| DEBUG] [scheduler.py:22]: 执行阶段 RespondStage [09:25:29| DEBUG] [star_request.py:34]: 执行插件 handler data.plugins.astrbot_plugin_niuniu.main_on_group_message [09:25:29| DEBUG] [scheduler.py:22]: 执行阶段 ResultDecorateStage [09:25:29| DEBUG] [scheduler.py:22]: 执行阶段 RespondStage [09:25:29| ERROR] [gewechat_event.py:137]: gewechat 暂不支持发送消息类型: Reply [09:25:29| DEBUG] [client.py:332]: 发送消息结果: {'ret': 200, 'msg': '操作成功', 'data': {'toWxid': '20364447643@chatroom', 'createTime': 1739496329, 'msgId': 0, 'newMsgId': 6972007467996824648, 'type': 1}} [09:25:30| INFO] [stage.py:71]: AstrBot -> unknown/wxid_722: [Reply]unknown,你冒险打胶,没想到牛牛小宇宙爆发,增长了3cm 当前长度:1.73m

TheAutomatic avatar Feb 14 '25 01:02 TheAutomatic

我原来也有这个问题,把消息通知免打扰关上就好了

zsq213 avatar Feb 19 '25 01:02 zsq213

这个问题将在新版本被修复 v3.4.29

Soulter avatar Feb 19 '25 09:02 Soulter