Repository navigation
[PR] fix: external-summary failures now carry classified diagnostics, references fit each candidate's real window, and tier-2 nudges stop self-amplifying on persistent failure - #3659
Conversation
…ate window, damp tier-2 nudges on persistent failure (#3638)
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4447-pr.3659.709d472This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3659.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 按失败签名(external-summary 全候选失败的泛化文案 + tier-2 目录 nudge 自放大)在 open+closed issue/PR 检索:无同症状条目。相关但机制不同:已合入的 #3541(修 #3488)做的是运维侧重试循环 + per-attempt 日志 + 凭据三态 UI;本 PR 做的是调用方可见的分类诊断、reference 按候选真实窗口适配、持久失败期的 nudge 抑制——三个机制均不在 #3541 覆盖范围内。两者在 开始独立审查:拉分支读全量 diff、清点触碰路径的既有行为、核对测试有效性。CI 状态一并确认。结论稍后按结构化八问给出。 |
…print on every side (#3638 review) renderLaneNudgeText passed the full request Config to externalSummaryFingerprint, which expects the chain object and returns "off" for anything else — so the tier>=2 standing-notice swap could never arm in any lane (the self-amplification fix was dead code). The plan also fingerprinted its PARSED settings while the catch paths and lanes see the raw rail chain; parseExternalSummarySettings fills contextWindow/outputTokens defaults and normalizes URLs, so the two fingerprints disagree whenever a target omits those fields. All three sides now fingerprint the raw rail chain: the plan records fingerprint(raw), the lanes compare fingerprint(config.externalSummary), and the catch paths already used it. New lane-seam regression test pins the full-Config argument shape, the plan/raw parity, and the negative rows (tier-1 untouched, mode-off untouched).
…tion test (#3638 review) EXTERNAL_FAIL_LATCH_THRESHOLD is only used inside external-summary-failures.ts — drop the leading export so the unused-exports gate passes again. The provider-rejection test slept real backoff (1s + 2s) inside a 4s total budget, so on slow machines the third attempt hit the deadline and classified as timeout instead of provider_rejected (deterministic failure here, failed 3/3); zero the backoff through the existing #3488 test seam like the other retry tests do.
(ai: vllm-qwen/qwen3.8-27b) 审核结论(独立审读全量 diff,14 文件 +629/-45):方向正确——三缺陷同属一个失败域(host 侧修复、不碰 kernel)。但审核发现并直接修掉 1 个真实缺陷:特性 C(持续失败时替换 tier≥2 nudge)在合入形态下是死代码,latch 永远无法武装;另修 1 处 CI 红灯和 1 个依赖机器速度的测试。两个标注 commit 已推到 PR 分支( 审核发现并已修(直接修,不等反馈循环)
触碰路径的既有行为回归清点(逐项)
小问题(不拦合并,建议作者知悉)
有意行为变更(PR 已声明,核实成立):通用一句话失败 → per-candidate 分类诊断(≤900 字符)+恢复指引;无界 reference → 按候选窗口 fit(drop-oldest 收缩,摘要在不同窗口下可能略有差异——设计意图);持续失败(同配置连续 2 批全败)后 tier≥2 nudge 全文目录 → 简洁 standing notice,首次成功折叠自动恢复;operator 日志 batch 行 → per-attempt class + trim 计数。无新配置/env、无 kernel 变更、无版本 bump。 结构化八问
CI 状态:推送前该 head 上所有 test/e2e lane 为 skipped、 判定:CI 绿后可合。核心两类修复(分类诊断 + reference fit)成立;latch 特性原为死代码,经本次接线修复才真正生效——#3638 的自我放大症状要到这两个 commit 之后才算真正堵住。合并仍由人来操作。 |
ae1694b was committed from a stale pre-review worktree and silently reverted c028d16 (rail-chain fingerprint wiring in runtime/nudge-decide + lane-seam test) and part of db5cc1b (retry-backoff de-flake of the 429 test). This commit restores those files byte-for-byte to the db5cc1b state; the latch-threshold un-export they contained is preserved. Verified: unused-exports gate clean, typecheck clean, external-summary+nudge targeted suites green.
Closes #3638
查重: 无(平台 issue 检索无同症状条目;与已合入的 #3541/#3488 相关但机制不同——它做运维侧重试+日志,本 PR 做调用方可见诊断、reference 窗口适配、持久失败期的 nudge 抑制;分支已 rebase 到含 #3541 的 master,唯一冲突按并集解决)。
What was broken (verified against v0.1.199 == reporter's build)
Every T2/T3 distillation in external summary mode failed with one generic sentence, for ANY span size, while each turn re-injected the full emergency tier-2 block catalog. Three coupled defects, one failure domain:
referencepayload carried ALL other active T1 summaries + uncovered context UNBOUNDED (~286K tokens in the reporter's session). The pre-send window check counted that unbounded reference against the candidate's window, so once accumulated summary mass outgrew the window, even a two-block span overflowed identically.{outcome:"error"}; the tool result was one sentence for config-missing / credential-fail / provider-reject / input-overflow / output-overflow / timeout-exhaustion alike.The fix (host-side only, no kernel changes)
A. Classified bounded secret-free diagnostics. Every failed attempt carries
failure:{cls,detail?}with cls in {candidate_unavailable, input_budget_overflow, provider_rejected, network_error, timeout, invalid_output, output_budget_overflow, unknown_error}. The tool result becomes per-candidate lines<name> (<protocol>/<model>): <cls> — <detail>(last attempt per targetIndex, max 3 lines) plus congestion/deadline notes and a safe-recovery tail, hard-capped at 900 chars. Security contract preserved and extended: response bodies never surfaced (status code only), URLs scrubbed, credential values excluded from the chain fingerprint, raw provider text never enters results (existingwithout leaking provider errorspins honored).B. Reference fitted to each candidate's real window. Work items now carry structured
referenceParts; before sending, system+content+reference+output are accounted againstcontextWindow, and if it doesn't fit the OLDEST otherSummaries are dropped first, then oldest context messages (block order verified oldest-first). Still overflowing → typedinput_budget_overflowwith token numbers and ZERO requests sent. Trim is logged info-level. Tiny spans stop carrying the whole session's summary mass — this is the availability fix for the reported symptom.C. Persistent-failure nudge dampening. Per-session latch in
session.metadata: after 2 consecutive all-candidate-failed batches under an unchanged chain fingerprint, the tier>=2 distillation/condensation nudge (EMERGENCY header + full block catalog) is replaced by a 3-line standing notice (unavailable status + last failure classes + recovery path: fix config or setcompress.externalSummary.enabled=false). First successful fold or any config change clears/resets it. Congestion outcomes (#2662 pool-saturated, zero dispatches) neither arm nor clear. Swapped ONLY in the final-else render branch of all four lanes (anthropic/openai/responses/google); the decide-fallback tier===1 branch and every non-external-mode session stay byte-identical.Behavior changes (old -> new, intentional)
No new config keys / env vars / CLI flags; no kernel/ changes; no version bump.
Coordination with #3541 (merged to master during this PR's life)
Rebased onto current master. Single conflict in
src/external-summary-http.tsresolved by union: #3541's bounded retry loop stays intact; its final non-retryable rejection now throws the typedprovider_rejectederror (status surfaced, body still log-only). Its exhausted-chain test pin extended with the classified failure field (contract extension, labeled).Verification
Local targeted suites on the rebased head: external-summary/nudge family 204 pass, preflight family 185 pass, compress/lane-rewrite family 203 pass, 0 fail; typecheck clean. Full-suite verdict = CI on this head.
(ai: vllm-qwen/qwen3.8-27b)