Skip to content

[BUG] macOS: spawn ENOENT error due to spaces in Application Support path #474

@eddie333016

Description

@eddie333016

Bug Description

Auto-Claude fails to spawn Python processes on macOS with error:

[ERROR] spawn /Users/ed/Library/Application ENOENT

This affects all macOS users because the default app data directory ~/Library/Application Support/ contains a space in the path.

Root Cause

The parsePythonCommand() function naively splits the Python path on spaces to handle commands like py -3, but this breaks file paths containing spaces:

Current buggy code (apps/frontend/src/main/index.js line ~2743):

function parsePythonCommand(pythonPath) {
  const parts = pythonPath.split(" ");  // BUG: Splits file paths with spaces!
  const command = parts[0];
  const baseArgs = parts.slice(1);
  return [command, baseArgs];
}

When given /Users/ed/Library/Application Support/auto-claude-ui/python-venv/bin/python, it incorrectly splits into:

  • Command: /Users/ed/Library/Application
  • Args: ["Support/auto-claude-ui/python-venv/bin/python"]

This causes spawn() to fail with ENOENT because /Users/ed/Library/Application is not an executable.

Proposed Fix

Check if the path is a file path before splitting on spaces:

function parsePythonCommand(pythonPath) {
  // Check if this is a file path (starts with / or ~ or contains path separators)
  const isPath = pythonPath.startsWith("/") || pythonPath.startsWith("~") || 
                 pythonPath.includes("/") || pythonPath.includes("\\\\");
  
  if (isPath) {
    // It's a file path, don't split on spaces
    return [pythonPath, []];
  }
  
  // It's a command like "py -3", split on spaces
  if (pythonPath.includes(" ")) {
    const parts = pythonPath.split(" ");
    const command = parts[0];
    const baseArgs = parts.slice(1);
    return [command, baseArgs];
  }
  
  // Simple command like "python3"
  return [pythonPath, []];
}

Impact

This bug completely breaks Auto-Claude on macOS because it prevents:

  • Running any Python scripts via the app
  • Creating virtual environments
  • Installing dependencies
  • Executing tasks
  • Merge operations
  • Preview operations
  • Changelog generation

Locations Affected

  • apps/frontend/src/main/index.js line ~2743 (parsePythonCommand function)
  • Called by:
    • TASK_WORKTREE_MERGE handler (line ~8344)
    • TASK_WORKTREE_MERGE_PREVIEW handler (line ~8619)
    • ChangelogGenerator.generate (line ~2836)

Steps to Reproduce

  1. Install Auto-Claude on macOS from DMG
  2. Launch the app
  3. Try to run any task or operation that uses Python
  4. Observe spawn /Users/<user>/Library/Application ENOENT error

Expected Behavior

Python processes should spawn successfully regardless of spaces in the path.

Environment

  • OS: macOS 14.x (Apple Silicon)
  • Auto-Claude: Latest release (DMG installer)
  • Path: ~/Library/Application Support/auto-claude-ui/python-venv/bin/python

Severity

Critical - Affects all macOS users, makes app completely non-functional.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions