Hi @Bingnan_Zhang,
Thanks for the detailed report, but this isn’t a parser bug.
I ran your exact four commands on a current build (headless, non-TTY): all four exited with 0 and produced normal output — both the -p/-P cases and the -- one — with the prompt preserved verbatim. It’s never scanned for embedded options.
What you’re hitting is a startup stall: in headless mode, the CLI can emit nothing for ~20-30s. Exit 137 is your caller’s timeout SIGKILLing it during that silent window - hence “0 bytes + 137.” The -p/-P link is a coincidence (every letter took the same ~20s to the first byte in my runs). It’s a known headless-CLI stall we’re tracking.
To unblock:
- Raise your caller’s timeout to 60s+ - that alone should stop the exit 137s.
- If it still stalls, run once with
--debug, share the request ID, and let me know if you’re on a VPN or corporate proxy.
Same issue discussed here: Cursor-agent -p hangs with zero output.