fix: acp_status breakdown uses the CJK-aware estimator (issue #390) - #399
fix: acp_status breakdown uses the CJK-aware estimator (issue #390)#399ranxianglei wants to merge 1 commit into
Conversation
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-399Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr399.tgz
npm install -g packageThis comment is automatically updated on each push. |
[bot] 🏷 Picked up. Checking out |
[bot] 🏷 Verification complete on Diff vs. description — matches exactly
Additional checks
Pre-flight (re-run locally, matches the issue's claims)
Minor (report only): Follow-up status (acp-kernel bump): acp-kernel#177 is NOT yet on PR is ready for human merge — nothing to fix on the bili side. |
598b687 to
d57fe49
Compare
[bot] 🏷 结论:本票描述的 bug 已在 PR #400 中修复并合入 master,无需再开新 PR。 证据master 上的 commit
改动文件与本票三个根因一一对应( 三个根因如何被覆盖
acp-kernel 零改动: 验收标准对照(无状态语义)
说明我这边也独立按同一方案实现过一版(基于较早的 base),核对后发现与 #400 实质相同(仅 header 文案措辞不同:#400 用 建议直接关闭本票(已由 #400 修复,随下个 release 生效)。如需我把 #400 的 diff 与本票逐条根因再对一遍、或补一个回归 e2e,说一声即可。 |
|
Closing: superseded by #397 (acp-status.ts). The three status dispatchers this PR touched (loop/core.ts / stream.ts / compress-loop-responses.ts) were replaced by the unified |
What
Issue #390, bili-side half. The
acp_statusCONTEXT BREAKDOWN passedestimateTokensFast(chars/4) tobuildStatusReportwhile the nudge-side breakdown (same session, same report output) runs on the core's CJK-awaredefaultCountTokens— so in Chinese sessions the report systematically underestimated ~4×, and the two surfaces in oneacp_statusanswer used different scales without any label.src/loop/core.ts(unified-loophandleAcpStatus),src/stream.ts,src/compress-loop-responses.ts: passdefaultCountTokensinstead ofestimateTokensFasttobuildStatusReport— one scale for the whole report, matching the nudge and the panel's Session-only contract.src/server.ts: drop the now-unusedestimateTokensFastimport.src/plugin.tsarithmetic change:unprunedTokensalready usesdefaultCountTokens, same estimator as the nudge breakdown (createCore()is called without injected ports) — the release v0.1.6 #18-family defect there was the kernel'spanel.tsdocstring claiming "chars/4"; fixed in acp-kernel PR vscode copilot 缺乏适配 #177.Tests
tests/loop-core.test.ts: new regression — an acp_status round over a 4000-CJK-char message must print4.0K text (100%)(CJK 1:1), and the old chars/4 scale (1.0K) must not appear.Pre-flight
npm run typecheck— cleannpm test— 869/869 passnpm run build— cleanCompanion PR (kernel-side half of #390)
acp-kernel#177 fixes the remaining defects: tool-results misclassified as text in the breakdown (field-selection bug), the two conflicting "tool" definitions (now one shared
isToolMessage), the pct 1% floor, and the panel scale-contract comments. Follow-up after acp-kernel#177 releases: bumpacp-kernelhere to the new version (exact pin, per AGENTS.md §5 cross-repo rule) so the bundled dist picks up the tool-bucket fix.