Summary
On Windows, when a Cursor agent task prompt contains CLI-like flags (e.g. Go ldflags with -X), cursor-agent exits immediately with:
error: unknown option '-X'
cursor-agent exited with error: exit status 1
The task fails in ~1–2s with failure_reason=agent_error.process_failure and produces no agent output.
This is not the multi-line prompt truncation fixed by #1297 / PR #1709: daemon logs already show the PowerShell -File rewrite path is active (cursor-agent: routing through powershell -File to preserve argv tokens).
Environment
- OS: Windows 10/11 (amd64)
- Multica CLI/daemon: 0.4.2 (also reproduced on 0.4.4-era daemon behavior per local logs)
- cursor-agent: 2026.07.16-899851b
- Provider:
cursor via Cursor runtime
- Launch path:
pwsh.exe -NoProfile -ExecutionPolicy Bypass -File cursor-agent.ps1 -p <prompt> ...
Steps to reproduce
-
On Windows, run Multica daemon with a Cursor runtime.
-
Trigger a comment task whose prompt body includes a pasted build log containing:
go build -ldflags "-X main.version=foo -X main.commit=bar" -o bin/server ./cmd/server
(In our case this came from a user @mentioning an agent with CI build output in the issue comment.)
-
Observe the task fail within ~2 seconds.
Expected behavior
The full comment/prompt text should be passed to cursor-agent -p as prompt content. Flags inside the prompt (like -X main.version=...) must not be parsed as cursor-agent CLI options.
Actual behavior
Daemon stderr shows:
[cursor:stderr] error: unknown option '-X'
cursor-agent finished status=failed duration=~2s
agent finished status=failed tools=0 output_bytes=0
buildCursorArgs currently passes:
args := []string{
"-p", prompt,
"--output-format", "stream-json",
"--yolo",
}
Even with Windows chooseCursorInvocation routing through powershell -File, prompt content that looks like CLI flags appears to leak into option parsing.
Related issues (not duplicates)
Suggested fixes
Any of these would likely work:
- Pass prompt via stdin / temp file instead of
-p <huge string> when it contains ambiguous tokens.
- Insert
-- after -p (if supported by cursor-agent) before prompt args.
- Escape or quote prompt so
cursor-agent.ps1 cannot re-tokenize embedded -X flags.
- Regression test: Windows fake
cursor-agent that asserts prompt argv containing -ldflags "-X main.version=..." arrives as a single -p value.
Minimal repro log excerpt
INF cursor-agent: routing through powershell -File to preserve argv tokens
INF agent command exec=pwsh.exe args=[-NoProfile -ExecutionPolicy Bypass -File .../cursor-agent.ps1 -p ... go build -ldflags "-X main.version=..." ...]
DBG [cursor:stderr] error: unknown option '-X'
INF cursor-agent finished status=failed duration=2.037s
Happy to provide full daemon debug logs on request.
Summary
On Windows, when a Cursor agent task prompt contains CLI-like flags (e.g. Go
ldflagswith-X),cursor-agentexits immediately with:The task fails in ~1–2s with
failure_reason=agent_error.process_failureand produces no agent output.This is not the multi-line prompt truncation fixed by #1297 / PR #1709: daemon logs already show the PowerShell
-Filerewrite path is active (cursor-agent: routing through powershell -File to preserve argv tokens).Environment
cursorviaCursorruntimepwsh.exe -NoProfile -ExecutionPolicy Bypass -File cursor-agent.ps1 -p <prompt> ...Steps to reproduce
On Windows, run Multica daemon with a Cursor runtime.
Trigger a comment task whose prompt body includes a pasted build log containing:
go build -ldflags "-X main.version=foo -X main.commit=bar" -o bin/server ./cmd/server(In our case this came from a user @mentioning an agent with CI build output in the issue comment.)
Observe the task fail within ~2 seconds.
Expected behavior
The full comment/prompt text should be passed to
cursor-agent -pas prompt content. Flags inside the prompt (like-X main.version=...) must not be parsed ascursor-agentCLI options.Actual behavior
Daemon stderr shows:
buildCursorArgscurrently passes:Even with Windows
chooseCursorInvocationrouting throughpowershell -File, prompt content that looks like CLI flags appears to leak into option parsing.Related issues (not duplicates)
%*mangling multi-line prompts; fixed by PR fix(agent/cursor): route Windows launcher through PowerShell -File to… #1709. Our repro already uses the PS-Filepath.unknown option '--effort'from a stale Claude binary chosen by a racing daemon, not prompt content.Suggested fixes
Any of these would likely work:
-p <huge string>when it contains ambiguous tokens.--after-p(if supported by cursor-agent) before prompt args.cursor-agent.ps1cannot re-tokenize embedded-Xflags.cursor-agentthat asserts prompt argv containing-ldflags "-X main.version=..."arrives as a single-pvalue.Minimal repro log excerpt
Happy to provide full daemon debug logs on request.