Skip to content

fix(providers): CursorAgent --workspace, cwd, and tmp path resolution#2

Open
Spencer1O1 wants to merge 2 commits into
masterfrom
fix/cursor-agent-workspace-pr
Open

fix(providers): CursorAgent --workspace, cwd, and tmp path resolution#2
Spencer1O1 wants to merge 2 commits into
masterfrom
fix/cursor-agent-workspace-pr

Conversation

@Spencer1O1

Copy link
Copy Markdown
Owner

Summary

Pass --workspace on the cursor-agent command. Resolve context.tmp_file under Neovim's cwd (and absolute paths as-is) so cursor-agent writes TEMP_FILE where 99 reads it, especially when Neovim cwd is a parent directory (e.g. C:\Dev with project at C:\Dev\test).

Depends on #185. Review only commit 1629aec. Do not merge until #185 lands.

Closes #181

Verification

Windows

Repro: Neovim :pwd -> C:\Dev, buffer C:\Dev\test\test.js, search "Find the main entrypoint".

Agent targets project tmp, not parent C:\Dev\tmp:

{"path":"C:\\Dev\\test\\tmp/99-1644-prompt","msg":"saved prompt to file"}
{"command":["cursor-agent","--workspace","C:\\Dev","--trust","--force","--model","composer-2.5-fast","--print",...]}
{"msg":"stdout","data":"Task complete. Output written to `C:\\Dev\\test\\tmp\\99-1644`.\n"}

Linux

Repro: Neovim :pwd -> /home, search "Find the main entrypoint".

Command includes --workspace; agent writes the same TEMP_FILE path as in the prompt:

{"path":"/home/spencerls/tmp/99-5795-prompt","msg":"saved prompt to file"}
{"command":["cursor-agent","--workspace","/home","--trust","--force","--model","composer-2.5-fast","--print",...]}
{"msg":"stdout","data":"Task complete. Results are in `/home/spencerls/tmp/99-5795`.\n"}

Test plan

  • Provider spec: command includes --workspace
  • Manual Windows: Neovim cwd ≠ project — TEMP_FILE paths align
  • Manual Linux: --workspace present; agent output path matches TEMP_FILE in prompt

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
Pass --workspace and set vim.system cwd to the project root. Resolve context.tmp_file under that root so agent writes and 99 reads the same TEMP_FILE path.

Closes ThePrimeagen#181
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: --workspace and cwd must align with tmp_dir paths

1 participant