Repository navigation
[PR] kernel: compress length-rejection advice must match the failure direction (#6730) - #6751
ranxianglei wants to merge 5 commits into
Conversation
…tion (#6730) The batch rejection message told a too-short summary to "shorten or split ... to fit its cap" — backwards advice that made the summary shorter, so the model retried into a guaranteed-fail loop (full context re-read each round) until the circuit breaker fired. validateSummaryLength now throws a typed SummaryLengthError carrying the direction (empty / tooShort / tooLong); the batch screen tracks which directions fired and renders direction-aware remediation: too-short/empty -> "expand ... do NOT shorten it", too-long -> "shorten or split ... to fit its cap", mixed -> both. The drop-the-range exit is always offered. kernel-change: fix a self-contradictory error-message literal (mechanical bug) — no algorithmic/state/wire-shape change, only the remediation text of the batch length-rejection. Regression test: kernel/tests/issue6730-length-remediation-direction.test.ts.
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.11192-pr.6751.27954feThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6751.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 — 检索 open PR,只有本 PR 针对「compress 长度拒绝建议方向」这一缺陷;其余 compress 相关 PR(#6753/#6714/#6074/#5545 等)都是不同面(nudge、ref 号、CJK guard、overlap 原子性),无并列重复。 Reviewed PR #6751 (kernel: direction-aware Verification
CI: still in flight on the pushed head (main 结构化八问
判定:可合(建议)。修复打到根因,测试双向钉死(#3617),无回归,diff 干净,Kernel Boundary 合规。kernel 变更走人工合并档——等 CI 全绿后由 owner 合。 |
# Conflicts: # kernel/package-lock.json # kernel/package.json
The merge-resolution bump of kernel/ to 0.0.200 left the root package-lock.json workspace entry at 0.0.199 (master's value); lock-sync (npm install --package-lock-only + git diff) requires the three version sites to agree.
(ai: vllm-qwen/qwen3.8-27b) lock-sync fixed and pushed — new head What failed: on head Fix: one line in root Pushed as the final head without the 七问:
|
…subset (#6730) The verif-subset-guard CI job rejects the class form: CLASS_DECL for 'class SummaryLengthError extends Error' and UNKNOWN_GLOBAL for the three 'new SummaryLengthError' throws (the guarded-file subset only allows NEWABLE constructors: Map/Set/Error/RangeError/TypeError/RegExp). Rewrite as a plain-Error factory (summaryLengthError) plus a type guard (isSummaryLengthError) — same error name, same kind field, same messages, behavior byte-identical; the issue6730 regression tests pin the visible rejection text and pass unchanged. No exception added to verif/exceptions.ts: the code now conforms to the subset instead of weakening the guard.
(ai: vllm-qwen/qwen3.8-27b) Red test shards fixed — pushed final head What was red (verified live from the job logs this run): all 3 failing shards on head
Root cause: Fix (code side, no guard weakening): rewrote the error as a plain- Local verification (targeted, per local-test discipline):
Push notes: the mirror git endpoint was returning 502 this run (its API was up); per push discipline I verified the live GitHub head ( 七问
判定:修复已推送( |
(ai: vllm-qwen/qwen3.8-27b) Independent review of PR #6751 (head What I verified (own pass on the diff, not a copy of the earlier review):
CI: green at head Findings: none blocking; no small findings to fix on the spot — the diff is 5 files (3 version sites + 八问
判定: 代码层面干净、修复打到根因、测试双向钉死、无回归——review 通过(findings-only);因触碰 |
🔶 需要决策 PR #6751(kernel: compress 长度拒绝建议方向须与失败方向一致,Closes #6730)触碰
请求 owner 授权合并(head |
…tion (#6751 conflict) Resolve the dirty merge state against the advanced master: - kernel/src/compress.ts auto-merged cleanly (PR's #6730 length-remediation direction change + master's batch-seam double-claim fix coexist) - kernel version collision: PR had 0.0.200, master advanced to 0.0.201 (batch seam fix) -> bump to 0.0.202 in kernel/package.json, kernel/package-lock.json (both occurrences), and root package-lock.json
What
kernel-change: fix a self-contradictory error-message literal (mechanical bug, owner policy 2026-11-06 exemption) — no algorithmic / state / wire-shape change, only the remediation text of the batch length-rejection.When a
compressbatch is rejected for a summary-length failure, the kernel returned ONE generic remediation string for every direction:That advice is correct for a too-long summary but exactly backwards for a too-short one (the reporter's case,
Summary too short (NN chars, min 50)). Following it made the summary shorter, so every retry failed again — a guaranteed-fail loop that re-read 300K+ tokens of context each round until the circuit breaker fired.Fix
validateSummaryLengthnow throws a typedSummaryLengthErrorcarrying the direction (empty/tooShort/tooLong). The batch screen tracks which directions fired and renders direction-aware remediation:expand each too-short/empty summary until it reaches its minimum — write out the key information the range actually contains (do NOT shorten it)shorten or split each too-long summary to fit its cap(unchanged)drop the offending range(s)exit is always offeredThe per-range failure lines (
Summary too short (…)/Summary too long (…)/Batch summary too short (…)) are unchanged; only the trailing remediation sentence is now direction-aware.Behavior change (old → new)
Old: every length-class batch rejection ended with
shorten or split each offending range's summary to fit its cap, then resend the whole batch; or drop the offending range(s) and resend only the rest that validate.New: the trailing sentence is built from the set of failure directions actually present (see above). For a too-long-only batch the text keeps its
shorten or split … to fit its capadvice; for a too-short batch it now says to expand, not shorten. This is the intended fix — the old text was the bug.Tests
kernel/tests/issue6730-length-remediation-direction.test.ts(new) pins both directions (#3617):shorten or split/to fit its cap, and MUST carryexpand … do NOT shorten itshorten or split … to fit its cap(control)Existing
issue3003/issue5894length-gate tests still pass (18/18 targeted). Kernel typecheck clean.Out of scope
The reporter's optional ask (reject the 3rd consecutive failure on the same range) is already covered by the existing circuit breaker (3 consecutive failures →
COMPRESS CIRCUIT BREAKER); the real defect was the backwards advice, which is fixed here.Closes #6730