[bug] attach/resume 全量解码 chunk 致大会话 OOM/超时 — open 层 follow-up(#3797 互补) #4544
ericcaiwx-star
started this conversation in
General
Replies: 0 comments
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.
摘要 / Summary
与 #3797(
session.history分页 omit settled chunks)是同一 symptom 家族、不同层:即使 history 不再把 chunk 送进浏览器,attach / open / resume 仍可能把整段 log(含全部assistant/chunk)解码进 Host 内存,导致大会话 OOM、GC 停顿、30s unary 超时,乃至 supervisor 重启内核。本帖聚焦 open/resume 侧;传输/UI 层的 cherry-pick 修复见 #3797。
Related: #1706 #2119 #2598 #2654 #3235 #661 #3458
复现 / Repro(@linxhen-ux 生产案例)
session.jsonl.zstd94.9MB,约 819 万 chunk 事件(占 99.4%)assistant/message的data.message.content[{type:"reasoning"}],删 chunk 零内容丢失建议方向(maintainer 可拆)
dsh-session-slimmer的slimSessionText(不替代 runtime 按需读)slimSessionText invariant checklist(@linxhen-ux 整理,供 review)
范围
text-chunks/reasoning-chunks/tool-call-chunks打包行 +assistant/chunk单行),其余事件与 header 原样保留seq 重编号
oldSeq→newSeq连续重编号,输出 seq 严格 +1 递增、无空洞(内部 pass 4 校验)seq 引用重映射(5 类字段)
seqsourceEventSeqs:assistant/message的 chunk provenance → 删除(token-meter 对undefined走保守路径,实测不报错);compaction/summary的(引用 surface 节点)→ 重映射surfaceOp.start/surfaceOp.enddata.shadowedRange.start/.enddata.shadowedSeqsmapSeq抛错),绝不静默内容保留
assistant/message的data.message.content[{type:"reasoning"}]tool/call+tool/result)不动surface 等价(内核权威验证)
foldSurface对比:slim 前后 surface nodes 数量一致(98=98)帧级约束(DSH 硬性要求)
assertZstdHeaderFrame契约)\n结尾(避免 torn JSONL record)实测数据(生产环境单会话,约 900 轮对话)
Split from #3797#discussioncomment-18129856. No runtime patch in this thread yet — benchmark + invariants first. @linxhen-ux 如需补复现数据或验证随时可加。
All reactions