Skip to content

Windows: spawn EINVAL in watch capabilities (execFile without shell:true) #920

Closed

Description

@tamirdresher

Bug: Windows spawn EINVAL in watch capabilities that use execFile()

Environment

  • OS: Windows 11
  • Node: v22+
  • squad-cli: @bradygaster/squad-cli@0.9.4-insider.1
  • agency: 2026.4.8.1

Problem

Capabilities monitor-teams, monitor-email, retro, and decision-hygiene fail with spawn EINVAL on Windows when running watch --execute.

Root Cause

These capabilities use execFile(cmd, args, ...) without shell: true. On Windows, execFile cannot:

  1. Resolve bare command names (like gh) through PATH
  2. Execute .cmd/.bat wrapper scripts

The execute capability works fine because it handles this differently.

Additional Issue

These capabilities hardcode gh copilot --message but don't respect the agentCmd config. Users with copilot.exe (standalone WinGet) or agency CLI can't use these capabilities even with a working agentCmd configured.

Suggested Fix

  1. Add shell: true to the execFile options in spawnWithTimeout()
  2. Have all capabilities respect agentCmd from config (not just execute)

Workaround

Disable the broken capabilities in .squad/config.json:

{
  "watch": {
    "monitor-teams": false,
    "monitor-email": false,
    "retro": false,
    "decision-hygiene": false
  }
}

Output

spawn EINVAL on monitor-teams, monitor-email, retro, decision-hygiene

Activity

  1. tamirdresher commented on Apr 8, 2026

    @tamirdresher
    CollaboratorAuthor

    Clarification: gh copilot is the deprecated GH CLI extension. The current tool is standalone copilot (installed via WinGet at copilot.exe).

    The preferred pattern (matching the PS1 ralph-watch) is agency copilot --yolo --autopilot --mcp mail --agent squad -p <promptfile>.

    So the fix should be:

    1. All capabilities should respect agentCmd from .squad/config.json (not just execute)
    2. Stop hardcoding gh copilot — it's deprecated
    3. Add shell: true to execFile() calls on Windows so .cmd wrappers and PATH resolution work

    The agentCmd config already exists and works for execute — just wire it into the other capabilities too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions