Closed mwnu closed 2 months ago
This error can be safely ignored.
If you stuck at bot starting, try restart it.
This error can be safely ignored.
If you stuck at bot starting, try restart it.
I've figured out where the problem lies. The format of the submission events sent from different clients is not the same. I'm not sure why, but this is a message sent from Element Android tagged with @bot, which appears as a rich text link (even though I've turned off rich text input on the mobile app). The bot does not respond to this message:
"content": {
"body": "GPT: hello - element android",
"format": "org.matrix.custom.html",
"formatted_body": "<a href=\"https://matrix.to/#/@gptbot2:xxx.xyz\">GPT</a>: hello - element android",
"msgtype": "m.text"
},
The messages I send from Element PC to @bot are normal submission events, and the bot will respond accordingly:
"content": {
"body": "GPT: hello - element desktop",
"format": "org.matrix.custom.html",
"formatted_body": "<a href=\"https://matrix.to/#/@gptbot2:xxx.xyz\">GPT</a>: hello - element desktop",
"m.mentions": {
"user_ids": [
"@gptbot2:xxx.xyz"
]
},
"msgtype": "m.text"
},
I suggest adding a customizable command (such as -gpt prompt) in addition to the @ mention to trigger replies within a thread.
Thank you for providing this debug information, i will find a solution.
Edit: i can reproduce it on my device.
Try image: hibobmaster/matrixchatgptbot:sha-b9a5884fd11246a8756a7d72baaa72efea0778b0
sha-b9a5884fd11246a8756a7d72baaa72efea0778b0
Try image:
hibobmaster/matrixchatgptbot:sha-b9a5884fd11246a8756a7d72baaa72efea0778b0
尝试镜像:hibobmaster/matrixchatgptbot:sha-b9a5884fd11246a8756a7d72baaa72efea0778b0
Success! Thank you.👏
And errors only appear in the logs after a reboot:
File and Line Numbers:
File "/app/src/main.py", line 125
: The error occurs at line 125 inmain.py
, whereasyncio.run(main())
is called to execute themain
function.File "/app/src/main.py", line 120
: At line 120 in themain
function, there is anawait sync_task
statement waiting for an asynchronous task to complete.Error Type:
asyncio.exceptions.CancelledError
: This is an exception specific toasyncio
, indicating that an asynchronous task was cancelled.Context of the Error:
sync_forever
function, where the program awaits a response (await self.run_response_callbacks([await response])
). This function is called in a loop to continuously sync data.get
method ofasyncio/queues.py
, indicating that the task was cancelled while attempting to retrieve it from a queue.Timestamps in the Log:
2024-04-24 16:04:56
.2024-04-24 16:05:02
, the log indicates "matrix chatgpt bot start.....", suggesting that despite the error, the program might be trying to restart or continue execution.Possible Causes:
CancelledError
typically results from parts of the program explicitly cancelling a task, or from tasks not being properly completed during shutdown/restart processes.Bot closed!
event (indicated byINFO - Bot closed!
in the log), initiating some cleanup process that cancels the ongoing asynchronous tasks.Handling:
CancelledError
, such as usingtry...except
blocks to catch this exception and perform necessary cleanup.