Skip to content

Gateway fails to start - hardcoded dev paths in bundled binary (ENOENT /Users/steipete/Projects/clawdis/...) #60

@austinm911

Description

@austinm911

Description

The macOS app (v2.0.0-beta4) fails to start the gateway because the bundled clawdis binary contains hardcoded absolute paths from the build environment that do not exist on end-user machines.

Steps to Reproduce

  1. Download and install Clawdis.app (v2.0.0-beta4)
  2. Launch the app
  3. Observe "Health check failed: Cannot reach gateway at localhost:18789"
  4. Check Settings → General → shows "Last failure: launchd start timeout"

Expected Behavior

The gateway should start automatically when running in "Local (this Mac)" mode.

Actual Behavior

Gateway crashes immediately on startup with:

ENOENT: no such file or directory, open '/Users/steipete/Projects/clawdis/node_modules/@mariozechner/pi-coding-agent/dist/package.json'

Log Output

From /tmp/clawdis/clawdis-gateway.log:

Bun v1.3.5 (macOS arm64)
79024 |   __filename2 = import_url.fileURLToPath("file:///Users/steipete/Projects/clawdis/node_modules/@mariozechner/pi-coding-agent/dist/config.js");
79025 |   __dirname2 = import_path40.dirname(__filename2);
79026 |   pkg = JSON.parse(import_fs2.readFileSync(getPackageJsonPath(), "utf-8"));
                                                  ^
ENOENT: no such file or directory, open '/Users/steipete/Projects/clawdis/node_modules/@mariozechner/pi-coding-agent/dist/package.json'
    path: "/Users/steipete/Projects/clawdis/node_modules/@mariozechner/pi-coding-agent/dist/package.json",
 syscall: "open",
   errno: -2,
    code: "ENOENT"

Environment

  • Clawdis Version: 2.0.0-beta4
  • CLI Location: /opt/homebrew/bin/clawdis
  • macOS: arm64
  • Bun: v1.3.5

Root Cause

The Bun-compiled binary has __filename / __dirname paths baked in from the build machine (/Users/steipete/Projects/clawdis/...). The @mariozechner/pi-coding-agent package uses these paths to locate its package.json at runtime.

Possible Fixes

  1. Ensure pi-coding-agent's getPackageJsonPath() does not rely on __dirname in bundled builds
  2. Inline the required package.json data at build time
  3. Use Bun's --compile with proper asset embedding

Workaround

None practical for end users - requires either:

  • Building from source
  • Creating fake paths on disk (not recommended)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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