perf(satori): increase websocket max message size to 10MB #4238
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix Satori WebSocket connection drops due to large message size
Add max_size parameter to websocket connection to handle larger messages and prevent connection drops when receiving large payloads from Satori platform.
修复 Satori WebSocket 因消息过大而断开连接的问题,通过增加 max_size 参数来支持接收更大的消息负载。
Motivation / 动机
修复了 Satori 适配器在接收大消息时出现的连接断开和无限重连问题。
问题描述:
当 Satori 服务器发送超过 1MB(默认限制)的 WebSocket 消息时,连接会因为
message too big错误而关闭,导致适配器陷入无限重连循环。错误日志:
Modifications / 改动点
修改文件:
astrbot/core/platform/sources/satori/satori_adapter.py具体改动:
在
connect_websocket()方法中的 WebSocket 连接调用处(第 145-149 行),为connect()函数添加了max_size参数:功能说明:
将 WebSocket 消息大小限制从默认的 1MB 提升到 10MB
允许 Satori 适配器接收更大的消息负载
防止因消息过大导致的连接断开和重连循环
This is NOT a breaking change. / 这不是一个破坏性变更。
Screenshots or Test Results / 运行截图或测试结果
修复前:
修复后:
连接稳定,不再出现
message too big错误和无限重连问题。Checklist / 检查清单
requirements.txt和pyproject.toml文件相应位置。/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations inrequirements.txtandpyproject.toml.Summary by Sourcery
Bug Fixes:
Original summary in English
Summary by Sourcery
Bug Fixes: