0.1.5-rc.1:connection.rpc.handle() 无法注册插件 RPC 通道(浏览器端一律 HTTP 405) #6105
Replies: 2 comments 1 reply
|
Reproduced in-tree on This is the same defect as #5926. Both reports describe
Rows 3 and 4 are identical, so declaring Why CI is blind to it: Where the binding lives, for the fix:
So the dedicated-channel registry is the one path that is not carrier-neutral, and the package already contains the pattern that is. Two data points on fixes:
Blast radius, for prioritisation: nothing in Disclosure of scope: measured on |
|
复现、定位、修复、验证 —— 都在隔离环境里做完了,补一条完整结论。 这不是竞态,是必然抛错。 // dsh-client-connection/lib/index.js
const owner = this.ctx; // :541 —— 只有 webRuntime
handle: (channel, handler) => this.register(owner, channel, handler), // :543
...
return owner.effect(() => owner.webServer.register(route), ...); // :618 —— 必然抛错官方 ctx.inject(["webServer"], (webCtx) => { // :758
webCtx.effect(() => webCtx.webServer.register(route), ...); // :781
});包自己的注释写着它在“ 复现证据(隔离 DSH_HOME + 独立端口)修复(一行)- id: connection
inject: [webRuntime, webServer]修后:插件日志变成 我把它打包成了组合包(官方分发形态,验证过以 bundle 形式交付同样有效):dsh-connection-rpc-fix —— |
Uh oh!
There was an error while loading. Please reload this page.
环境
@deepseek-ai/dsh0.1.5-rc.1(Windows 11 / Node v26.8.2 / profileweb)@deepseek-ai/cordis4.0.2dsh-mnemon0.5.5(0.5.6 代码相同)、dsh-billing0.4.1现象
升级到 0.1.5-rc.1 后,凡是通过
connection.rpc.handle()注册的浏览器 RPC 通道全部失效:/dsh-mnemon-settings/get/dsh-mnemon-read/status-summary/dsh-mnemon-read/source-management-catalog/billing/balance前端表现为面板报
transport failure … HTTP 405(如记忆系统面板显示Mnemon 尚未就绪)。对照:走
ctx.webServer.register()直接注册的路由(例如/dsh-skill-picker/list)返回 200 —— webserver 与浏览器鉴权本身正常,问题只出在rpc.handle这一条链路。宿主侧自检:
webServer.match('/dsh-mnemon-read/status-summary')→ no-match,即前缀路由从未注册(405 来自静态回退:非 GET 一律 405)。最小复现(不依赖任何第三方插件,12 行)
实际输出:
调用方上下文确实注入了
webServer(第 1 行),直接webServer.register()也正常(第 2 行)——失败只发生在rpc.handle()内部。根因分析
@deepseek-ai/dsh-client-connection(0.1.5-rc.1):0.1.5 把 connection 改为 carrier-neutral(README:「Host half always provides the carrier-neutral RPC and exact GET/HEAD/POST route registries. When a Web carrier is present it also owns the sole
/apiroute …」)之后,该上下文不再注入webServer;而@deepseek-ai/cordis@4.0.2的ReflectService.handler.get对「未注入即访问服务」是抛错而非返回undefined:于是注册在
effect内失败并被静默吞掉 —— 通道丢失。因为rpc.handle是同步抛出,插件侧若不 try/catch 会直接报错,但没有任何线索指向 webServer。补充:内核 200+ 个包中没有任何一处调用
rpc.handle,因此该回归不在上游自测覆盖范围内。建议修复(任一)
this.ctx;owner.webServer;webServer时不要静默,至少打一条 warn —— 否则插件作者完全看不到发生了什么。临时规避(本机已采用,不影响 node_modules)
用 12 行覆盖层插件把 owner 换成注入了
webServer的上下文:实测效果:
/dsh-mnemon-read/status-summary、/dsh-mnemon-settings/get、/billing/balance三个通道由no-match→ 命中;浏览器端 405 → 200;记忆系统面板恢复真实数据(存储位置 已连接、记忆引擎 dsh-mnemon 0.5.5 插件运行正常、记忆空间 1/1 · 83 条激活记忆、项目档案 50 份活跃)。上游修好后该插件即可删除。相关
(另注:0.1.5 把全部
@deepseek-ai/dsh-*包统一编号为0.1.5-rc.1,第三方插件按旧口径声明的peerDependencies(如^0.1.0-rc.6)会大面积失配。这是编号口径变化,运行时无影响,但会在兼容性面板产生大量误报,或可作为单独话题讨论。)All reactions