Skip to content

fix(providers): CursorAgent deliver prompt via @path to saved file#185

Open
Spencer1O1 wants to merge 2 commits into
ThePrimeagen:masterfrom
Spencer1O1:fix/cursor-agent-prompt-pr
Open

fix(providers): CursorAgent deliver prompt via @path to saved file#185
Spencer1O1 wants to merge 2 commits into
ThePrimeagen:masterfrom
Spencer1O1:fix/cursor-agent-prompt-pr

Conversation

@Spencer1O1

Copy link
Copy Markdown

Summary

99 saves the full prompt to tmp/99-*-prompt before make_request. Stock CursorAgentProvider passes the entire multiline XML query as the --print argv argument, which breaks on Windows when Neovim cwd differs from the project root.

Deliver the prompt via a single-line --print message that references the saved file with @absolute/path instead.

Same pattern as #154 proposes for OpenCode (--file).

Closes #180

Verification

Windows 11 — search in C:\Dev\test. Before fix: multiline <Context> on --print → agent "Your message looks incomplete". After:

{"msg":"saved prompt to file","path":"C:\\Dev\\test\\tmp/99-6155-prompt"}
{"msg":"make_request","command":["cursor-agent","--trust","--force","--model","composer-2.5-fast","--print","Read and follow every instruction in @C:/Dev/test/tmp/99-6155-prompt using your file tools, then complete the task exactly as specified in that file."]}
{"msg":"stdout","data":"Task complete. Results written to `C:/Dev/test/tmp/99-6155`.\n"}

Linux (WSL) — search, same branch:

{"msg":"saved prompt to file","path":"/home/spencerls/tmp/99-9659-prompt"}
{"msg":"make_request","command":["cursor-agent","--trust","--force","--model","composer-2.5-fast","--print","Read and follow every instruction in @/home/spencerls/tmp/99-9659-prompt using your file tools, then complete the task exactly as specified in that file."]}
{"msg":"stdout","data":"Task complete. Results are in `/home/spencerls/tmp/99-9659`.\n"}

Test plan

  • Provider spec: print arg is single-line, contains @ and 99-*-prompt, no <Context>
  • Manual Windows: search — agent reads prompt file and runs task
  • Manual Linux: search — same behavior

99 saves the full prompt to tmp/99-*-prompt before make_request. Pass a single-line --print message referencing that file with @ instead of putting the multiline XML query on argv.

Closes ThePrimeagen#180
@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown

Bugbot is not enabled for this team, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Comment thread lua/99/providers.lua Outdated
Try normalized and cwd-relative candidates; do not return an unreadable fallback path.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown

Bugbot is not enabled for this team, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@Spencer1O1

Copy link
Copy Markdown
Author

Re: Sentry — valid edge case, fixed in 44e14c2. The cwd fallback was returned without a filereadable check. Now both candidates are tried in order and only a readable path is returned. Normal flow is unaffected: finalize() creates the prompt file via _ready_request_files before save_prompt/make_request. If no candidate is readable (I/O failure), we still fall back to the primary normalized path so the agent error is visible rather than silently using a wrong cwd path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CursorAgentProvider: multiline prompt on --print argv fails on Windows

1 participant