Repository navigation
docs(tools): the bare-string compress form may carry a whole batch - #472
Conversation
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)In your adapter project: npm install acp-kernel@pr-472Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf acp-kernel-pr472.tgz
npm install ./packageThis comment is automatically updated on each push. |
[bot] 🏷 PR verified — review conclusion: mergeable (two non-blocking flags below). This is already-built PR work, so I pulled branch What I verified
Existing-behavior audit (regression pass)
Flags (non-blocking)
Downstream ordering (bili receipt wording + pin bump after this releases) matches the kernel-first cross-repo rule — nothing needed here. 中文摘要:核对了 PR #472——仅改 5 处面向模型的描述文案,教模型用单个字符串一次传多个压缩区间(解析器本就支持,已实测复现);本地 typecheck / 1188 测试 / build / format 全绿,CI 四项全绿,无行为回归(nudge 文案加长属有意变更,已按旧值→新值标注),可以合并;唯一建议是补一条「多区间单字符串」解析的回归测试。 |
|
Amended: lean pack coverage audit (asked during review) —
|
[bot] 🏷 Amended head What I checked on the amendment:
Round-1 flags after the amendment:
中文摘要:复核了补交提交 285e506(lean 包单行工具描述同步教一次性批量 + 对应测试 pin 更新,共 2 行),并在代码层面核实了「cloneWithDescriptions 只按属性名替换、anyOf 匿名项继承共享文案」的论断;本地 typecheck / 1188 测试 / build / format 全绿,CI 四项全绿,分支仍可快进合并,可以合并;唯一遗留建议是补一条「多区间单字符串」解析回归测试。 |
|
Suggestion (b) landed in 87185e8 — |
87185e8 added the one-string-whole-batch regression test with lines that violate the repo Prettier style; CI format:check fails before typecheck/test ever run. This commit applies prettier --write to that block only — pure line-wrapping, zero semantic change.
[bot] 🏷 Test commit verified — one CI break found and fixed directly on the branch; head is now On But CI went red on it: Fix I landed — since CI was failing I took the small fix myself, per review convention:
Full diff vs master is now 5 files / ~30 lines: 4 description-text sites (+ its packs pin) and the regression test. Both earlier flags are closed — scope delta resolved by your coverage table, test gap pinned in 中文摘要:复核了测试提交 87185e8(断言有牙:kind/invalidItems/双区间精确提取含无 topic 变体),但发现它没过 Prettier 导致 CI format:check 红、后续步骤全被跳过;已直接在分支上补了纯换行格式的提交 17c56b7(断言语义零改动),本地与 CI 四项全绿,可以合并。 |
|
Deep review — verdict: MERGEABLE (reviewed on the PR head). Verified
What this PR is (and correctly stays)Pure documentation surface: default-pack tool description, lean-pack description + param description, the nudge 💡 hint, and the prompt-function fixture — all now teach that ONE bare string may carry the whole batch (one refs-header line per range), positioned as the gateway-robust form. Zero runtime logic change; the parser has supported this shape all along, the PR makes it a taught + pinned contract instead of an accident. Why it matters (ties the chain together)#1495/#1497/#1499 showed lossy gateways and drift produce wrapped/stringified/mangled Notes: description growth is ~1 line per surface — fine. The fixture update is the golden itself, regenerated in-PR (no drift). Non-blocking: none. Sibling note for the owner: #471 (parser salvage, Fixes #470) and this PR are independent — merge in either order; both belong to the #1494/#1495 hardening chain. |
[bot] 🏷 Confirmed on the final head Re-verified the new commit and the full state:
Sibling note acknowledged: #471 is independent, merge order doesn't matter. Nothing left open on my side — ready for human merge whenever. 中文摘要:在最终头 6bb0782 上复核确认——系统提示 TOOLS 示例新增单字符串批量形式、fixture 为 PR 内再生且与源码逐字一致(非漂移),本地 1189/1189、CI 4/4 全绿,同意 MERGEABLE;仅更正一处数字:master 基线实测为 1188 而非 1186(本 PR 净增 1 个测试块)。 |
The lenient parser (splitLineEntries) has always accepted one plain string holding MULTIPLE ranges — each block starting with its own refs header line — but every tool description said 'one STRING per range', so models retreated to one-call-per-range after lossy gateways corrupted their array batches (ranxianglei/billion-context#1495: batched calls died, models adapted by splitting, compress turns multiplied). Document the single-string batch form and steer multi-range batches to ONE call: plain text survives stringify/truncate gateways best because the line form needs structure only in the refs header lines.
The system-prompt tools section (FUNCTION_PROMPT_SECTIONS, the strongest surface — it rides every request) taught batching with the object-array example only. Show the same batch as ONE plain string with the escaped \n visible, marked most robust through lossy gateways. Fixture prompt-function-default.txt regenerated (byte-stability pin). Text/hybrid protocol sections untouched: no gateway corrupts their model-emitted text, and they already teach one-trigger batching.
6bb0782 to
7b68d49
Compare
|
Rebase onto master (post-#471 merge) — head Conflict was the tail-append seam in Gates on the rebased head: parse+surface 85/85, full suite 1202/1202, typecheck clean. User validated the combined build (#471+#472) live in a real pi session: one-string 3-block batch compressed m00059–m00060 / m00083–m00090 / m00098–m00099 → 3 blocks, ~14818 tok saved; per-summary cap proven NOT shared across the batch (3 × 19 000-char summaries parse fine). |
[bot] 🏷 Rebased head What I checked on the rebase:
The live pi-session validation is the right capstone: one-string 3-block batch → 3 blocks, ~14818 tok saved, and the per-summary cap proven NOT shared across the batch — that's exactly the taught behavior this PR exists to make default. Nothing open on my side — ready for human merge. 中文摘要:复核了 rebase 后的头 7b68d49——冲突按并集解决且逐字节核实(pin 测试与 rebase 前版本完全一致、#471 的测试原样保留、纯尾部追加零删除),本地 tsc / 1202 测试 / build / format 全绿,CI 4/4 全绿,可以合并。 |
What
Refs ranxianglei/billion-context#1495 (owner re-review: after the #1497/#1499 receipt fixes, models stopped batching compress and issued one call per range).
The lenient parser (
splitLineEntries,src/parse-compress-input.ts:432) has always accepted one plain string holding MULTIPLE ranges — each block starting with its ownm00150–m00220 optional topicheader line:…verified live against this branch. But every tool description said “one STRING per range” (tool description, content param description, lean pack param description, anyOf string alternative), so no model knew it could batch this way. Under lossy gateways that stringify/truncate array arguments, models rationally retreated to single-range calls — which works, but multiplies compress turns (the owner's complaint).
Change (description text only — 4 sites, no behavior)
src/compress-tools.tsCOMPRESS_TOOL.description: “content as a single string (bare line form — one string may hold ALL ranges, each block starting with its refs header line — or JSON-encoded array)” + “Batch multiple ranges into ONE call.”src/compress-tools.tscontent param description: single-string form marked PREFERRED for multi-range batches (“plain text survives lossy gateways best”), + “do not split into one call per range”.src/packs.tslean param description: “ONE string may hold several ranges (new header line per range)”.Rationale for preferring the string form for batches: the line form needs structure only in the refs header lines, so it has no array nesting for a gateway to stringify, and truncation salvage recovers every complete leading block.
Validation
tsc --noEmit0; full suite 1188/1188 pass (incl. compress-schema-contract 31/31, packs).Downstream: bili receipt wording (teaching lost-range re-issue as ONE single-string call) + pin bump lands as a separate bili PR after this releases.