Repository navigation
[Desktop 0.2.1-rc.2] 旧 inject 服务名令第三方插件静默 pending,侧栏 API 全量空体 405(复现 / 根因 / 修复路径 / 可诊断性建议) #10027
Replies: 1 comment
|
Your root-cause chain is right in every step, and the source shows two of them more sharply than the report does. There is also one item on your suggestion list that is already answered — a plugin now files the report the host composes and never writes. What the source says
The The message you read is one line, and the informative version exists but is unreachable for you.
That is the whole gap between your suggestion 2 and the shipped code: the diagnostic you want is already written, and only the branch that chooses warn instead of fail keeps it out of reach. The 405 comes from the static fallback, as you guessed. One correction: Your suggestion 2 already has an implementationI maintain
It subscribes to It is a detector, not a repairer: it cannot revive your On the compatibility aliasSuggestion 1 is the one I would not do. |
Uh oh!
There was an error while loading. Please reload this page.
环境
0.2.1-rc.2(win-x64,安装版;resources/app.asar内版本号与全部@deepseek-ai/dsh-*依赖 pin 均为 0.2.1-rc.2;桌面 nightly 通道自动更新)desktop;Windows 11;运行时为安装包自带 Node 24dsh-better-sidebar@0.24.1、dsh-univer-office@0.3.6、dshmarket@1.66.80.2.0-rc.2 → 0.2.1-rc.2(自动更新完成、未改动任何插件)现象
侧边栏里打开任意 Markdown 文件,预览区只显示红字
HTTP 405;同一插件的文件树刷新、git、编辑保存等数据面板一并失效,但插件 tab 与编辑器 UI 仍然渲染(能显示文件名与路径)。聊天主界面正常。抓包(Electron DevTools 等价结果):
插件前端把「非
{ok:...}JSON 的响应」统一兜底成HTTP ${status},所以用户最终只看到HTTP 405,无法从 UI 判断是宿主没挂载插件,还是插件路由写错。根因链
webRuntime被删除(现役服务是webStartup;`0.2.1-alpha.2` 删除了公开服务 `webRuntime`,但迁移指南挂在了 `v0.2.1-alpha.1` 目录下,release notes 也无提示|breaking change without an entry of its own #9598 已记录这个 breaking change 的文档归属问题)。dsh-better-sidebar@0.24.1仍声明inject = ["webServer", "sessions", "webRuntime", "tools"],请求栅栏里也仍读ctx.webRuntime.trustedHosts。pending (waiting for service: webRuntime);宿主只打一行dsh: warning: 1 entry did not activate,桌面用户看不到 stderr。/sidebar/api、/sidebar/file、/sidebar/html、/sidebar/bundle、/sidebar/ws/*全部没有注册;而客户端半包照常加载并渲染 UI。于是每个 POST 落到宿主静态兜底(只收 GET)→ 空体 405,GET → 404,WebSocket 升级握手失败。HTTP 405完全掩盖。快速自检(约 1 分钟,可复跑)
pending (waiting for service: webRuntime)/1 entry did not activate。webRuntime0 命中、webStartup多处命中:--dump-config、peer 检查、行加载全部是绿的 —— 现有静态检查无法发现这条故障。修复路径(按推荐度)
dsh-better-sidebar升到 0.28.0(npmlatest;devDependencies 钉@deepseek-ai/dsh-* 0.2.1-rc.1、peer^0.2.1-rc.1,客户端 inject 面已不再依赖webRuntime),然后重启 DSH。注意:升级/重装会覆盖下面第 2 条的热修。lib/index.js3 处webRuntime→webStartup(inject 项、ctx.webRuntime.trustedHosts、注释),完全退出 DSH 再启动(宿主插件树只在启动时组装)。本机已按第 2 条处理,重启后我会回来补充结果。
给宿主侧的建议(桌面场景优先)
webRuntime保留为 deprecated alias 一个 minor(读取时打一次性 warning 并指向迁移指南);或让 loader 在「inject 的服务名不存在」时给出比pending更明确的提示(缺失服务名 + 迁移指南链接)。现在这条 breaking change 只能靠翻源码、翻 alpha 目录里的指南才能发现(`0.2.1-alpha.2` 删除了公开服务 `webRuntime`,但迁移指南挂在了 `v0.2.1-alpha.1` 目录下,release notes 也无提示|breaking change without an entry of its own #9598)。pending (waiting for service: X)的条目显示为「未激活:缺少服务 X」,并提供一键复制诊断;dsh doctor增加 inactive-entry 检查。POST /xxx/api/*)被静态兜底后返回空体 405,会让插件作者与用户都误以为「插件路由方法写错」。建议返回结构化错误体(例如{"error":{"code":"route-not-found","message":"no plugin route registered for POST /sidebar/api/..."}}),或至少非空 body 并提示「宿主可能未挂载该插件」。inject做一次只读预检,升级后在 GUI 提示「N 个插件需要更新以适配本版本」,不阻塞启动即可。关联
0.2.1-alpha.2删除webRuntime、迁移指南挂在v0.2.1-alpha.1目录下、release notes 无提示omdsh-dev/DSH-better-sidebarbug: v4 flash 模型跑任务,一致报错工具不可调用 #931(含已验证热修与 0.2.1-rc.1/rc.2 复现)、ds你自己都不在源码上支持切换思维等级。本轮运行失败The `reasoning_content` in the thinking mode must be passed back to the API. INVALID_REQUEST #906English summary
On DSH Desktop
0.2.1-rc.2(Windows, nightly channel),dsh-better-sidebar@0.24.1never activates because it still injects the removedwebRuntimeservice (0.2.1 provideswebStartup). The host only logs1 entry did not activate/pending (waiting for service: webRuntime), which desktop users cannot see; the plugin's host half never mounts, so every/sidebar/api/*POST hits the static fallback and returns an empty-body 405 (GET 404, WS handshake fails) while the client half keeps rendering and surfaces onlyHTTP 405in the UI. Fix: upgrade the plugin to0.28.0(built against dsh 0.2.1-rc.1), or hot-patch the threewebRuntimereferences towebStartupinlib/index.jsand restart. Host-side asks: (a) a deprecation alias or a precise loader diagnostic for unknown injected services; (b) desktop-visible pending-plugin diagnostics (settings/plugin page,dsh doctor); (c) a structured JSON fallback for unmatched API-like paths instead of a bare empty 405; (d) an upgrade-time read-only compatibility precheck over installed plugins'injectlists, reported in the GUI without blocking startup.All reactions