Replies: 2 comments
|
关于修复方法需要补充说明:并不保证不会引入新的bug,请酌情使用 |
0 replies
|
超长回合把几十万 这个插件不改加载器,但可以在官方 UI 之外读这份文件:先 dsh plugin --profile web add "github:xiaoshenming/dsh-session-surgeon#main"重启 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
问题概述
在第一轮提出问题思考了五十分钟输出结果后会导致web端卡死 表现为页面无响应 刷新后页面截图如下所示:

环境
0.1.0-rc.6v22.17.0dsh webDeepSeek-V4-Pro Max标准模式分析问题
超长回合产生了约 23.9 万个流式 chunk 事件。回合结束时,整个流被物化为一条
assistant/message,其sourceEventSeqs数组记录了全部 239,280 个被替换 chunk 的序号(该条事件落盘后约 2.2 MB,其中约 1.5 MB 只是序号数字)。@deepseek-ai/dsh-host-apiproxy中历史处理的分页函数paginate()包含如下代码:将约 23.9 万个元素的数组展开为函数参数,超出了 V8 引擎的参数数量上限,从而抛出
RangeError: Maximum call stack size exceeded;historyRPC 将其作为internal错误返回给前端。trajectory 渲染器(
@deepseek-ai/dsh-client-ui-trajectory)中存在同样的写法:对随 chunk 数量增长的cells/spans/times/turns数组使用Math.min/max(...)展开。这应该是回合结束时页面卡死的原因之一——同样的展开写法作用在随 chunk 数增长的数组上,超限时渲染器同样会抛出 RangeError。具体改动
1. 服务端:历史分页(
@deepseek-ai/dsh-host-apiproxy)文件:
node_modules/@deepseek-ai/dsh-host-apiproxy/lib/index.js,paginate()函数。改动前:
改动后:
(同包的
lib/types/api-proxy.js中有一份镜像实现,做了相同修改。)2. 客户端:trajectory 渲染器(
@deepseek-ai/dsh-client-ui-trajectory)文件:
node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/client.js,共 5 处,全部改为循环求值:① 时间线各回合边界与整体起止(
spans/projected随 chunk 数增长)改动前:
改动后:
②
firstCellIndex(turn)(cells随 chunk 数增长)改动前:
改动后:
③
groupDescription的时长计算(times随 chunk 数增长)改动前:
改动后:
④
firstVisibleTurn(nodes, partial)(turns随事件数增长)改动前:
改动后:
按上文改动修补本地安装产物后:需重启dsh进程后生效。修补并重启后该异常会话可正常加载,但是较为缓慢。下图是恢复完成后agent返回的Summary:

All reactions