cursor-agent --print returns output correctly but the process never exits. The worker subprocess continues running after the task completes, requiring manual termination or a timeout wrapper.
Steps to Reproduce
~/.local/bin/cursor-agent --print text “what is 2+2” --model grok
Expected Behavior
Process prints response and exits.
Operating System
Linux
Version Information
CLI Version 2026.01.28-fd13201
Model Grok
OS linux (x64)
Terminal konsole
Shell bash
Additional Information
Happens with all models tested (grok, gemini-3-flash)
--list-models works fine and exits normally
Did some strace debugging - looks like a worker subprocess keeps running after the main task completes
Hey, thanks for the detailed strace report, it’s really helpful.
This looks like a known type of issue with the CLI hanging. I’ve shared it with the team.
For now, the timeout workaround is the best option. If you spot anything interesting in the strace output, like which exact subprocess is stuck, drop it here, it could help with debugging.
I tested it a few times and it exits now. Still odd that it takes 30-55 seconds to do 2+2.
$ time agent -p 'what is 2+2?' --model composer-2-fast
**4**
beep boop 🤖
real 0m55.439s
user 0m3.070s
sys 0m1.078s
willy@workinux:~
$ time agent -p 'what is 2+2?' --model composer-2-fast
Four.
beep boop 🤖
real 0m36.261s
user 0m3.020s
sys 0m0.971s
willy@workinux:~
$ time agent --version
2026.05.05-84a231c
real 0m0.506s
user 0m0.611s
sys 0m0.077s
Following up on this thread with a CI/automation case that looked like the same
“-p hangs with zero output” bug but had a different root cause and a workable fix.
Environment
CLI:2026.07.08-0c04a8a (installer on 2026-07-08)
Host: self-hosted GitHub Actions runner, Linux ARM64, Docker
Use case: automated PR review via agent --print --plan --trust in GitHub Actions
agent --print --plan --trust --output-format text --api-key "$KEY" "$BIG_PROMPT"
Wall time ~5–6 minutes (roughly constant regardless of PR size)
Exit code 0
Empty stdout and stderr
ss during failure showed ESTAB connections to GitHub/Azure — not stuck SYN-SENT
So this was not TerryZ’s TCP-retry pattern (we had working connections) and not
Silas’s “no TCP at all” IPC hang — though the user-visible symptom is identical:
silent freeze, then exit 0 with nothing printed.
What did work
Smoke tests on the same runner, same CLI, same API key:
Command
Result
agent --list-models
OK (~1s)
agent -p --trust "Say hello"
OK (~12–25s) → Hello.
agent -p --plan --trust + tiny one-line prompt
OK (~11s) → APPROVE
So basic headless --printworks. Only the full review prompt failed.