lss233 / chatgpt-mirai-qq-bot

🚀 一键部署!真正的 AI 聊天机器人!支持ChatGPT、文心一言、讯飞星火、Bing、Bard、ChatGLM、POE,多账号,人设调教,虚拟女仆、图片渲染、语音发送 | 支持 QQ、Telegram、Discord、微信 等平台
GNU Affero General Public License v3.0
13.34k stars 1.56k forks source link

[BUG] 发送重置会话后报错且无法再正常工作 #253

Closed Qianmo2 closed 1 year ago

Qianmo2 commented 1 year ago

提交 issue 前,请先确认:

表现
描述 BUG 的表现情况

运行环境:

复现步骤
描述你是如何触发这个 BUG 的

  1. (为chatgpt-webAI)向bot发送你好,得到了正常回复;
  2. 再向bot发送重置会话,bot回复:“会话已重置。”;
  3. 再向bot发送你好,bot回复:“出现故障,请发送”['重置会话']“重新开始!”
  4. 此后在第二步和第三步中循环。

截图
chatgpt-qq-mirai-1 | 2023-03-04 01:23:10 V/Bot.2463724346: Moki.(2657447616) -> 你好 chatgpt-qq-chatgpt-1 | 2023-03-04 01:23:10.645 | INFO | graia.ariadne.model:log:82 - 2463724346: [RECV][Moki.(2657447616)] -> 你好 chatgpt-qq-chatgpt-1 | 2023-03-04 01:23:10.650 | DEBUG | middlewares.timeout:create_timeout_task:14 - [Timeout] 开始计时…… chatgpt-qq-chatgpt-1 | 2023-03-04 01:23:10.652 | DEBUG | adapter.chatgpt.web:preset_ask:86 - [预设] 发送: chatgpt-qq-chatgpt-1 | 2023-03-04 01:23:11.137 | DEBUG | adapter.chatgpt.web:preset_ask:88 - [预设] Chatbot 回应:Hello! How can I assist you today? chatgpt-qq-chatgpt-1 | 2023-03-04 01:23:11.972 | DEBUG | middlewares.timeout:handle_respond:44 - [Timeout] 取消计时…… chatgpt-qq-mirai-1 | 2023-03-04 01:23:12 V/Bot.2463724346: Friend(2657447616) <- [mirai:quote:[mirai:source:ids=[19961], internalIds=[-861696286], from friend 2657447616 to 2463724346 at 1677892989], content=你好]你好!有什么我能帮到你的吗? chatgpt-qq-chatgpt-1 | 2023-03-04 01:23:12.672 | INFO | graia.ariadne.model:log:82 - 2463724346: [SEND][Moki.(2657447616)] <- 你好!有什么我能帮到你的吗? chatgpt-qq-chatgpt-1 | 2023-03-04 01:23:16.475 | INFO | graia.ariadne.model:log:82 - 2463724346: [RECV][Moki.(2657447616)] -> 重置会话 chatgpt-qq-chatgpt-1 | 2023-03-04 01:23:16.478 | DEBUG | middlewares.timeout:create_timeout_task:14 - [Timeout] 开始计时…… chatgpt-qq-chatgpt-1 | 2023-03-04 01:23:16.641 | DEBUG | middlewares.timeout:handle_respond:44 - [Timeout] 取消计时…… chatgpt-qq-mirai-1 | 2023-03-04 01:23:16 V/Bot.2463724346: Moki.(2657447616) -> 重置会话 chatgpt-qq-mirai-1 | 2023-03-04 01:23:17 V/Bot.2463724346: Friend(2657447616) <- [mirai:quote:[mirai:source:ids=[19962], internalIds=[-250167896], from friend 2657447616 to 2463724346 at 1677892995], content=重置会话]会话已重置。 chatgpt-qq-chatgpt-1 | 2023-03-04 01:23:17.133 | INFO | graia.ariadne.model:log:82 - 2463724346: [SEND][Moki.(2657447616)] <- 会话已重置。 chatgpt-qq-chatgpt-1 | 2023-03-04 01:23:19.392 | INFO | graia.ariadne.model:log:82 - 2463724346: [RECV][Moki.(2657447616)] -> 你好 chatgpt-qq-chatgpt-1 | 2023-03-04 01:23:19.395 | DEBUG | middlewares.timeout:create_timeout_task:14 - [Timeout] 开始计时…… chatgpt-qq-chatgpt-1 | --- Logging error --- chatgpt-qq-chatgpt-1 | 2023-03-04 01:23:19.563 | ERROR | graia.ariadne.util:loguru_exc_callback:76 - Exception: chatgpt-qq-chatgpt-1 | Traceback (most recent call last): chatgpt-qq-chatgpt-1 | chatgpt-qq-chatgpt-1 | File "/app/bot.py", line 291, in chatgpt-qq-chatgpt-1 | app.launch_blocking() chatgpt-qq-chatgpt-1 | │ └ <classmethod object at 0x7f76e62f7a00> chatgpt-qq-chatgpt-1 | └ <graia.ariadne.app.Ariadne object at 0x7f771b5f1b20> chatgpt-qq-chatgpt-1 | chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/site-packages/graia/ariadne/app.py", line 312, in launch_blocking chatgpt-qq-chatgpt-1 | cls.launch_manager.launch_blocking(loop=cls.service.loop, stop_signal=stop_signals) chatgpt-qq-chatgpt-1 | │ │ │ │ │ │ └ (<Signals.SIGINT: 2>,) chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ <property object at 0x7f76e62faf90> chatgpt-qq-chatgpt-1 | │ │ │ │ └ <graia.ariadne.service.ElizabethService object at 0x7f771b589a30> chatgpt-qq-chatgpt-1 | │ │ │ └ <class 'graia.ariadne.app.Ariadne'> chatgpt-qq-chatgpt-1 | │ │ └ <function Launart.launch_blocking at 0x7f76ec3ceb80> chatgpt-qq-chatgpt-1 | │ └ <launart.manager.Launart object at 0x7f76e55a29d0> chatgpt-qq-chatgpt-1 | └ <class 'graia.ariadne.app.Ariadne'> chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/site-packages/launart/manager.py", line 494, in launch_blocking chatgpt-qq-chatgpt-1 | loop.run_until_complete(launch_task) chatgpt-qq-chatgpt-1 | │ │ └ <Task pending name='amnesia-launch' coro=<Launart.launch() running at /usr/local/lib/python3.9/site-packages/launart/manager.... chatgpt-qq-chatgpt-1 | │ └ <function BaseEventLoop.run_until_complete at 0x7f771a2b98b0> chatgpt-qq-chatgpt-1 | └ <_UnixSelectorEventLoop running=True closed=False debug=False> chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/asyncio/base_events.py", line 634, in run_until_complete chatgpt-qq-chatgpt-1 | self.run_forever() chatgpt-qq-chatgpt-1 | │ └ <function BaseEventLoop.run_forever at 0x7f771a2b9820> chatgpt-qq-chatgpt-1 | └ <_UnixSelectorEventLoop running=True closed=False debug=False> chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/asyncio/base_events.py", line 601, in run_forever chatgpt-qq-chatgpt-1 | self._run_once() chatgpt-qq-chatgpt-1 | │ └ <function BaseEventLoop._run_once at 0x7f771a2bd3a0> chatgpt-qq-chatgpt-1 | └ <_UnixSelectorEventLoop running=True closed=False debug=False> chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1905, in _run_once chatgpt-qq-chatgpt-1 | handle._run() chatgpt-qq-chatgpt-1 | │ └ <function Handle._run at 0x7f771a2dadc0> chatgpt-qq-chatgpt-1 | └ <Handle <TaskStepMethWrapper object at 0x7f76e42c1c40>()> chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/asyncio/events.py", line 80, in _run chatgpt-qq-chatgpt-1 | self._context.run(self._callback, *self._args) chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ <member '_args' of 'Handle' objects> chatgpt-qq-chatgpt-1 | │ │ │ │ └ <Handle <TaskStepMethWrapper object at 0x7f76e42c1c40>()> chatgpt-qq-chatgpt-1 | │ │ │ └ <member '_callback' of 'Handle' objects> chatgpt-qq-chatgpt-1 | │ │ └ <Handle <TaskStepMethWrapper object at 0x7f76e42c1c40>()> chatgpt-qq-chatgpt-1 | │ └ <member '_context' of 'Handle' objects> chatgpt-qq-chatgpt-1 | └ <Handle <TaskStepMethWrapper object at 0x7f76e42c1c40>()> chatgpt-qq-chatgpt-1 | chatgpt-qq-chatgpt-1 | File "/app/bot.py", line 155, in request chatgpt-qq-chatgpt-1 | async for rendered in task: chatgpt-qq-chatgpt-1 | └ <async_generator object ConversationContext.ask at 0x7f76e42c0f70> chatgpt-qq-chatgpt-1 | chatgpt-qq-chatgpt-1 | File "/app/conversation.py", line 42, in ask chatgpt-qq-chatgpt-1 | async for item in self.adapter.ask(prompt): chatgpt-qq-chatgpt-1 | │ │ │ └ '你好' chatgpt-qq-chatgpt-1 | │ │ └ <function ChatGPTWebAdapter.ask at 0x7f76e562f4c0> chatgpt-qq-chatgpt-1 | │ └ <adapter.chatgpt.web.ChatGPTWebAdapter object at 0x7f76e4421a60> chatgpt-qq-chatgpt-1 | └ <conversation.ConversationContext object at 0x7f76e554da30> chatgpt-qq-chatgpt-1 | chatgpt-qq-chatgpt-1 | File "/app/adapter/chatgpt/web.py", line 56, in ask chatgpt-qq-chatgpt-1 | for resp in self.bot.ask(prompt, self.conversation_id, self.parent_id): chatgpt-qq-chatgpt-1 | │ │ │ │ │ │ │ └ 'd273cbd1-a5b6-4d9c-9a4f-3fd1ab48e5b0' chatgpt-qq-chatgpt-1 | │ │ │ │ │ │ └ <adapter.chatgpt.web.ChatGPTWebAdapter object at 0x7f76e4421a60> chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ '74cbd1ba-65e8-48cc-b4db-97052ca4f551' chatgpt-qq-chatgpt-1 | │ │ │ │ └ <adapter.chatgpt.web.ChatGPTWebAdapter object at 0x7f76e4421a60> chatgpt-qq-chatgpt-1 | │ │ │ └ '你好' chatgpt-qq-chatgpt-1 | │ │ └ <function ChatGPTBrowserChatbot.ask at 0x7f7718290c10> chatgpt-qq-chatgpt-1 | │ └ <chatbot.chatgpt.ChatGPTBrowserChatbot object at 0x7f76e54ed550 [locked]> chatgpt-qq-chatgpt-1 | └ <adapter.chatgpt.web.ChatGPTWebAdapter object at 0x7f76e4421a60> chatgpt-qq-chatgpt-1 | chatgpt-qq-chatgpt-1 | File "/app/chatbot/chatgpt.py", line 57, in ask chatgpt-qq-chatgpt-1 | for r in resp: chatgpt-qq-chatgpt-1 | └ <generator object Chatbot.ask at 0x7f76e42ca270> chatgpt-qq-chatgpt-1 | chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/site-packages/revChatGPT/V1.py", line 503, in ask chatgpt-qq-chatgpt-1 | log.error("Field missing", exc_info=True) chatgpt-qq-chatgpt-1 | │ └ <function Logger.error at 0x7f771a9ef040> chatgpt-qq-chatgpt-1 | └ <Logger revChatGPT.V1 (WARNING)> chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/logging/init.py", line 1475, in error chatgpt-qq-chatgpt-1 | self._log(ERROR, msg, args, *kwargs) chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ {'exc_info': True} chatgpt-qq-chatgpt-1 | │ │ │ │ └ () chatgpt-qq-chatgpt-1 | │ │ │ └ 'Field missing' chatgpt-qq-chatgpt-1 | │ │ └ 40 chatgpt-qq-chatgpt-1 | │ └ <function Logger._log at 0x7f771a9ef3a0> chatgpt-qq-chatgpt-1 | └ <Logger revChatGPT.V1 (WARNING)> chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/logging/init.py", line 1589, in _log chatgpt-qq-chatgpt-1 | self.handle(record) chatgpt-qq-chatgpt-1 | │ │ └ <LogRecord: revChatGPT.V1, 40, /usr/local/lib/python3.9/site-packages/revChatGPT/V1.py, 503, "Field missing"> chatgpt-qq-chatgpt-1 | │ └ <function Logger.handle at 0x7f771a9ef430> chatgpt-qq-chatgpt-1 | └ <Logger revChatGPT.V1 (WARNING)> chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/logging/init.py", line 1599, in handle chatgpt-qq-chatgpt-1 | self.callHandlers(record) chatgpt-qq-chatgpt-1 | │ │ └ <LogRecord: revChatGPT.V1, 40, /usr/local/lib/python3.9/site-packages/revChatGPT/V1.py, 503, "Field missing"> chatgpt-qq-chatgpt-1 | │ └ <function Logger.callHandlers at 0x7f771a9ef670> chatgpt-qq-chatgpt-1 | └ <Logger revChatGPT.V1 (WARNING)> chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/logging/init.py", line 1661, in callHandlers chatgpt-qq-chatgpt-1 | hdlr.handle(record) chatgpt-qq-chatgpt-1 | │ │ └ <LogRecord: revChatGPT.V1, 40, /usr/local/lib/python3.9/site-packages/revChatGPT/V1.py, 503, "Field missing"> chatgpt-qq-chatgpt-1 | │ └ <function Handler.handle at 0x7f771aa80af0> chatgpt-qq-chatgpt-1 | └ <StreamHandler (NOTSET)> chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/logging/init.py", line 952, in handle chatgpt-qq-chatgpt-1 | self.emit(record) chatgpt-qq-chatgpt-1 | │ │ └ <LogRecord: revChatGPT.V1, 40, /usr/local/lib/python3.9/site-packages/revChatGPT/V1.py, 503, "Field missing"> chatgpt-qq-chatgpt-1 | │ └ <function StreamHandler.emit at 0x7f771aa80f70> chatgpt-qq-chatgpt-1 | └ <StreamHandler (NOTSET)> chatgpt-qq-chatgpt-1 | > File "/usr/local/lib/python3.9/logging/init.py", line 1083, in emit chatgpt-qq-chatgpt-1 | msg = self.format(record) chatgpt-qq-chatgpt-1 | │ │ └ <LogRecord: revChatGPT.V1, 40, /usr/local/lib/python3.9/site-packages/revChatGPT/V1.py, 503, "Field missing"> chatgpt-qq-chatgpt-1 | │ └ <function Handler.format at 0x7f771aa809d0> chatgpt-qq-chatgpt-1 | └ <StreamHandler (NOTSET)> chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/logging/init.py", line 927, in format chatgpt-qq-chatgpt-1 | return fmt.format(record) chatgpt-qq-chatgpt-1 | │ │ └ <LogRecord: revChatGPT.V1, 40, /usr/local/lib/python3.9/site-packages/revChatGPT/V1.py, 503, "Field missing"> chatgpt-qq-chatgpt-1 | │ └ <function Formatter.format at 0x7f771aa7dd30> chatgpt-qq-chatgpt-1 | └ <logging.Formatter object at 0x7f7719e3f3d0> chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/logging/init.py", line 671, in format chatgpt-qq-chatgpt-1 | record.exc_text = self.formatException(record.exc_info) chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ (None, None, None) chatgpt-qq-chatgpt-1 | │ │ │ │ └ <LogRecord: revChatGPT.V1, 40, /usr/local/lib/python3.9/site-packages/revChatGPT/V1.py, 503, "Field missing"> chatgpt-qq-chatgpt-1 | │ │ │ └ <function Formatter.formatException at 0x7f771aa7daf0> chatgpt-qq-chatgpt-1 | │ │ └ <logging.Formatter object at 0x7f7719e3f3d0> chatgpt-qq-chatgpt-1 | │ └ None chatgpt-qq-chatgpt-1 | └ <LogRecord: revChatGPT.V1, 40, /usr/local/lib/python3.9/site-packages/revChatGPT/V1.py, 503, "Field missing"> chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/logging/init.py", line 621, in formatException chatgpt-qq-chatgpt-1 | traceback.print_exception(ei[0], ei[1], tb, None, sio) chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ <_io.StringIO object at 0x7f76e42dc040> chatgpt-qq-chatgpt-1 | │ │ │ │ └ None chatgpt-qq-chatgpt-1 | │ │ │ └ (None, None, None) chatgpt-qq-chatgpt-1 | │ │ └ (None, None, None) chatgpt-qq-chatgpt-1 | │ └ <function loguru_exc_callback at 0x7f76ec332550> chatgpt-qq-chatgpt-1 | └ <module 'traceback' from '/usr/local/lib/python3.9/traceback.py'> chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/site-packages/graia/ariadne/util/init.py", line 75, in loguru_exc_callback chatgpt-qq-chatgpt-1 | if not issubclass(cls, (ExecutionStop, PropagationCancelled)): chatgpt-qq-chatgpt-1 | │ │ └ <class 'graia.broadcast.exceptions.PropagationCancelled'> chatgpt-qq-chatgpt-1 | │ └ <class 'graia.broadcast.exceptions.ExecutionStop'> chatgpt-qq-chatgpt-1 | └ None chatgpt-qq-chatgpt-1 | chatgpt-qq-chatgpt-1 | TypeError: issubclass() arg 1 must be a class chatgpt-qq-chatgpt-1 | Call stack: chatgpt-qq-chatgpt-1 | File "/app/bot.py", line 291, in chatgpt-qq-chatgpt-1 | app.launch_blocking() chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/site-packages/graia/ariadne/app.py", line 312, in launch_blocking chatgpt-qq-chatgpt-1 | cls.launch_manager.launch_blocking(loop=cls.service.loop, stop_signal=stop_signals) chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/site-packages/launart/manager.py", line 494, in launch_blocking chatgpt-qq-chatgpt-1 | loop.run_until_complete(launch_task) chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/asyncio/base_events.py", line 634, in run_until_complete chatgpt-qq-chatgpt-1 | self.run_forever() chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/asyncio/base_events.py", line 601, in run_forever chatgpt-qq-chatgpt-1 | self._run_once() chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1905, in _run_once chatgpt-qq-chatgpt-1 | handle._run() chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/asyncio/events.py", line 80, in _run chatgpt-qq-chatgpt-1 | self._context.run(self._callback, self._args) chatgpt-qq-chatgpt-1 | File "/app/bot.py", line 155, in request chatgpt-qq-chatgpt-1 | async for rendered in task: chatgpt-qq-chatgpt-1 | File "/app/conversation.py", line 42, in ask chatgpt-qq-chatgpt-1 | async for item in self.adapter.ask(prompt): chatgpt-qq-chatgpt-1 | File "/app/adapter/chatgpt/web.py", line 56, in ask chatgpt-qq-chatgpt-1 | for resp in self.bot.ask(prompt, self.conversation_id, self.parent_id): chatgpt-qq-chatgpt-1 | File "/app/chatbot/chatgpt.py", line 57, in ask chatgpt-qq-chatgpt-1 | for r in resp: chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/site-packages/revChatGPT/V1.py", line 503, in ask chatgpt-qq-chatgpt-1 | log.error("Field missing", exc_info=True) chatgpt-qq-chatgpt-1 | Message: 'Field missing' chatgpt-qq-chatgpt-1 | Arguments: () chatgpt-qq-chatgpt-1 | 2023-03-04 01:23:19.585 | DEBUG | middlewares.timeout:handle_respond:44 - [Timeout] 取消计时…… chatgpt-qq-mirai-1 | 2023-03-04 01:23:19 V/Bot.2463724346: Moki.(2657447616) -> 你好 chatgpt-qq-mirai-1 | 2023-03-04 01:23:20 V/Bot.2463724346: Friend(2657447616) <- [mirai:quote:[mirai:source:ids=[19963], internalIds=[1852872382], from friend 2657447616 to 2463724346 at 1677892998], content=你好]出现故障,请发送”['重置会话']“重新开始! chatgpt-qq-chatgpt-1 | 2023-03-04 01:23:20.125 | INFO | graia.ariadne.model:log:82 - 2463724346: [SEND][Moki.(2657447616)] <- 出现故障,请发送”['重置会话']“重新开始! chatgpt-qq-chatgpt-1 | 2023-03-04 01:23:24.306 | INFO | graia.ariadne.model:log:82 - 2463724346: [RECV][Moki.(2657447616)] -> 重置会话

其他内容
此处填写其他内容,没有可跳过

lss233 commented 1 year ago

v2.0.1 已修复