Repository navigation
fix(acp): hand Qoder launch settings as a file on Windows - #1101
leehom0123 wants to merge 1 commit into
Conversation
|
建议将修复点放到 Windows 的 Qoder 启动解析:解析到真实 CLI 后直接启动,让原来的 文件参数能解决常规路径下的 JSON 引号问题,但 直接返回文件路径 仍依赖“路径经过包装层保持原样”。Qoder 1.1.84 的官方 PowerShell dispatcher 明确允许再调用 npm 的 建议按以下范围实施:
这是一份待实施、待 Windows 验证的替代设计计划;尚未提交实现,也没有改动你的 PR 分支。 |
On Windows the resolved `qoder` command is a cmd wrapper whose
dispatcher strips the quotes from the inline
`--settings {"mcp":{"lazyLoad":false}}` JSON before qodercli sees it,
so the ACP handshake dies ~1s in with `config_error`. Resolve the
wrapper to the program behind it by the rules the wrappers themselves
apply (official installer: QODER_CLI_BIN, PATH, user-install location;
npm: the package entry run by the shim's Node), and spawn that
directly so argv reaches the CLI whole. Version detection and
diagnostics probe that exact program; a wrapper codeg cannot place a
CLI behind is an error naming the wrapper, never a silent switch to
another installation.
e986ea9 to
33dbfd6
Compare
|
已按建议改为 Windows 的 Qoder 启动解析,最新提交 33dbfd6:
有意做简于草案的一点:连接前不额外跑 测试:qoder 模块 87 个用例(含真 Node 下断言 argv 原样收到 settings JSON),全量 lib 6022 个用例通过;Windows 真机 1.1.84 实测 initialize 握手成功。unix 侧模块无 cfg 门,编译由 CI 覆盖。 |
What
Qoder 1.1.84 起 codeg 用
--settings '{"mcp":{"lazyLoad":false}}'关掉 MCP 懒加载(6fcb9ea8)。Windows 上这个内联 JSON 到不了 CLI:qoder解析到官方安装器的qoder.cmd,它把%*转给 PowerShell-File脚本,PowerShell 的命令行解析器把 JSON 内嵌的双引号当字符串引号剥掉,qodercli 收到{mcp:{lazyLoad:false}},判定无效 JSON,握手约 1 秒后 exit 1(config_error),codeg 侧表现为Initialize failed: incoming transport closed。Fix
qodercli 对非
{...}的--settings值按文件路径读取,且纯路径不含引号、可在任何二次解析层中原样存活。Windows 上 codeg 把 settings 写到<codeg_home>/acp-launch/qoder-settings.json,传文件路径;unix 保持内联 JSON(exec 直传 argv,无解析层)。写文件失败时回退内联(行为不劣于修复前)。Verify
cmd /c qoder.cmd --acp --settings <json>→ config_error),改用文件路径后initialize正常应答。cargo check/cargo clippy/ 相关 lib 测试通过(server-bin feature,--lib qoder75 个用例全过)。