Repository navigation
feat: output-side compression (verbosity steering + effort routing) - #1257
Conversation
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-1257Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr1257.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Review of PR #1257 — direction ✓, safety boundaries runtime-verified, gates green. I pushed three small labeled fix commits directly onto the branch (new head ① 原 issue / 方向关 — PASS. Checked against the #1096 close-out spec: all decision logic lives in acp-kernel 0.0.85 ( Safety boundaries — verified at runtime, not just by reading: I probed the installed acp-kernel 0.0.85 directly:
Default-off passthrough also proven structurally: when unset at every level ② 回归审查(既有行为清单):
③ 代码审查: clean, single-purpose module; sentinel
④ 测试有效性: the 35 tests have teeth — they pin every hard boundary (per-wire tail-append, skip-if-absent byte-identical, idempotent byte-stability, in-place level replacement, mechanical-vs-non-mechanical classification per wire incl. codex ⑤ diff 整洁度: pure after my fixes — every line serves the feature or its docs/tests. My commits:
Post-fix gates: typecheck ✓, output-steering 35/35 ✓, build ✓. Pushed Verdict: mergeable once CI is green on 修复了输出侧压缩 PR 的三个审查小问题(CONFIGURATION 文档缺失、anthropic thinking.type 未断言、config.ts 缩进噪音+过期注释)并直接推到 PR 分支;方向与 owner 规格完全一致、只降不升等安全边界已在 acp-kernel 运行时验证、默认关闭零行为变更,CI 绿后可合并。 |
Add two opt-in output levers at the proxy forward boundary (#1093): - Verbosity steering: append a deterministic conciseness directive to the system-prompt tail (skip-if-absent, sentinel-idempotent, never prepends). - Effort routing: clamp an already-sent effort field down on mechanical continuation turns (never injects an absent field, never raises, never toggles thinking.type). Division of labor (per #1096 rework spec): ALL decision logic — turn classification, verbosity-level resolution, lower-effort choice — lives in acp-kernel (decideOutputSteering / resolveOutputSteeringConfig, pinned 0.0.85). bili's src/output-steering.ts only LANDS those decisions on the four wires (openai chat / responses / anthropic / google-native); no local cwst/level classification is duplicated into bili. Config: `compress.outputSteering` rides the standard three-level compress cascade (global -> provider -> model) via mergeCompress; resolved + validated by the kernel's resolveOutputSteeringConfig at the forward boundary. Default off => byte-for-byte passthrough when disabled (no prefix-cache regression). Covers both forward paths: the initial string-body forward and compress-retry re-sends (via wireTransform). Launcher / native-plugin / /bili/ lanes inherit it automatically since it lives at the shared forward boundary. 35 wire-shape regression tests (tests/output-steering.test.ts).
…ty-option doc, CONFIGURATION.md (+zh-CN) for outputSteering
e2b8f31 to
3f1075c
Compare
结论:复核通过,已直接在 PR 分支修复并推送( 复核发现并已修复
复核通过的关键点(未改动)
门禁(rebase+修复后,本地)typecheck 0 错 / 2487 过 0 败 / build ✓(annotations OK)。
|
Implements output-side compression (#1093): two opt-in levers at the proxy forward boundary, ported from headroom and repositioned per the #1096 rework spec.
What
thinking.type).Design (division of labor)
Per #1096 close-out: all decision logic lives in acp-kernel (
decideOutputSteering/resolveOutputSteeringConfig, pinned0.0.85) — turn classification, verbosity-level resolution, lower-effort choice. bili's newsrc/output-steering.tsonly lands those decisions on the four wires (openai chat / responses / anthropic / google-native). No local turn-classifier or level logic is duplicated into bili.Config
compress.outputSteeringrides the standard three-level compress cascade (global → provider → model) viamergeCompress, resolved + validated at the forward boundary by the kernel'sresolveOutputSteeringConfig.Behavior-change disclosure
Default off. When disabled (the default) the forward path is byte-for-byte passthrough —
steerCfgresolves null andwireTransformreduces to the originalcompatProtocolcondition, so there is zero change to any existing request and no prefix-cache impact. The levers only act when explicitly enabled inbillion-context.json.Coverage
Covers both forward paths — the initial string-body forward and compress-retry re-sends (via
wireTransform). Launcher / native-plugin //bili/lanes inherit automatically since it lives at the shared forward boundary.Tests & gates
tests/output-steering.test.ts) — all pass.npm run typecheck— green.npm run build(tsup, acp-kernel inlined) — green.claude-native.test.ts— needs a realclaudebinary + livepswalk, unavailable in this sandbox); identical with and without this change. CI runs the complete suite.Cross-repo dependency
Uses acp-kernel
0.0.85(already pinned in master) — no new cross-repo bump required by this PR.Fixes #1093