Skip to content

channel start: cwd with ~ (tilde) fails with misleading ENOENT error #3998

@qqqys

Description

@qqqys

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

  1. Add a channel to settings.json with a tilde path:
{
  "channels": {
    "xomo": {
      "type": "weixin",
      "cwd": "~/xomo",
      "model": "qwen3.6-plus"
    }
  }
}
  1. Run qwen channel start xomo
  2. 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.

Metadata

Metadata

Assignees

Labels

category/cliCommand line interface and interactionscope/settingsSettings and preferencestype/bugSomething isn't working as expected

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions