Skip to content

Windows: builder fails to start when Defender blocks the launch command line; pass the prompt by file, not as arguments #1937

Open

Description

@amrmelsayed

Problem

On native Windows a builder can fail to start, looping forever on:

.builder-start.sh: line 23: /c/Users/<user>/.local/bin/claude: Permission denied
Agent exited (code 126). Resuming the conversation in 2 seconds...
No conversation found with session ID: ...
Agent failing immediately (code 1). Starting a fresh conversation with the original prompt...

The launch script generated in packages/codev/src/agent-farm/commands/spawn-worktree.ts passes the whole builder prompt (which inlines the issue body) and the role text as command-line arguments to the harness. Microsoft Defender inspects process command lines. When the issue text reads like a list of process-launching calls and system tool names, Defender classifies the command line as a threat and Windows refuses to create the process. Git Bash reports that refusal as "Permission denied".

Seen on 2026-11-20 spawning a PIR builder for #1911. Confirmed by:

  • Defender's protection history holds one detection per relaunch, each quoting the builder command line.
  • The same prompt text passed as an argument to any other program is refused the same way, from Git Bash and from PowerShell.
  • The harness starts normally with short arguments, and a 20,000-character plain-text argument is accepted, so this is content, not length.

Nothing recovers on its own: the fresh launch is blocked, the resume attempt finds no session, and the script starts over. Each pass adds another severe detection to the machine's security history. Mail sent to the builder is held with busy:no-composer-marker, which points the operator at the render gate instead of the real cause.

Fix

  1. Keep prompt and role text off the command line. The launch script already writes .builder-prompt.txt and .builder-role.md; hand them to the harness by file or standard input instead of expanding them into arguments. Apply this to every launch form in the script (entry, pinned, unpinned) and to each supported harness, on all platforms. Check each harness's documented options for reading a prompt and an appended system prompt from a file before choosing the mechanism.
  2. Stop the relaunch loop when the harness cannot be started at all. Exit code 126 or 127 from the first launch is not a crashed conversation; print one clear message naming the likely causes (security software blocking the launch, harness not installed) and stop instead of retrying.

Verification

Notes

Activity

  1. added
    area/tower
    on Nov 20, 2026
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

    area/tower

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions