fix: omit --mode agent (cursor-agent rejects it as default) (#23)
cursor-agent's --mode flag only accepts plan or ask. Passing "--mode agent"
causes the CLI to exit 1 with:
error: option '--mode <mode>' argument 'agent' is invalid.
Allowed choices are plan, ask.
Agent is cursor-agent's default behavior when no --mode is provided.
This broke every request whose effective mode resolved to "agent",
which is the default for many integrations (e.g. anthropic /v1/messages
clients that don't set body.mode).
Fix: skip emitting --mode when mode === "agent" in both the direct CLI
arg builder (agent-cmd-args.ts) and the ACP arg rewriter (agent-runner.ts).
Add unit coverage for all three modes.
Verified end-to-end against cursor-agent 2026.* with an Anthropic Messages
client: agent mode now successfully creates files and runs shell commands
through cursor-agent's tool harness.
Co-authored-by: Ayoub Etters <ayoub.e@valnetinc.com>
Co-authored-by: Cursor <cursoragent@cursor.com> E
ETTERS committed
423f5aabe0414fba538b84ca90a7469d3c6d878b
Parent: 69b270a
Committed by GitHub <noreply@github.com>
on 5/18/2026, 1:32:15 PM