Skip to content

feat: add Cursor agent support (#480)#597

Draft
jSydorowicz21 wants to merge 12 commits intoRunMaestro:rcfrom
jSydorowicz21:feature/480-cursor-agent-support
Draft

feat: add Cursor agent support (#480)#597
jSydorowicz21 wants to merge 12 commits intoRunMaestro:rcfrom
jSydorowicz21:feature/480-cursor-agent-support

Conversation

@jSydorowicz21
Copy link
Copy Markdown
Contributor

Summary

  • Add Cursor (via its agent CLI) as a new supported agent in Maestro
  • Full integration: agent ID, definition, capabilities, metadata, context window, output parser, error patterns, session storage, tests, and documentation

Changes

  • Register cursor in AGENT_IDS tuple
  • Add agent definition with CLI args (-p --output-format stream-json), resume (--resume), read-only (--mode ask), YOLO (--force), model selection (--model)
  • Define 23 capability flags (resume, JSON output, session ID, image input, streaming, thinking display, etc.)
  • Add metadata with Beta status
  • Set default context window (200,000 tokens)
  • Implement CursorOutputParser (410 lines) for stream-json output format
  • Register 158 error patterns across 7 categories (auth, tokens, rate limit, network, permissions, crash, session)
  • Implement CursorSessionStorage as no-op (Cursor storage format not yet documented)
  • Add comprehensive tests: parser (556 lines), error patterns (177 lines), storage (94 lines), integration (44 lines)
  • Add CLI research document

Test plan

  • Cursor agent appears in agent list when CLI is installed
  • Cursor agent spawns correctly with agent -p --output-format stream-json
  • Output parser handles all stream-json event types
  • Error patterns correctly categorize Cursor CLI errors
  • Resume works with --resume flag
  • Model selection works with --model flag
  • Tests pass (npm run test)

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 20, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 486194ce-34c9-4188-b505-dfa9e67888d8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Research findings from cursor.com/docs covering binary name (agent),
headless mode (-p), stream-json output format, session resume,
mode flags (ask/plan), YOLO mode (--force), and model selection.
Add 'cursor' to the AGENT_IDS array in agentIds.ts, placed
alphabetically between 'codex' and 'gemini-cli'. This is the
first step toward Cursor CLI agent integration (RunMaestro#480).
…nd constants

Register Cursor CLI agent across core systems:
- definitions.ts: agent binary, -p batch mode, stream-json output, --force YOLO,
  --resume, --mode ask read-only, --model selection, config options
- capabilities.ts: 24 boolean flags based on CLI research (batch, resume,
  read-only, JSON output, streaming, model selection enabled; conservative
  defaults for unconfirmed features)
- agentMetadata.ts: display name 'Cursor', added to BETA_AGENTS set
- agentConstants.ts: 200k default context window
Create CursorOutputParser implementing AgentOutputParser interface,
mapping Cursor's stream-json events (system/init, assistant, tool_call,
result) to Maestro's normalized ParsedEvent types. Register parser in
initializeOutputParsers() and add CURSOR_ERROR_PATTERNS covering auth,
token exhaustion, rate limiting, network, permission, crash, and session
errors. Add SSH error pattern for Cursor's `agent` binary not found.
Add comprehensive test coverage for the Cursor agent parser registration
and error pattern matching. Update index.test.ts to account for the new
Cursor parser (5 parsers instead of 4).
…rage module

Cursor stores sessions locally but the exact disk location and file format
are not publicly documented. This adds a no-op CursorSessionStorage that
returns empty results for all operations, sets supportsSessionStorage to
false in capabilities, and registers the storage in the module index.
Includes tests verifying all no-op methods.
- Run prettier on docs/cursor-cli-research.md
- Update detector tests from 8 to 9 expected agents (cursor added)
- Set supportsSlashCommands to false (not exposed in stream-json output)
- Add toolType field to CursorRawMessage for proper tool name extraction
- Fix ensureParsersInitialized to use registry size instead of mutable flag
- Fix detectErrorFromParsed to handle type:'error' events without error field
- Remove speculative CURSOR_API_KEY error pattern
- Tighten SSH 'agent' binary pattern to avoid false positives
- Add requiresPty: false to Cursor definition for batch-only consistency
- Update stale doc references from cursor-cli-research.md to AGENT_SUPPORT.md
- Fix test teardown to include factory-droid error pattern re-registration
- Move --force from base args to yoloModeArgs to avoid conflict with read-only mode
- Fix detectErrorFromLine to use immutable spread instead of mutating raw field
- Add Cursor (Beta) to CLAUDE.md and CLAUDE-AGENTS.md agent tables
- Update cursor-session-storage TODO to reference issue RunMaestro#480
- Add test coverage for extractUsage, detectErrorFromParsed edge cases,
  agentId assertions, errorLine in raw, pattern matching, and registration
- Use beforeEach for parser/storage test isolation (parser has mutable state)
@jSydorowicz21 jSydorowicz21 force-pushed the feature/480-cursor-agent-support branch from 15c4200 to 3a1164f Compare March 28, 2026 19:01
- Add missing supportsAppendSystemPrompt to cursor capabilities (build fix)
- Add known installation paths for agent binary in path-prober (Windows + Unix)
- Add SSH error pattern tests for cursor agent binary anti-collision regex
Random agentSessionIds could fuzzy-match the search query "beta",
causing "Gamma Session" to appear in filtered results intermittently.
Add cursor to SUPPORTED_AGENTS in NewInstanceModal and AGENT_TILES in
the wizard AgentSelectionScreen so it appears as a selectable agent
instead of "Coming Soon".
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.

1 participant