fix(desktop): bind MCP lifecycle to one Node runtime#3455
Conversation
2beaf0b to
d84ff2c
Compare
t8y2
left a comment
There was a problem hiding this comment.
I'm going to request changes for now. The runtime paths are kept coherent, but runtime compatibility is still not enforced.
NodeRuntime::probe records the selected Node version, and prefer_runtime immediately accepts any runtime whose npm root contains the MCP script. @dbx-app/mcp-server requires Node >=22.13.0, so with a shared global npm prefix an older Node earlier in PATH can see a package installed by Node 22 and still be selected. DBX would then generate an absolute old-Node + MCP-script command that cannot start the server.
Please reject incompatible Node runtimes before they can win selection (or validate the package's engines.node) and add a regression test covering an old PATH Node sharing an npm root with a later compatible runtime. Since this PR also changes Windows-specific runtime discovery, please run the Windows-only tests on Windows as part of the update.
d84ff2c to
7bcedaa
Compare
|
已补充 Node.js >=22.13.0 兼容性检查和共享 npm root 的回归测试;Windows 专项 CI 已通过,并已在 Windows/macOS 真机确认 UI 安装后的运行时路径一致。请再次 review。 |
|
Thanks for the contribution! Merged in 872e59f, will be released in the next version. |
变更说明
修复 DBX Desktop 安装、检测和启动 DBX MCP Server 时可能使用不同 Node.js 运行时的问题。
本 PR 将 DBX 管理的 MCP 生命周期绑定到同一个 Node/npm 运行时:
@dbx-app/mcp-server时,使用选定 Node 安装目录下对应的 npm CLI。node、npm root -g或 npm shim。node路径和绝对dist/index.js路径启动 MCP Server,避免#!/usr/bin/env node在后续PATH中解析到另一个 Node。变更类型
涉及前端
本 PR 涉及前端配置生成逻辑,但不涉及 UI 布局、样式或交互视觉变化;改动点是 AI 设置中生成 Codex MCP 配置时的
command/args内容。无可视 UI 差异;已通过 DBX Desktop UI 安装 MCP 后手动验证生成路径和 MCP 调用链路。
验证
make check通过make cargo-check-fast通过已执行:
cargo fmt --all --checkmake checkmake cargo-check-fastcargo test -p dbx commands::mcp::tests --no-default-featurescargo test --workspace --no-default-featuresgit diff --check手动验证:
@dbx-app/mcp-server,确认 DBX 能解析并用同一个 Node/script 组合启动 MCP。.nvmrc对应的 fnm Nodev22.13.0下。dist/index.js路径初始化 MCP,并执行 RedisDBSIZE工具调用成功。关联 Issue
N/A