harshitsinghbhandari
|
04f3a7c27f
|
fix(cursor): register plugin in all discovery/resolution layers
Address PR review feedback from #1076 to make Cursor agent fully functional.
## Changes
### Plugin Registration (High Severity Fixes)
- **core/plugin-registry.ts**: Add cursor to BUILTIN_PLUGINS array for config-based resolution
- **cli/plugins.ts**: Import and register cursor in agentPlugins map for getAgent/getAgentByName
- **cli/detect-agent.ts**: Add cursor to AGENT_PLUGINS array for detectAvailableAgents()
- **web/services.ts**: Import and register cursor plugin for dashboard SessionManager/LifecycleManager
- **web/package.json**: Add @composio/ao-plugin-agent-cursor dependency
### Activity Detection Fix (Medium Severity)
- **cursor/index.ts**: Remove overly broad blocked detection patterns (error:/failed:)
- Compiler errors, test failures, and linter output are normal tool output
- Terminal-based detection can't distinguish between actionable agent errors and normal output
- Follow Aider/OpenCode pattern: only Claude Code detects blocked (has native JSONL)
- Added comment explaining why blocked detection is removed
- **cursor/index.test.ts**: Remove blocked detection test cases
## Why These Changes Are Needed
Before these fixes:
- `defaults.agent: cursor` in config would throw "Unknown agent plugin: cursor"
- `ao spawn --agent cursor` would fail
- Dashboard couldn't resolve cursor agent (SessionManager/LifecycleManager failures)
- `detectAvailableAgents()` never discovered Cursor
- False "blocked" states when agent encountered normal compiler errors
After these fixes:
- Cursor agent fully discoverable and usable via config and CLI
- Dashboard can spawn and manage Cursor sessions
- Activity detection matches other terminal-based agents (Aider, OpenCode)
- No false positives from normal tool output
## Testing
- ✅ cursor plugin tests: 51/51 passing (reduced from 52 due to removed blocked tests)
- ✅ core typecheck: clean
- ✅ web typecheck: clean
- ✅ CLI can import cursor plugin without errors
Addresses: ComposioHQ/agent-orchestrator#1076
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
2026-04-09 19:17:41 +05:30 |
harshitsinghbhandari
|
464f771a76
|
feat: add Cursor agent CLI support (#1060)
Implement a new agent plugin for Cursor CLI following the existing agent plugin pattern.
## Changes
- Create `packages/plugins/agent-cursor/` with full Agent interface implementation
- Add Cursor plugin to CLI dependencies
- Implement all required methods:
- getLaunchCommand - command to start Cursor CLI with flags
- getEnvironment - env vars including ~/.ao/bin in PATH
- detectActivity - terminal output classification for Cursor prompts
- getActivityState - JSONL/activity-based state detection with fallbacks
- isProcessRunning - process liveness check (tmux TTY + PID)
- setupWorkspaceHooks - PATH wrappers for git/gh metadata capture
- getSessionInfo - extract summary from .cursor directory if available
- recordActivity - delegate to shared recordTerminalActivity
- postLaunchSetup - ensure hooks are installed post-launch
- getRestoreCommand - returns null (Cursor doesn't support session resume)
## Testing
- Comprehensive test suite with 52 passing tests covering:
- Manifest validation
- Command generation with permission modes
- Process detection (tmux + process runtime)
- Activity detection from terminal output
- Activity state cascade (JSONL → git commits → session mtime → fallback)
- All required getActivityState contract states (exited, waiting_input, blocked, active, idle)
- Session info extraction
- Environment setup
## Pattern
Follows the Aider agent pattern using:
- PATH wrappers (`~/.ao/bin/gh`, `~/.ao/bin/git`) for metadata capture
- AO Activity JSONL for terminal-derived activity detection
- Age-based decay for active/ready/idle state transitions
- Process name regex matching both `cursor` and `.cursor` (dot-prefixed)
Closes #1060
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
2026-04-09 18:51:33 +05:30 |