You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
环境:dsh
0.1.6-alpha.1(npm 安装,web profile),Linux,dsh web监听 127.0.0.1:3080,前面有个自己写的 Python 反代提供局域网 https 入口;客户端是手机浏览器,走 WiFi 连内网。会话都是日常在用的,几百条事件,不算长。现象:手机信号抖一下、页面断线重连之后,再点进之前那个还在跑任务的会话,就停在「载入历史…」,等多久都一样。刷新无效。等网络稳定重新进去,同一个会话能正常打开。
先怀疑的是反代,毕竟是自己写的。所以用 ws 客户端直连 127.0.0.1:3080 的
/api/remote.mux,发一条session/follow(address.kind=session、maxMessages: 50、assistantStream: true),量首帧到底多大:服务端一百毫秒以内就把数据准备好了,慢的是把它发出去。同一批会话直连和走反代各测一次,首帧大小、到达时间基本一致,反代可以排除。单条最大的记录是
assistant/message,1.07 MB,里面带着完整的 reasoning 流。从代码看,
session/follow打开时先发一个大快照帧(packages/api/session-controller的SessionHistoryController.follow(),type: 'snapshot'),把整个窗口的 records 一次性带走,之后才逐条推增量。maxMessages: 50限的是消息条数,一条 assistant 消息里包含大量流式 chunk,展开后是几百个事件、好几 MB。断线重连会把这件事放大。客户端拿到新 generation 直接 publish
replace,等于首帧从头再拉一遍。4 到 9 MB 在 1 Mbps 链路上要 30 到 140 秒,中途再断一次就回到起点。前端这边Session.doOpen()只有open和error两个出口,error只在isRemoteFailure(error)成立时才设置,所以一直等不到首帧就一直是loading,没有超时也没有提示。另外观察到一点,重连时所有还开着的会话都会重拉一遍完整快照。我这边同时开着几个,加起来几十 MB 一次性涌过来,弱网下基本没戏。
讨论区里相关的帖:#6950 报的是大会话全量传输(22.5 MB / 4.2 万事件);#6092 是 mux 心跳误杀健康连接导致重连循环;#6954、#6921 报的同样是停在 Loading history、但根因不同的另外两种。我这边的情况是几百条事件的日常会话就已经 4 MB 以上,比 #6950 出现得更早。
版本我核对过,
0.1.6-alpha.2和 master 当前代码跟上面描述一致。谢谢。
All reactions