Repository navigation
[Bug] /compact collapses a dozen distinct failures into one message: "could not produce a useful summary" #9132
Matthew-Laplace
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.
摘要
/compact只回显一句Compaction could not produce a useful summary.,但实测这句话背后至少有 11 个可分辨的失败类别(本窗口观测到 10 个)。其中/compact实际暴露的 7 次失败全部是提供方或窗口故障,没有一次是"摘要质量不行"——其中 2 次(鉴权 401)用户按文案提示重试必然再失败。所以问题不只是文案不够详细,而是文案给出了错误建议。本报告把三个口径分开(很多人把它们混在一起,会放大暴露面):命令级 7 次是用户真实暴露面,physical 级 102 次是自动+手动全部失败,record 级 162 次含 fork 副本。
环境:
@deepseek-ai/dsh0.2.0-rc.2(构建 2026-09-29),dsh-command-compact/dsh-compaction-basic同版本。340 个会话文件 / 241,919 条事件,逐帧 zstd 解码实测。1. 三个口径(必读,否则次数对不上)
command/done记录busy10、summary文案 7关键点:102 次失败里只有 7 次会走
throwManualFailure,即compaction/end.turn === null的手动路径。另外 95 次是自动路径,region.ts直接throw failure.error,不经过/compact的文案映射。这 7 次与命令级 7 条文案一一对应(sourceCommandId关联)。2. 被
code: 'summary'吞掉的类别判定点:
dsh-compaction-basic/src/region.ts:279-299。stage === 'commit'→commit,SurfaceChangedError→changed,其余一切落到最后一个throw new ManualCompactionError('summary', …)。errorChain首行)API error (400): … Unsupported value: 'none' is not supported with the 'gpt-6.1-sol' model … "param":"reasoning.effort"pi-ai detected context overflow for model "DeepSeek-V4.1-Flash"This model's maximum context length is 1048576 tokens. However, you requested 2111647 tokens (2046111 in the messages, 65536 in the completion)pi-ai stream idle timeout after 60000ms(另有300000ms1 条)401 status code (no body)API error (429): {"message":"Daily usage quota exhausted for this platform."…}summarization truncated at the token cap (incomplete checkpoint)summary is not smaller than the shadowed content (3886 estimated framed tokens >= 3794)Connection error.OpenAI Responses stream ended before a terminal response eventgateway_concurrency_limit: Concurrency limit exceeded for user, please retry later502 upstream response error: aborted、DeepSeek Messages request abortedUNSUPPORTED_CONTENT,summarizer.ts:214-220)commit/changed/persistence这三类归类是对的(各自独立 code 与文案),本窗口各 0 次。问题只在它们之外的一切被压进summary。3.
/compact的 7 次失败逐条300000ms60000ms7/7 全部是提供方或窗口类故障。 "重试"对其中 5 次是正确的,对 2 次 401 是确定的无效建议。
busy侧同类问题:命令级 10 次busy混了「压缩锁被占」与「agent 非空闲」两种(region.ts:308-320与region.ts:193-195都抛busy),而日志里两者文本完全相同,无法分离——这本身就是信息不足的证据。4. 与已有报告的关系(重要)
TRANSPORT被同一句掩盖 → 对应本文 S8/S9/S11。reasoningEffort→ 对应本文 S1。summary is not smaller被拒 → 对应本文 S7。这三篇合计覆盖 4 个可分辨类别。本文在同一句话背后再找出 6 个它们未覆盖的类别:S2(含 S2b 的量化落差)、S3、S4、S5、S6、S10。并给出全部 10 类的占比与 10-04 → 10-08 的跨日分布。
5. 修复方案(推荐 A)
方案 A(推荐):把
summary拆成三个 code,并保留旧值。为什么这一处改动能同时关闭三篇:
summary_call收走 #6184 的TRANSPORT与 #6264 的提供方参数拒绝,summary_shrink正是 #4454 的诉求。方案 B:code 不变,在结果里带结构化
reason字段。缺点是 GUI 需要新字段,且旧 code 仍然无信息。方案 C:只把
errorChain首行拼进文案。实现最省,但会把提供方响应体写进session.v4.jsonl,可能带request_id、账号字段或内网地址——需要额外脱敏,不如 A 干净。方案 A 的影响面(已核):
dsh-client-ui-conversation/lib/client.js:3963-3971只原样渲染outcome.text,command/done.text是自由字符串,无 schema 变更;全仓仅 6 处引用该类型;busy/cancelled/changed/commit/persistence文案逐字保留,GUI 零风险。6. 一个实现上的硬约束:不能只按
LlmError.code分派本窗口 102 次失败中,能拿到规范码的只有约 19 次,其余 83 次(S2、S2b、S6、S7、S8、S9、S10、S11)的
errorChain只有可读文案。所以映射必须是规范码优先 + 文案兜底双层。其中一条必须写对:S2b 拿不到
CONTEXT_WINDOW_EXCEEDED。dsh-llm-pi-ai/lib/index.js:1403的isContextOverflow靠 usage 与窗口推算,而 S2b 是 400 响应、没有 usage,只有响应文本里的maximum context length能认出它。缺这层兜底就会把"请求 2.1M / 上限 1M"错认成INVALID_REQUEST(request一词易误命中),用户看到的 reason 会变成"提供方拒绝了请求参数"——而 S2b 正是/compact7 次失败中的 2 次。另一条:
MAX_TOKENS(summarizer.ts:203-207)与summarization produced no text summary content(:169-171)挂在普通Error上,不是LlmError,用instanceof LlmError判定会漏。7. 局限
busy的三种来源无法从现有日志分离(信息不足,不猜测)。English
Summary
/compactprints a single line,Compaction could not produce a useful summary., but at least 11 distinguishable failure classes (10 observed) collapse into it. All 7 failures that/compactactually surfaced were provider or window failures — not one was a summary-quality problem. Two of them (auth 401) make the message's implicit "retry" advice certainly useless. So the defect is not merely that the message is vague; the message gives wrong advice.Environment:
@deepseek-ai/dsh0.2.0-rc.2 (built 2026-09-29), same version fordsh-command-compactanddsh-compaction-basic. 340 session files / 241,919 events, decoded frame by frame.Three counts, kept apart
/compactrelevancecommand/donerecordsbusy, 7summaryOnly the 7 manual attempts (
compaction/end.turn === null) reachthrowManualFailure. The other 95 failures take the automatic path, whereregion.tsthrows the original error and the/compacttext mapping never runs.What
code: 'summary'swallowsClassification lives at
dsh-compaction-basic/src/region.ts:279-299:stage === 'commit'→commit,SurfaceChangedError→changed, and everything else falls through tonew ManualCompactionError('summary', …). The classes are: provider 400 parameter rejection (15), summarization context overflow (60, incl. 2 reported verbatim by the provider asmaximum context length is 1048576 tokens … you requested 2111647 tokens), provider stream idle timeout (10), auth 401 (3), quota 429 (3), summary truncated at the output cap (3),summary is not smaller(2 — a legitimate decision, not a fault), connection error (1), stream ended without a terminal event (1), gateway concurrency limit (1), upstream 502 / aborted (3), and image-bearing summary output (0 — reachable, unobserved).commit,changed, andpersistenceare classified correctly; the defect is confined to everything pushed intosummary.busyhas the same problem: it merges "compaction lock held" with "agent not idle", and the two are indistinguishable in the log.Relation to existing reports
#6184 (
TRANSPORTmasked), #6264 (lostreasoningEffort), and #4454 (summary is not smaller) together cover 4 of these classes. This report adds 6 more behind the same sentence: summarization context overflow (with the quantified gap), stream idle timeout, auth 401, quota 429, output-cap truncation, and gateway concurrency limit.Proposed fix (A preferred)
Split
summaryintosummary_call/summary_shrink/summary_content, keeping'summary'in the union for old logs and clients. That single change addresses #6184 and #6264 (summary_call) and #4454 (summary_shrink). The GUI rendersoutcome.textverbatim (dsh-client-ui-conversation/lib/client.js:3963-3971),command/done.textis a free string, and only 6 sites reference the type — no schema change, and the existingbusy/cancelled/changed/commit/persistencetexts stay byte-identical.One hard implementation constraint
Dispatch cannot rely on
LlmError.codealone: only about 19 of the 102 failures carry a canonical code; the other 83 expose only readable text. The mapping must be canonical-code-first with a text fallback layer. In particular, the verbatim provider overflow (S2b) has no usage data (it is a 400 response), soisContextOverflowcannot fire and only themaximum context lengthtext identifies it — without that fallback the message becomes "the provider rejected the request parameters", which is exactly wrong for 2 of the 7/compactfailures. Note also thatMAX_TOKENSandsummarization produced no text summary contenthang off plainError, notLlmError.Limitations
Only build artifacts and local session logs are available — no source checkout and no write access to upstream — so this is a root cause and a fix specification, not an applicable diff. The three
busysub-sources cannot be separated from the current logs. The proportions reflect this machine's route set and should not be extrapolated.All reactions