Repository navigation
fix: pin dsh mcp_catalog durable-state carrier (#2446) - #2547
Conversation
dsh-skill-mcp-manager (third-party dsh plugin) injects the MCP server inventory as a durable user-role message (system-reminder wrapper around a mcp_catalog block, ~5K tokens in the report) and re-emits it only when the visible MCP/skill set changes — one fold silently kills the session's server inventory forever. Fourth dsh durable carrier, first whose emitter is the dsh plugin ecosystem rather than dsh core; same evidence bar as #2419/#2447/#2481 (shape + stability from the #2446 report, authored by the plugin's own author). Lane-scoped via the existing KDD #9 evidence-permitlist registry.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2727-pr.2547.f7a11f9This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2547.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Review 完成。已拉分支核对代码、本地跑定向测试、逐格查 CI。结论:可合(human merge;CI 唯一红格与本 diff 无关,属既有 flake,已立项跟踪)。 结构化八问1. 是什么问题:dsh-skill-mcp-manager 插件注入的 MCP 服务器目录( 2. 什么原因导致的:宿主把全会话基础设施当一次性 user 消息注入,ACP 压缩把每条历史当可折叠材料,且重注入有指纹门控——折叠与重发机制结构性冲突。与 #2419/#2447/#2481 同族(第四个载体,首个发射方为 dsh 插件生态而非核心)。本 PR 修在决策点:kernel 3. 影响范围与严重程度:仅 dsh plugin lane( 4. 怎么修复的:dsh 泳道注册表 OR 入第四谓词 5. 是否有回归问题:审过的既有行为逐项结论——
6. 是否破坏缓存:不。受护消息原地常驻(anchor 不动、永不折),比折掉更利于前缀缓存(零字节漂移,#2446 分析已确认);未触碰任何失效/重试/去重策略。 7. 是否改了设计方向:没有。沿用既定机制(kernel 泛化钩子 + host 侧 per-lane 策略表),只加第四个条目。 8. 是否引入了新的配置:无。无新 env/config/默认值。 CI 状态与 flake 定性矩阵 23 格绿,唯一红:
处置:已立项 #2548(带来源标记,含受影响位置清单与两层修法建议:确定性方案=保持 live unhealthy 服务器占位不再释放端口;过渡=5 处调用点包 测试有效性(质量关)新套件 4/4,断言有牙:①守卫单测矩阵含负例(小写 prose / #2419 相邻载体 / 非 text / undefined text 均可折)且钉死注册表 dsh-only;②真 判定:可合。 合并后请留意 #2446 proxy-mode 半区的拍板(方案 A/B 在 floor 8),那是本 PR 刻意留下的另一半。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.196-master.055caad # this exact build
npm install -g billion-context@master # always the newest merged build
|
…nxianglei#2548) zcode-native's deadOrigin() released its listen(0)+close port and assumed it stayed dead; under parallel 'npm test' another process could rebind it inside the 300ms health window, so probeProxyHealth saw a live answer and the expected refusal flipped to an active attach (the ranxianglei#2547 CI flake). Replace it with a live server bound for the whole test that answers 500 - probeProxyHealth judges a 500 answer unhealthy - so the unhealthy expectation is constructed, not assumed: the race is closed rather than narrowed. upstream-alerts' freePort() feeds a connect-refused assertion, which cannot be constructed with a live server (hang = connect-timeout, 500 = a real response); guard its real consumer with assertPortDead right before the first dial, matching log-mask (ranxianglei#1689). The banner site never dials the port (/__bili/overview reads fs/in-memory state only), so it is left unchanged - adding a guard there would introduce a new flake. Closes ranxianglei#2548
What
Fourth dsh durable-state carrier: the MCP server catalog injected by the third-party plugin
dsh-skill-mcp-manager— asystem-reminder-wrapped<mcp_catalog>block (~5K tokens, 11 servers + tool-schema digests in the #2446 report). The plugin re-emits it only when the visible MCP/skill set changes, so one fold silently kills the session's server inventory forever; the report's failure mode is the model hunting for MCP servers by wrong names mid-session. Reporter verified viadecompressthat the originals were intact — the loss happens at fold time, exactly the #2419/#2447/#2481 mechanism family.Fix
Extend the dsh lane entry in
src/durable-message-guards.tswithdshMcpCatalogGuard(text.includeson the<mcp_catalog>marker, matched on its own rather than on the wrapper — same rationale as #2419). No kernel change: the genericConfig.isMessageProtectedhook (kernel 0.0.108, merged via #2428) already covers any content type; the POLICY (which shapes, which lane) lives host-side by design.First guard entry whose emitter is the dsh plugin ecosystem rather than dsh core. Same KDD #9 evidence bar as the previous three: marker shape from the #2446 report, stability owned by the plugin's author — who filed the report.
Scope note (deliberately NOT in this PR)
The reporter runs proxy mode (no
x-bili-pluginlane), where the lane-keyed registry structurally cannot fire — even the three merged guards don't cover him. That gap needs an owner decision on the escape hatch (user-facingcompress.protectedContentMarkersvs a self-declared<bili-durable>injector opt-in marker); both proposals are laid out in the #2446 triage comment for the owner. This PR fixes the plugin-lane half only and does not close the issue.Tests
tests/issue2446-dsh-mcp-catalog.test.ts(4 tests, pattern of #2481's suite): guard unit matrix (wrapper + bare marker match; lowercase prose / the #2419 skill-catalog carrier / non-text / undefined text stay foldable; lane entry covers all four carrier shapes; registry stays dsh-only) · dsh-lane fold survival through a real/__bili/plugin/toolcompress whose range positionally covers the catalog · unregistered lane folds it away (pins lane scoping) · BLOCKED ref stamped at assignment time.Regression family: issue2419 + issue2447 + issue2481 suites 12/12 green;
npm run typecheckclean.§7.4 self-check
Not auto-merge eligible (message-protection policy, same review tier as #2428): single-module change, regression tests present, clean diff, refs #2446 without auto-close (proxy-mode half remains owner-gated).