Skip to content

feat(agent): add Cursor Agent CLI runtime support#1057

Open
devv-eve wants to merge 2 commits intomainfrom
agent/eve/150ffe6b
Open

feat(agent): add Cursor Agent CLI runtime support#1057
devv-eve wants to merge 2 commits intomainfrom
agent/eve/150ffe6b

Conversation

@devv-eve
Copy link
Copy Markdown
Collaborator

Summary

  • Add cursor-agent as a new agent backend provider, supporting the Cursor Agent CLI (cursor-agent chat -p --output-format stream-json)
  • Implements the full Backend interface: JSONL stream parsing, session resume (--resume), auto-approval (--yolo), and per-model token usage tracking
  • Registers cursor in daemon config auto-discovery (MULTICA_CURSOR_PATH env var), execenv skill injection (.cursor/skills/), runtime config (AGENTS.md), and frontend provider logo

Test plan

  • Go build passes (go build ./...)
  • Agent package tests pass (go test ./pkg/agent/)
  • Execenv tests pass (go test ./internal/daemon/execenv/)
  • TypeScript typecheck passes (pnpm typecheck)
  • Manual test: install cursor-agent CLI, start daemon, verify cursor runtime appears online
  • Manual test: assign an issue to a cursor-backed agent, verify execution completes

Closes MUL-849

🤖 Generated with Claude Code

Add cursor-agent as a new agent backend, following the same pattern as
existing providers. The implementation spawns cursor-agent CLI with
stream-json output, parses JSONL events into the unified Message type,
and supports session resume, usage tracking, and auto-approval (--yolo).

Changes:
- server/pkg/agent/cursor.go: cursorBackend implementation
- server/pkg/agent/cursor_test.go: unit tests for args, parsing, errors
- server/pkg/agent/agent.go: register "cursor" in New() factory
- server/internal/daemon/config.go: probe cursor-agent in PATH
- server/internal/daemon/execenv/context.go: cursor skill discovery path
- server/internal/daemon/execenv/runtime_config.go: AGENTS.md injection
- packages/views/.../provider-logo.tsx: cursor logo in UI

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
multica-web Ignored Ignored Apr 15, 2026 6:15am
multica-web-production Ignored Ignored Apr 15, 2026 6:15am

Request Review

1. Fix token usage double-counting: usage is now taken exclusively from
   "result" events (session totals). Per-message usage in "assistant"
   events is intentionally ignored. "step_finish" usage is only used as
   fallback when no "result" usage is available.

2. Remove dead code: isCursorUnknownSessionError() and its regex were
   defined but never called. Removed along with corresponding test.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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