Repository navigation
[PR] fix: accept merged flat compress form, recognize U+2212/FF0D dashes, report honest rejection reasons (#4252) - #4255
ranxianglei wants to merge 4 commits into
Conversation
…st rejection reasons (#4252) - RC1: a string content holding the summary text beside top-level refs (startId/startRef/messageId x endId/endRef) is recovered as ONE flat range — plain prose or a JSON-encoded {summary,topic} object; top-level summary wins over content text. Line-form strings whose first line carries refs headers are never hijacked, so every input that parses today is untouched. Broken JSON shells / non-object structures beside refs stay rejected. Diagnostics gain flatSummarySalvage. - RC2: the refs separator class gains U+2212 (minus sign) and U+FF0D (fullwidth hyphen-minus); a header with two refs separated by an unrecognized non-wordy divider is now REJECTED naming the separator instead of silently narrowing to the first ref. A wordy gap stays a topic citation (single-message read unchanged). - RC3: string content whose entries carry refs headers but validate to zero ranges reports kind=no-valid-ranges with the per-entry reasons (missing summary etc.) instead of a blanket content-not-array that dropped them (#362 visibility). Prose without refs headers keeps content-not-array. - Schema descriptions document the accepted merged shape (goldens follow in the host commit). kernel-change: model-facing compress parser accepts one more documented shape and stops two silent-misfold paths observed live in v0.1.204 (#4252); owner-approved by the issue's fix plan.
…text Description-text-only changes (verified: every diff line is a description field, 78 symmetric pairs across the four goldens): the content/startId/endId/summary parameter descriptions and the tool description now document the accepted merged flat single-range shape (summary text in content beside top-level startId/endId). No schema structure, type, or requirement change.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.5055-pr.4255.07ceb44This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr4255.tgz
npm install -g packageInstall instructions are refreshed on each push. |
The lock-sync CI lane (#3782) also enforces the kernel's own lockfile; the 0.0.151 -> 0.0.152 bump in kernel/package.json left it stale.
(ai: vllm-qwen/qwen3.8-27b) 接单:PR review(#4255 → Closes #4252) 查重: 不重复 —— 本单是 [PR] review 工单(对应 GitHub PR #4255,源头 issue #4252),不是新缺陷报告。按失败签名(compress parser / content-not-array / U+2212 separator / flat single-range)检索 open+closed issue 与近期 PR,无同机制并列条目;#3780/#603/#470 是相邻 salvage 先例,非同一缺陷。 标签: bug, pi, p1, scope/kernel(线上会话是 pi 车道;缺陷是缓存命中崩坏导致 ~2.6M token 回补风暴,按 owner 修订 2026-10-19 归 p1;修复主体在 kernel/)。 CI 现状(已查明,非代码问题):当前唯一红腿是
处置:这是几行级小修,按「小问题直接修」直接在 PR 分支上补一个独立标注的 commit(只动 |
|
(ai: zhipuai-lb/glm-5.3) 陈旧票清理(第三批动作①):目标 issue #4252 已关。为避免重复劳动关闭本 PR;如判断有误请直接 reopen 并留言。 |
Closes #4252
kernel-change: model-facing compress parser — accepts one more documented shape (summary text in
contentbeside top-level refs) and removes two silent-misfold paths observed live in v0.1.204 (U+2212 dash narrowing a 19-message range to 1; masked rejection reasons). Owner-approved by the issue's fix plan. Kernel version 0.0.151 → 0.0.152.What changes
{content: "<summary text>", startId, endId, topic}(the shape the schema's two separately-documented forms invite) now parses as ONE range: plain prose or a JSON-encoded{summary,topic}object inside the string; top-levelsummarywins over content text; all ref spellings (startRef/endRef/messageId). Guard rails: line-form strings whose first line carries refs headers are NEVER hijacked (every input that parses today is untouched); broken JSON shells, non-object structures, and summary-less JSON objects beside refs stay rejected.diagnostics.flatSummarySalvagemarks the recovery.-is rare). A header with two refs separated by an unrecognized divider (m00150 => m00168, adjacent refs) is now REJECTED naming the separator instead of silently folding ONE message instead of N. A wordy gap (m00150 see also m00168) stays a topic citation with the single-message read unchanged.kind=no-valid-rangeswith per-entry reasons (e.g. missing summary) instead of a blanketcontent-not-arraythat dropped them ([bug] 0.1.63 起 Windows persist EPERM 风暴:会话持久化静默丢数据(4.9k 次/117 会话)+ compress no-valid-ranges 拒绝 #362 visibility regression). Prose without any refs header keepscontent-not-array(ReDoS regression tests assert exactly this).parseCompressInputemits aflat-summary salvagewarn same-style as the compress: literal backslash-n in string content still fails as kind=content-not-array, hiding the real missing-summary reason #3780/lenient compress-arg parsing: salvage salvageable model output #603 salvages.Behavior changes (old → new)
content-not-array(retry loop, ~2.6M tok refold churn in the live session)flatSummarySalvageflag + proxy warnm00150−m00168/m00150-m00168headerm00150 => m00168header (unrecognized divider, non-wordy gap)content-not-array, no per-entry reasonsno-valid-ranges+ per-entry reasonsNo wire-format change (schema structure/types untouched), no persistence/config change, no threshold change.
Tests
contentnext to top-level startId/endId — plus U+2212 dash silently folds the wrong range #4252 cases: positive+negative gate pairs for the flat form — hijack guard, JSON-object form, summary precedence, broken-shell/scalar rejection; separator matrix incl. U+2212/U+FF0D; unrecognized-separator rejection with reason text; wordy-gap negative gate; RC3 kind/reasons; ReDoS linear-time tests still green).tests/wire-contract.test.ts22/22 (goldens match),tests/issue1502-raw-args-salvage.test.ts+tests/issue2580-compress-arg-salvage.test.ts16/16,npm run typecheckclean.