feat: add Cursor agent support (#480)#597
Draft
jSydorowicz21 wants to merge 12 commits intoRunMaestro:rcfrom
Draft
feat: add Cursor agent support (#480)#597jSydorowicz21 wants to merge 12 commits intoRunMaestro:rcfrom
jSydorowicz21 wants to merge 12 commits intoRunMaestro:rcfrom
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
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)
15c4200 to
3a1164f
Compare
- 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".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
agentCLI) as a new supported agent in MaestroChanges
cursorin AGENT_IDS tuple-p --output-format stream-json), resume (--resume), read-only (--mode ask), YOLO (--force), model selection (--model)CursorOutputParser(410 lines) for stream-json output formatCursorSessionStorageas no-op (Cursor storage format not yet documented)Test plan
agent -p --output-format stream-json--resumeflag--modelflagnpm run test)