Bug Description
When a channel is configured with cwd set to a path starting with ~ (tilde), such as "~/xomo", running qwen channel start <name> fails with the error:
Error: spawn /usr/bin/node ENOENT
This error message is misleading — the actual issue is that the cwd path ~/xomo is passed verbatim to Node.js child_process.spawn() without tilde expansion. The kernel cannot find the working directory, causing the spawn to fail with ENOENT, which bubbles up as if the node binary is missing.
Running qwen channel start (no name, which uses process.cwd()) works fine, while qwen channel start <name> (which uses the configured cwd) fails.
Steps to Reproduce
- Add a channel to
settings.json with a tilde path:
{
"channels": {
"xomo": {
"type": "weixin",
"cwd": "~/xomo",
"model": "qwen3.6-plus"
}
}
}
- Run
qwen channel start xomo
- Observe the
spawn /usr/bin/node ENOENT error
Expected Behavior
The cwd path should have tilde expanded to the user home directory (e.g., ~/xomo → /home/admin/xomo), and the channel should start successfully.
Alternatively, the error message should indicate that the cwd directory does not exist, rather than misleadingly suggesting the node binary is missing.
Workaround
Use an absolute path instead of ~:
{
"cwd": "/home/admin/xomo"
}
Environment
- Qwen Code version: 0.15.9
- OS: Linux (Ubuntu)
- Node.js: v22.22.2
Root Cause
In AcpBridge.start() (packages/channels/base/dist/AcpBridge.js), the spawn call passes cwd directly without tilde expansion:
this.child = spawn(process.execPath, args, {
cwd: cwd6, // "~/xomo" is not expanded
stdio: ["pipe", "pipe", "pipe"],
env: { ...process.env },
shell: false
});
The fix should expand the tilde in cwd before passing it to spawn, likely in parseChannelConfig or startSingle.
Bug Description
When a channel is configured with
cwdset to a path starting with~(tilde), such as"~/xomo", runningqwen channel start <name>fails with the error:This error message is misleading — the actual issue is that the
cwdpath~/xomois passed verbatim to Node.jschild_process.spawn()without tilde expansion. The kernel cannot find the working directory, causing the spawn to fail withENOENT, which bubbles up as if the node binary is missing.Running
qwen channel start(no name, which usesprocess.cwd()) works fine, whileqwen channel start <name>(which uses the configuredcwd) fails.Steps to Reproduce
settings.jsonwith a tilde path:{ "channels": { "xomo": { "type": "weixin", "cwd": "~/xomo", "model": "qwen3.6-plus" } } }qwen channel start xomospawn /usr/bin/node ENOENTerrorExpected Behavior
The
cwdpath should have tilde expanded to the user home directory (e.g.,~/xomo→/home/admin/xomo), and the channel should start successfully.Alternatively, the error message should indicate that the
cwddirectory does not exist, rather than misleadingly suggesting the node binary is missing.Workaround
Use an absolute path instead of
~:{ "cwd": "/home/admin/xomo" }Environment
Root Cause
In
AcpBridge.start()(packages/channels/base/dist/AcpBridge.js), the spawn call passescwddirectly without tilde expansion:The fix should expand the tilde in
cwdbefore passing it tospawn, likely inparseChannelConfigorstartSingle.