Replies: 1 comment
|
Confirmed — the deadlock is real, and the source shows the summary call is never bounded to the window. The summarizer sends the entire over-window surface to const messages: Message[] = [
...input.messages, // ← the whole shadowed region
createUserMessage({ content: [{ type: 'text', text: COMPACTION_INSTRUCTION }], ... }),
]
const options: GenerateOptions = { ..., messages, ... }
for await (const chunk of ctx.llm.stream(options)) assembler.push(chunk)
What makes this specific: the Note the contrast: the Your three expected-fix directions are all correct, and I'd rank them by fit to the current architecture:
One concrete edge worth pinning in a regression test: the failed Good find — this is a genuine load-bearing deadlock, and the fix belongs in |
Uh oh!
There was an error while loading. Please reload this page.
Summary
会话 surface 超过窗口后,自动压缩无法恢复——压缩要用 LLM 摘要历史,但那次摘要请求要把已经超窗的上下文塞进窗口,provider 直接报 context overflow 拒绝;失败的压缩被记为 compaction/end { error },没有 shadow 任何 surface 节点,surface 永远超窗。结果:既不能压缩(摘要调用超窗)、也不能对话(新 turn 超窗)的死锁。
Repro / Evidence
surfaceTokens=291,025 vs contextWindow=262,144(glm-5.3-flash);22 次压缩尝试,最后一次以 "error":"pi-ai detected context overflow for model "glm-5.3-flash"" 收尾;compaction/summary 与替换 user/message 从未追加,surface 不缩。
Root cause
dsh-compaction-basic 通过 ctx.llm.stream() 把当前(已超窗)surface 送给模型生成摘要 → 摘要请求本身超窗被拒 → 压缩是唯一能缩 surface 的机制,而它在超窗时跑不起来 → 死锁。
Expected
超窗时压缩应能「不先把整个 surface 喂给模型」就缩容(只摘要能塞进窗口的前缀 / 非 LLM 截断兜底 / 预留 headroom 保证摘要请求本身总能塞下)。
Impact / Workaround
会话一旦超窗就不可逆砖
Version: @deepseek-ai/dsh 0.1.1-rc.2; model glm-5.3-flash(262144)。
All reactions