Repository navigation
fix: stop labeling first-party siblings as third-party compressors in conflict alarms - #2262
Conversation
… conflict alarms #2261: billion-context-pi / opencode-acp are bili's own siblings and stand down while bili drives the session, yet every display surface called them 'third-party compression plugin' and commanded removal. Classify recorded details at display time (isSiblingConflictDetail), count them additively in ConflictSummary.sibling, and give them their own wording in the web banner and acp_status section.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2342-pr.2262.9f056c1This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2262.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Review 完成(拉分支核代码 + 调用点核对 + 定向测试 + CI)。结论七问: 1. 是什么问题:冲突告警(web banner / 2. 什么原因导致的:分类发生在记录时——ledger 只存 3. 怎么修复的:展示时分类(display-time classification)——新增 4. 是否有回归问题:逐项过既有行为——
5. 是否破坏缓存:不涉及——请求管线、消息重建、prefix-cache 路径零触碰;stats JSON 仅 additive 字段,旧客户端忽略未知字段。 6. 是否改了设计方向:否。仍是单写者/单压缩器契约;native 模式与 standalone 扩展互斥机制(#820/#920/#991)不变,本 PR 只修正展示层措辞分类。 7. 是否引入了新的配置:无新 config/env。唯一对外可见面: 验证证据:本地定向测试(issue1206-thirdparty-scan + conflict-lifecycle + web-conflict-banner + web-i18n)45/45 通过(缩进修复后复跑确认);分支基于最新 master(0 behind,mergeable);CI 守护类 job(kernel-guard / version-guard / lane-guard / docs-sync / docs-coverage / build-artifact)已绿,全量测试矩阵与 e2e lanes 在新 head 判定:可合(待全量 CI 转绿;合并请你操作):#2262 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.76-master.4cc055b # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #2261
What / why
The web conflict banner and the
acp_statusCOMPRESSION CONFLICTS section label everythird-party-pluginledger event as a third-party compression plugin and command "keep exactly one compressor". But two of the entries that can land in that kind are bili's own first-party siblings —billion-context-pi(pi) andopencode-acp(opencode) — which stand down automatically while bili drives the session (BILLION_CONTEXT_NATIVEmarker in native mode,/bili/baseUrl self-check in launcher/manual wiring; #820/#920). No second compressor is active, so the alarm both mislabels them and commands removal of something that is not a conflict.Stock ledgers written by older versions (<v0.1.176 context-forge false positives, <v0.1.183 bcp records before #2045) persist across upgrades and keep triggering this wording on current builds — that is exactly what #2261 reports.
Fix (display-time classification)
src/thirdparty-scan.ts: newisSiblingConflictDetail(detail)reverse-maps a recorded detail (single-producer shape<client>: <entry> (<source>)[ [suspected]]) back to its plugin entry via the existingisLegacyBcpEntry+ new sharedisOpencodeAcpEntry. Classifying at display time (not record time) covers stock ledgers with no tag — no persistence migration.src/conflict-watch.ts:ConflictSummarygains an additivesiblingcount;formatConflictSectiongets a sibling-only footer branch (names them as bili's own, explains the stand-down, points at the clear path — no removal command). Mixed ledgers keep the existing strong footer untouched.src/web/client.tsbanner: composes per family now including a sibling clause; sibling-only stock gets its own risk sentence instead of "keep only one compressor".src/web/i18n.ts:conflict.what_sibling/conflict.risk_siblingin zh-CN + en (parity-checked by tests/web-i18n.test.ts).Behavior changes (old → new)
npm:-prefixed opencode-acp spec (e.g.npm:opencode-acp) was previously keyword-matched as[suspected]even in plugin mode; now classifiedknownsibling and skipped by the existing design-benign rule when bili drives the session. Fewer false warnings; wire/plain-proxy behavior for it is unchanged (still recorded conservatively, as for all known siblings).GET /__bili/statsconflicts JSON: additive fieldsibling(count of plugin-kind events naming first-party siblings). Old clients ignore unknown fields.No config/env surface added. No persistence format change (nothing new is recorded). No kernel change. No request-pipeline path touched (scan call site in server.ts unchanged).
Tests
New cases in tests/issue1206-thirdparty-scan.test.ts: predicate form matrices (incl. lookalike rejection), detail reverse-mapping (incl. Windows-style paths, npm:/versioned specs, [suspected] suffix), npm:-prefixed scan tiering, additive summary count, sibling-only vs mixed footers. Existing ledger/banner/i18n suites pass; local typecheck green. Full regression on CI.