feat(agents): add Cursor agent support with improvements#264
Conversation
Remove special handling for nested tool_call object format. The cursor agent now uses the standard event.name and event.input fields directly.
…or agent Changes: - Extract duplicate extractErrorMessage function to shared utils.ts - Update codex.ts, cursor.ts, gemini.ts to use shared utility - Fix Cursor CLI command name from 'agent' to 'cursor' - Fix Cursor install URL to point to docs.cursor.com/cli - Add comprehensive documentation for Cursor agent - Add Cursor to website navigation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
WalkthroughAdds a new Cursor CLI agent plugin with JSONL streaming/parsing, centralises an extractErrorMessage utility into a shared module and re-exports it, registers Cursor in the built-in agents, adds comprehensive Cursor tests, updates docs/navigation, and bumps package version. Changes
Sequence DiagramsequenceDiagram
participant User
participant CursorPlugin
participant CursorCLI
participant OutputParser
participant DisplaySystem
User->>CursorPlugin: execute(prompt, config)
CursorPlugin->>CursorPlugin: validateSetup & buildArgs
CursorPlugin->>CursorCLI: spawn process (args + stdin)
CursorCLI-->>CursorPlugin: stream JSONL stdout
CursorPlugin->>OutputParser: parseCursorOutputToEvents(data)
OutputParser->>OutputParser: parseCursorJsonLine()
OutputParser-->>CursorPlugin: AgentDisplayEvent[]
CursorPlugin-->>DisplaySystem: emit events (text, tool_use, errors)
DisplaySystem-->>User: render updates
CursorCLI-->>CursorPlugin: process exit
CursorPlugin->>User: execution complete
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #264 +/- ##
==========================================
+ Coverage 43.49% 43.57% +0.08%
==========================================
Files 92 94 +2
Lines 28358 28756 +398
==========================================
+ Hits 12334 12531 +197
- Misses 16024 16225 +201
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/plugins/agents/builtin/cursor.ts`:
- Around line 109-112: Update the top-of-file/class docstring to reference the
`cursor` command (and the plugin's role as the Cursor CLI) instead of `agent`;
locate the comment block above the plugin class (the docstring that currently
reads "Cursor Agent CLI plugin implementation. Uses the `agent` CLI to execute
AI coding tasks.") and change it to mention `cursor` and/or
`meta.defaultCommand` so it accurately describes the Cursor CLI plugin and
avoids referring to the `agent` command.
🧹 Nitpick comments (1)
website/content/docs/plugins/agents/cursor.mdx (1)
132-136: Clarify the config scope forsubagentTracingDetail.The snippet lacks its enclosing config section, so it is unclear whether it belongs under
agentOptionsoragents.options. Consider showing the full block to prevent misconfiguration.💡 Suggested doc tweak
-```toml -subagentTracingDetail = "full" -``` +```toml +[agentOptions] +subagentTracingDetail = "full" +```
Add detailed checklists for contributors: - General requirements (>50% test coverage, docs for user-facing changes) - Complete tracker plugin checklist (source, registration, tests, docs) - Complete agent plugin checklist (source, registration, tests, docs) Each checklist includes all required files, methods, tests, and documentation.
feat(agents): add Cursor agent support with improvements
Summary
Adds Cursor CLI as a new agent option for Ralph TUI, based on PR #240 with additional improvements.
New Features
agent,plan,ask--force) support for autonomous operationImprovements over original PR #240
extractErrorMessagemoved tosrc/plugins/agents/utils.ts(was duplicated in codex, cursor, gemini)agenttocursor(the actual binary name)docs.cursor.com/cliinstead of non-existent URL/docs/plugins/agents/cursorTest plan
bun run typecheckpassesbun run buildpassesRelated
Summary by CodeRabbit
New Features
Documentation
Tests
Chores