Repository navigation
[PR] External summary failures: name the real abort source and expose request size (#4833) - #4839
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.6250-pr.4839.7236ff6This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4839.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 检索 open+closed 的 issue 与 PR(external summary / client-abort / abort provenance / targetTimeoutMs 等签名):无同机制在途 PR。相关但不同:#3638 / PR #3659 要的是「工具结果里更完整的逐候选诊断」(面更广、展示层),本 PR 修的是「内部 deadline 中止被误标为 client-abort」的分类根因(executor→signal.reason 来源传递),两者互补、按 PR 描述只有一处工具文案追加会碰同一块地——合入顺序上本 PR 先行不冲突。 标签: 开始独立审核:先读原 issue #4833 与分支 diff(head |
(ai: vllm-qwen/qwen3.8-27b) 先说结论:无需我推送任何改动——被标记的 我拉取分支时,头已从平台通知里的 结构化八问:
收工判定:不推送、不立项。被标记失败已由 |
…re the retry loop (review fix #4839) diagnostics was joined into a string before the attempt loop, freezing elapsed near zero for every failure line — a 25s target timeout logged elapsed=0ms, defeating the diagnostic this PR adds. Elapsed is now computed per failure site; static bits stay pre-computed. The stalled- upstream regression test now also asserts the elapsed value reflects the real ~200ms hang (>=150ms), pinning the fix.
(ai: vllm-qwen/qwen3.8-27b) 审核完成(独立重读了 diff 全文、issue #4833 全线程与既有代码路径,未照抄 issue 结论)。结论:可以合并——但审核中发现了两个问题,已直接修掉并推到 PR 分支,新 head 审核发现并修复的两个问题:
结构化八问:
行为变更披露(旧→新):
CI: |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.863-master.d562d76 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #4833
What this changes
When an external-summary dispatch dies from one of bili's OWN deadlines, every log surface said
client-abort:Root cause: the HTTP candidate classifies any pre-response fetch failure whose incoming signal is aborted as
client-abort(src/upstream-fail.ts,externalAbortedshort-circuit) without asking WHY the signal aborted. But the signal the executor hands out is its own per-attempt controller, and three different sources can abort it: the per-target deadline timer, the total/batch deadline, or a genuine downstream cancellation. All three rendered identically, so an operator could not tell a budget miss from a user disconnect, and no request-size context accompanied the failure.The fix makes the abort carry its provenance and lets each surface say the truth:
src/external-summary.ts): the executor now raisesSummaryAbortErrorwithsource ∈ target-timeout | batch-deadline | cancelledridingsignal.reason. Per-attempt signals propagate the overall reason, so the HTTP layer reads ground truth instead of assuming.src/external-summary-http.ts): the warn line reports the real source —target-timeout/batch-deadline/client-abort(the latter only for genuine downstream cancellation or foreign unmarked aborts, preserving legacy attribution). Transport analysis (classifyUpstreamFailure) still runs whenever no typed reason exists, so provider/network errors keep their existing kinds and retry gating is unchanged.target=/total=budgets, protocol, stream mode, payload byte size, input token estimate, output char cap. No content, no URLs beyond the already-masked error text, no secrets.completed N/M range(s)log line (and the preflight variant of it) viaSummaryAttempt.detail: e.g.attempts=[t0:timeout (target-timeout 25000ms (elapsed 25002ms))].src/external-summary-compress.ts): when compression fails wholesale, the bounded secret-free diagnostic string is appended to the tool text so the agent sees the same provenance the operator sees.targetTimeoutMsper dispatch even whentotalTimeoutMsis larger; deadline aborts are NOT retried (the retry loop only re-dispatches transient provider verdicts and fail-fast network deaths); sizing guidance for large-context non-streaming summaries (non-streaming pays full generation latency before the first byte — raisetargetTimeoutMsaccordingly and keeptotalTimeoutMs≥ fall-through depth ×targetTimeoutMs).Behavior changes (old → new)
(client-abort)(target-timeout; elapsed=…, budget target=… total=…, protocol=…, stream=…, payload≈…B, input≈…tok[, outCap=…ch])(client-abort)(batch-deadline; …)(client-abort)(client-abort; …)(client-abort)(client-abort; …)completed N/M range(s)logsource budget (elapsed)detail[batch=… result=… attempts=[…]](first failing range only, per the existing #2678 bound)No retry behavior changed: a deadline-aborted signal still never retries (the gate requires a classified transient kind AND an un-aborted signal); only the LABEL and the accompanying diagnostics changed. No wire format, persistence, or config-schema change.
Config surface
No new config keys, env vars, or CLI flags. Existing
externalSummary.budget.*semantics are untouched; CONFIGURATION.md en+zh gain explanatory paragraphs only (deadline cap on single-target chains, no-retry-after-deadline rule, sizing guidance).Kernel boundary
No changes under
kernel/— all seams are host-side (src/external-summary*.ts). Nokernel-changedeclaration needed.Coordination
Related open request #3638 / PR #3659 asks for broader per-candidate diagnostics in the tool result. This PR deliberately stays minimal and complementary: it fixes the misclassification at the source (executor → signal.reason) and appends the existing bounded diagnostic string to the tool text; it does not implement #3659's fuller per-candidate report, so the two should merge cleanly (only the tool-text append touches shared territory).
Verification
Rebased onto current master (341e76c). Local on the pushed head:
npm run typecheckclean; targeted suites green — newtests/issue4833-summary-abort-provenance.test.ts(executor-level: target-timeout / batch-deadline / caller-cancel each produce the right outcome, detail, andsignal.reason; HTTP-level: hanging upstream logstarget-timeoutnotclient-abort; caller cancel over HTTP logsclient-abort; foreign unmarked abort keeps legacy attribution; leak-free assertions) plus the existing external-summary suites (175 tests pass).npm run buildclean (dist external-dependency gate OK, no new deps). Full-suite verdict: remote CI on this head.