Replies: 6 comments
|
你的数值分析在 master(c291e7961)成立,逐行核对如下:
即时缓解:用 附注同 #6672 一并说明:host 树禁用 compaction-basic 是预期( |
|
感谢逐行核对,两点补充:
|
|
补一条引用更正(结论不变):master 上这两个默认值已经搬过家,
数值一字未改,所以 0.8 × 1,000,000 = 800,000 > 1,000,000 − 256,000 = 744,000 的结论、以及"压力判定不吃输出预留"( 本文其他几处行号也已位移(结论不变):压力判定 |
|
再补一条引用更正(结论不变):上一条把
(各自的下一行是 另两处小修:
默认值与算式不变,仍然成立: |
|
A concrete instance of "the ratio is applied to a capacity the provider does not admit", with a second multiplier on top: in the session I measured, the window used for the ratios was 4× too small.
The model entry in In this case the wrong window made compaction fire early rather than never, so it is not a duplicate of the reserve problem — but it shows the same class of defect: the ratio is scaled against a number that is neither the provider's declared window nor the prompt capacity the provider accepts. Fixing the reserve without fixing the window still leaves the threshold anchored to the wrong capacity. Reported separately: #7213 Evidence: https://gist.github.com/gorban/4725c87390cb391047a2f14b56b98d28 |
|
同一处算式,我这台撞的是反方向:喂进算式的 capacity 比路由真实容量小一个数量级,而且那个小值是静默回退来的 —— 报大了永远不触发(这条线在讨论的),报小了会疯狂误触发并把自己夹死。补个对照读数。 这条线的形状是「比例套在 provider 不认的容量上」(窗口 1,048,576、阈值 0.8 出 838,860,而请求默认已带 256,000 输出预留,provider 先到墙)。我这台的形状:配置里这个 provider 只写了 id 和 name(手声明路由,pi-ai 自带目录里没有这一条),于是解析链 entry.contextWindow ?? base?.contextWindow ?? request.defaultContextWindow(@deepseek-ai/dsh-llm-pi-ai 0.1.5-rc.2 的 lib/index.js:670)落到内置常量 DEFAULT_CONTEXT_WINDOW = 262144(同文件 :893),而同一 baseURL 在 pi-ai 自带目录里的 8 个模型全部写着 1000000。 后果是三件事同时坏,症状看起来互不相关:
一份会话里 11 次压缩只落地 1 次,就是这三件叠出来的(逐项计数见 #6672 我补的那条)。两半合起来才是完整形状:只要喂进这些算式的 capacity 不是 provider 确认的那一个,阈值和输出预算会朝两个相反的方向坏;两边缺的是同一样东西 —— 读不到「这个数现在是多少、从哪来」。 不改装也能自查的口径:会话存档里 request/context 事件的 contextWindow 就是算式真正在用的那个值,拿它跟 provider 给的容量比,不等即命中这一类;配置侧用 dsh --profile web --dump-config 看合成后的树(它连哪一层覆盖了哪一行都打出来)。 修的方向我倾向「别静默」:手声明路由缺 capacity 时,要么启动就报错、要么至少留一条 warn,而不是回退到一个内置常量 —— 报大了只是不压缩,报小了把输出预算和总结一起打死,代价不对称。 版本:运行时 0.1.5-rc.2(发帖时 npm latest);行号按该版本产物读,master tip 0010283(2026-09-22T15:25Z)里 packages/session/session-stats/src/projection.ts 的 SessionStatsTotals 仍只有 turns / steps 那一族,没有压缩维度。 |
Uh oh!
There was an error while loading. Please reload this page.
现象
长会话(消息量约 79 万 token)在完成任何自动压缩之前,就直接收到上游 max-context 报错而死;会话记录中从未出现任何
compaction/start/compaction/summary。环境
dsh --profile web;我们在此版本上运行长驻 agent 会话)This model's maximum context length is 1048576 tokens. However, you requested 1048596 tokens (792596 in the messages, 256000 in the completion)...requested 1055000 tokens (799000 in the messages, 256000 in the completion)数值分析
compaction-basic默认thresholdRatio: 0.8⇒ 触发点:证据
compaction相关出现 0 次;终结均为上述硬溢出报错。thresholdRatio调整为 0.65 作为缓解(本 issue 供上游参考默认值行为)。建议(供参考)
min(thresholdRatio × window, window − maxOutputReserve − margin);或thresholdRatio(Dev Note 亦提到默认比例 no corpus-backed guidance)。附注(观察,供确认)
packages/bundle/web-app的补丁将compaction-basic/command-compact/tool-result-pruner置为disabled: true(注释称 moved to host plane)。在我们部署的最终组合树(dsh --profile web --dump-config)中三者仍为disabled: true且未见替代挂载——不确定是预期行为还是我们缺了某个环节,一并反馈。All reactions