If you don't use it continuously, it will bug!?
If you run a script, interact with the bot And you haven't responded for a long time, like 30 minutes.
If you type to chat with the bot again in the same script, the bot will not respond.
And you have to run the script again.
How to fix?
If you run a script, interact with the bot And you haven't responded for a long time, like 30 minutes.
If you type to chat with the bot again in the same script, the bot will not respond.
And you have to run the script again.
How to fix?
are you deployed it somewhere or it just local development?
In my computer and vps
Hello,
I believe this problem might come from the websockets disconnecting. They need to be automatically reconnected I believe. I will investigate the issue.
Cheers
Okie thank you
Hello again,
Does anything happen? Do you get any kind of error or message, or does it silently stop? I believe https://github.com/realcoloride/node_characterai/issues/180#issuecomment-2581520347 has encountered the same issue.
Quoting:
Only noticable issue is that every few hours, it seems to stop working with CAI. I've tried both sending a message to a CAI bot to keep the account "active" every 3HRs and simply re-authing every 1.5HRs, but neither seems to have worked so far. I don't think its an issue with your code- I just need to figure out the nuances of CAI's(what I assume is) account inactivity disconnection.
Cheers
The bot will not respond back and will not throw an error.
i think websockets disconnecting.
Could you measure after how much time?
On Tue, Jun 24, 2025, 10:01 💖 0xmai. @.***> wrote:
KhunChaiyakorn left a comment (realcoloride/node_characterai#209) https://github.com/realcoloride/node_characterai/issues/209#issuecomment-2999244776
The bot will not respond back and will not throw an error.
i think websockets disconnecting.
image.png (view on web) https://github.com/user-attachments/assets/cf8c6b80-e2ca-40ef-8e27-99992a8f8c8d
— Reply to this email directly, view it on GitHub https://github.com/realcoloride/node_characterai/issues/209#issuecomment-2999244776, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZ4WO5N3NB4XXB2QDC4372L3FEAXFAVCNFSM6AAAAAB74VX7I6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSOJZGI2DINZXGY . You are receiving this because you commented.Message ID: @.***>
2 hours Up.
Hello again,
I'll investigate then.
Cheers
Hello there, I cannot seem to properly reproduce this. However I'm willing to make a patch that will automatically reconnect the websocket if needed.
I seem to be running into this issue as well, using 2.0. I don't know how much time passes before the failure happens (I would guess 1+ hours), but I notice in my logs it happens when an await to sendMessage is attempted. No error is thrown. The promise simply hangs and never resolves.
To mitigate the issue, I am restarting my docker container every 30 minutes with cron.
ดูเหมือนฉันจะเจอปัญหานี้เหมือนกัน ฉันใช้เวอร์ชัน 2.0 ฉันไม่รู้ว่าต้องใช้เวลานานแค่ไหนกว่าจะเกิดข้อผิดพลาด (เดาว่าน่าจะมากกว่า 1 ชั่วโมง) แต่ในบันทึกของฉัน ปัญหานี้เกิดขึ้นเมื่อพยายามป้อนคำสั่ง
awaittosendMessageไม่มีข้อผิดพลาดเกิดขึ้น Promise ค้างและไม่สามารถแก้ปัญหาได้เพื่อบรรเทาปัญหา ฉันจึงรีสตาร์ทคอนเทนเนอร์ Docker ทุกๆ 30 นาทีด้วย cron
it work?
To mitigate the issue, I am restarting my docker container every 30 minutes with cron.
I will add a patch to automatically connect the websockets just in case.
Hello there, after examination the problem comes from the fact the websocket gets disconnected and that the websocket isn't reconnected automatically. I will look further into solving the issue - but it requires resynchronization of the current states and everything to be refetched, which will need memory optimization.
Cheers
Hello, I made the following commit to fix the issue: https://github.com/realcoloride/node_characterai/commit/d200dff4ab71da12976cdda26b0ef874140147a9
I will do testing and QA and publish when done.
ok i can try next day. thank you <3