Skip to content

feat: add Cursor CLI provider - #171

Merged
yubing744 merged 3 commits into
mainfrom
feat/issue-169-cursor-cli
Aug 16, 2026
Merged

feat: add Cursor CLI provider#171
yubing744 merged 3 commits into
mainfrom
feat/issue-169-cursor-cli

Conversation

@elliot245

Copy link
Copy Markdown
Contributor

Summary

  • add a first-class cursor provider resolving the official cursor-agent/agent executable
  • preserve tmux lifecycle/readiness and system-prompt dispatch via the existing fallback path
  • document model/ask/trust launcher arguments and keep API credentials out of generated commands
  • add provider capability, resolution, runtime, and credential-safety tests

Closes #169

Verification

  • make lint
  • python3 -m unittest agent-manager/scripts/tests/test_provider_cursor.py -v
  • python3 -m unittest discover -s agent-manager/scripts/tests -p 'test_*.py' (334 tests, passed)
  • git diff --check

No external Cursor workspace was trusted and no repository mutation was performed by the smoke tests.

@elliot245

Copy link
Copy Markdown
Contributor Author

Independent QA for PR #171 at exact head 0b3327031aadc6033efc95ef92ca3780f4c80ccd.

P0: none.

P1: FAIL - the resolver misses Cursor's documented $HOME/.cursor/bin install location and can instead launch an unrelated generic agent executable. resolve_launcher_command('cursor') searches ~/.local/bin/{cursor-agent,agent}, ~/bin/{cursor-agent,agent}, and system locations, but not ~/.cursor/bin/cursor-agent. build_start_command likewise exports only $HOME/.local/bin:$HOME/bin:$PATH. In an isolated reproduction with only ~/.cursor/bin/cursor-agent present, resolution returned bare cursor-agent and the generated PATH omitted ~/.cursor/bin, so a standard documented installation cannot start. The agent fallbacks are unsafe because that command is not provider-unique. Add provider-specific cursor-agent candidates for ~/.cursor/bin (and PATH support or an absolute resolved path), and do not fall back to unverified agent; cover these cases. Cursor's official GitHub Actions instructions explicitly add $HOME/.cursor/bin to PATH: https://docs.cursor.com/en/cli/github-actions

P2: the new tests do not cover cursor-cli or cursor-agent resolution, ~/.cursor/bin, generic-agent collision avoidance, full lifecycle/tmux injection, or the documented --mode/--trust pass-through.

Evidence:

  • Exact isolated detached checkout is clean and its parent diff contains exactly the three PR files; git diff --check HEAD^ HEAD passed.
  • Provider configuration correctly maps the three requested aliases, uses 3-second process-start readiness with empty prompt patterns, tmux-paste system-prompt fallback, runtime busy/blocked patterns, and shell-quoted launcher args. Manual command construction preserved --model, --mode ask, and --trust; CURSOR_API_KEY was absent from the command.
  • Focused provider/start/runtime suites: 34 passed.
  • Full suite: make test passed, 334 tests.
  • Exact-head CI is green: Quality Checks, Python 3.9/3.10/3.11/3.12, and Integration Matrix all SUCCESS.

QA Verdict: FAIL

@elliot245

Copy link
Copy Markdown
Contributor Author

Independent re-QA for PR #171 at exact head b972980a9df7677972374fdbae588fcd6dc709dc, superseding my prior FAIL.

P0: none.
P1: none.
P2: none.

Verified the prior P1 is closed:

  • resolve_launcher_command maps cursor, cursor-cli, and cursor-agent to provider-unique cursor-agent candidates only, with ~/.cursor/bin/cursor-agent first. No generic agent candidate remains.
  • Isolated contract reproduction for every alias: when both ~/.cursor/bin/cursor-agent and ~/.local/bin/agent exist, it resolves the former; with only generic agent, it fails closed to bare cursor-agent.
  • Generated command PATH includes $HOME/.cursor/bin:$HOME/.local/bin:$HOME/bin:$PATH; it preserves shell-quoted --model, --mode ask, and --trust, and does not include CURSOR_API_KEY.
  • Existing provider behavior remains appropriate: 3-second full-screen TUI startup readiness, tmux-paste system-prompt fallback, runtime busy/blocked patterns.

Evidence: exact isolated detached checkout clean; changed scope is five files and git diff --check HEAD^ HEAD passes. Focused Cursor/start/Kimi/runtime suites: 26 passed. Full make test: 335 passed. Exact-head CI is SUCCESS for Quality Checks, Python 3.9/3.10/3.11/3.12, and Integration Matrix.

QA Verdict: PASS

@elliot245
elliot245 requested a review from sulabs2022 August 16, 2026 10:01
Comment thread agent-manager/SKILL.md Outdated
- --model
- gpt-5.6-sol-medium
- --mode
- ask

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

默认改成 yolo 模式

@yubing744
yubing744 merged commit 8f98a09 into main Aug 16, 2026
6 checks passed
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.

feat: Support Cursor CLI provider

2 participants