Repository navigation
feat: add per-client remediation hints to compression-conflict surfaces - #2220
Conversation
[bot] 🏷 收到,开始 review #2220(对应 issue #2219)。初查:PR head |
3afec27 to
efdf2d1
Compare
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2356-pr.2220.ab2c926This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2220.tgz
npm install -g packageInstall instructions are refreshed on each push. |
efdf2d1 to
33b5ac0
Compare
[bot] 🏷 Review 进度更新 代码审查已完成,分支已 rebase 到当前 master 并重新验证: Rebase(两次)
本地定向验证(rebase 后 head)
CI:新 head 已触发全套 10 个 workflow(CI ubuntu+windows × node22/24、kernel suite、e2e 各 lane),跑完给结构化七问结论。 注:master 仍在滚动(#2194 刚合),PR 状态 |
[bot] 🏷 Review 完成 — 结构化七问 PR: https://github.comranxianglei/billion-context/pull/2220 · 最终 head 1. 是什么问题:冲突表面(acp_status / web banner / session 卡片 / launcher)只告诉用户 WHAT(两个压缩器共存)+ 一句通用命令"keep exactly one compressor",没有 HOW。#917 board case 里用户反复看到 2. 什么原因导致的:检测输出在"事件+通用劝令"处止步;处置知识分散在 README opencode 段 / CONFIGURATION.md claude 对齐 / BILI_CODEX_COMPACT / pi·omp 接管证据四处,没有任何表面链接它们。而客户端身份(#1426:x-bili-plugin header / UA 指纹)请求时已记录,却没被用于引导。 3. 怎么修复的:按已记录的客户端身份给每个冲突表面加一行处置提示(pluginAgent 优先、 4. 是否有回归问题:无(逐项过过):
5. 是否破坏缓存:不涉及——display-only,未触碰 wire 字节、持久化格式、prefix-cache 键、重试/去重路径;本 PR 对 session metadata 只读。 6. 是否改了设计方向:否——沿用既有"冲突台账→人类可读文本"模式,只是把内容从 WHAT 扩展到 HOW,键值来自请求时已有身份;无新子系统/边界/数据流转向。 7. 是否引入新的配置:无——不加 env/config key/CLI flag;config surface 零变更。 行为变更披露(均为附加输出,PR body 已声明、逐条核实):acp_status 冲突节 +2 行(仅当事件存在)/ JSON 新增 验证:最终 head 全套 CI 绿(CI ubuntu+windows × node22/24:typecheck + kernel suite + 全量 npm test + build;version-guard/lane-guard/kernel-guard/docs-sync/docs-coverage;e2e 全 lane)。 判定:可合并 —— 请人工 merge:#2220 |
|
冲突 |
…2219) The conflict surfaces told users WHAT happened (two compressors coexisting) plus the generic 'keep exactly one compressor' imperative, but no path to HOW — answering correctly required four separate doc locations, none linked from any surface (#917 board case: repeated unannounced-rewrite warnings, user had no idea what to do). Add a one-line per-client remediation hint keyed on the client identity already recorded at request time (#1426): - conflict-watch.ts: conflictClientOf() resolves pluginAgent ('mcp' falls through, #760b) then clientHint (exact scan-client names pass through; codex UA truncations normalize via isCodexClient); conflictRemediation() holds the opencode/claude/codex/pi/omp + generic map mirroring the doc anchors; CONFLICT_DOCS_POINTER. formatConflictSection() gains an optional client param and appends the Fix line + docs pointer; ConflictSummary gains clients[]. - acp_status passes this session's resolved client. - Web banner: one i18n line per distinct client (capped at 3, unknown -> generic, old payloads without clients[] degrade to generic only); session-detail card shows its own client's hint (new conflictClient field in the detail payload). - Launcher co-resident-plugin warning gains a 'fix (<client>)' line from the same map. - i18n zh+en conflict.hint.* keys; tests pin resolution, the map, the section suffix, clients[], i18n parity/drift, and web wiring. Guidance-only: detection gates/thresholds untouched (#2219 non-goal); no config surface changes.
…t is invisible to the #1024 i18n liveness gate CI caught it: tests/web-i18n.test.ts only sees literal t("…") / zh("…") / data-i18n references, so "conflict.hint." + cl read as five dead catalog keys. Replace the key builder with an explicit switch of literal branches (same rendered output for every input; whitelist mirrors the server map); unknown/absent clients still fall back to the generic line.
3844207 to
03c7964
Compare
[bot] 🏷 冲突已解决 — 结构化七问 分支已 rebase 到当前 master( 1. 是什么问题:master 滚动后 PR 与目标分支文本冲突(dirty),无法合并。冲突集中在三个文件: 2. 什么原因导致的:两个 PR 并行开发、先后落 master——#2261 在 3. 怎么修复的:逐 hunk 按意图取并集——imports 双保留; 4. 是否有回归问题:无。#2261 的 sibling 分类行为(脚注四分支、 5. 是否破坏缓存:不涉及——display-only,未触碰 wire/持久化/prefix-cache 路径。 6. 是否改了设计方向:否。唯一新增判断是 7. 是否引入新的配置:无。 判定:可合并(状态 clean,CI 全绿)——请人工 merge:#2220 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.131-master.5621457 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #2219
What
The compression-conflict surfaces told users WHAT happened (two compressors coexisting on one session) plus the generic imperative "keep exactly one compressor" — but no path to HOW. Answering correctly in the #917 board case (
unannounced-rewrite — 2/55 incoming message(s) carry pre-turn refs of 217 known, user: "keeps warning, don't know what to do") required digging out four separate doc locations, none linked from any conflict surface.This adds a short per-client remediation block to every conflict surface, keyed on the client identity already recorded at request time (#1426:
x-bili-pluginheader / wire UA fingerprinting):src/conflict-watch.ts— newconflictClientOf(session)(pluginAgent wins;mcpfalls through per #760b; clientHint exact scan-client names pass through, codex UA truncations normalize viaisCodexClient),conflictRemediation(client)(one-line map: opencode / claude / codex / pi·omp / generic fallback),CONFLICT_DOCS_POINTER.formatConflictSection()gains an optionalclientparam and appendsFix (<client>): …+ the docs pointer;ConflictSummarygainsclients[](distinct resolved clients of sessions carrying events).src/acp-status.ts— passes this session's resolved client into the section.clients[]degrade to generic only); the per-session conflict card on the Sessions page shows this session's own hint (newconflictClientfield in the detail payload). zh+enconflict.hint.*keys insrc/web/i18n.ts.src/launcher.ts— the pre-launch co-resident-plugin WARNING gains afix (<client>)line from the same map.Each hint is one line and points at CONFIGURATION.md → "Detecting other compression plugins (#1206)" for the full matrix instead of duplicating it.
Behavior changes (additive output only)
acp_statusconflict section: +2 lines (blank +Fix …+ docs pointer) whenever a session has conflict events — model-visible text grows slightly in that case only./__bili/status&/__bili/statsJSON: new additive fieldconflicts.clients(array; old consumers ignore it).conflictClient(absent when unresolvable or no conflicts).fix (<client>)line after each co-resident WARNING.No change to detection gates/thresholds (
src/session.tsunannounced-rewrite detector untouched — it worked correctly in the reported case); no config surface changes. Both compression modes unaffected (display-only, no wire changes).Tests
New
tests/conflict-remediation.test.ts: client-resolution order (incl.mcpfall-through and the #1641 token-level codex UA guard), the hint map (one-line invariant, generic fallback for dsh/kimi/hermes/zcode), the section suffix (active AND historical branches),summarizeConflicts().clients, zh/en i18n parity + server-map↔web-key drift guard, and functional extraction of the browser hint block (per-client lines, cap-at-3, unknown→generic, both locales) plus wiring drift guards. Existing suites re-run green: conflict-lifecycle, web-conflict-banner, issue1206-thirdparty-scan, web-sessions, text-safe, acp-status, launcher.