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
Math.min(...sources) 会把整个 sourceEventSeqs 数组一次性展开成函数参数(约 25.6 万个),超过 V8 的参数数量上限,抛出 RangeError: Maximum call stack size exceeded,而且 history 处理流程没有兜底,整个请求直接失败。正常消息的 sourceEventSeqs 只有几十到几千条,永远不会触发;但只要出现一条极端事件,整个会话历史就永久打不开。
建议修复(语义完全等价,改用循环):
if (sources !== void 0) for (const source of sources) if (source < groupStart) groupStart = source;```
本地已验证:语法通过,200 组随机用例新旧写法输出一致,25.5 万条的场景现在能正确返回最小值而不是抛错。
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.
和 #1593 是同一类问题(https://github.com/deepseek-ai/deepseek-harness/discussions/1593)——一条异常的日志事件就能让整个会话永久不可用。
环境:dsh / dsh-host-apiproxy 0.1.0-rc.6,Windows 11,Web GUI。
问题描述:某轮对话因 max-tokens 耗尽而结束(模型生成了超长的工具参数,约 25.6 万输出 token)后,这轮的 assistant/message 事件会在顶层 sourceEventSeqs 字段里记录所有流式 chunk 的序号——我们实测达到 255,939 条,单行 JSON 就 1.79MB。此后该会话的每次 session.history 请求都会失败,报错:
history unavailable for session "session-...": RangeError: Maximum call stack size exceededWeb GUI 从此永远无法加载这个会话的历史(实时对话不受影响)。
根因:位于 packages/host/apiproxy 包中(源码路径
packages/host/apiproxy/lib/index.js第 1039 行,以及它的副本packages/host/apiproxy/lib/types/api-proxy.js第 218 行),函数 paginate:const groupStart = sources !== void 0 && sources.length > 0 ? Math.min(event.seq, ...sources) : event.seq;Math.min(...sources) 会把整个 sourceEventSeqs 数组一次性展开成函数参数(约 25.6 万个),超过 V8 的参数数量上限,抛出 RangeError: Maximum call stack size exceeded,而且 history 处理流程没有兜底,整个请求直接失败。正常消息的 sourceEventSeqs 只有几十到几千条,永远不会触发;但只要出现一条极端事件,整个会话历史就永久打不开。
建议修复(语义完全等价,改用循环):
All reactions