feat(runner): add Cursor CLI as a new runner provider#1386
Draft
jeremyeder wants to merge 6 commits intoambient-code:mainfrom
Draft
feat(runner): add Cursor CLI as a new runner provider#1386jeremyeder wants to merge 6 commits intoambient-code:mainfrom
jeremyeder wants to merge 6 commits intoambient-code:mainfrom
Conversation
Adds full support for Cursor CLI as a third runner provider alongside Claude Code and Gemini CLI. The implementation follows the established bridge/adapter pattern and is feature-gated behind `runner.cursor-cli.enabled`. ## What's included ### New packages - `ag_ui_cursor_cli/` — NDJSON parser (`types.py`, `parse_event()`), AG-UI protocol adapter (`adapter.py`, `CursorCLIAdapter`), re-exported utils - `ambient_runner/bridges/cursor_cli/` — `CursorCLIBridge` (PlatformBridge subclass), `CursorSessionWorker`/`CursorSessionManager` (async subprocess management with TTL eviction and session-ID persistence), auth helper, MCP config writer ### Infrastructure changes - `agent-registry-configmap.yaml` — Cursor CLI registry entry with feature gate - `flags.json` — `runner.cursor-cli.enabled` flag (workspace-scoped) - `models.json` — Cursor provider defaults and four cursor model entries - `Dockerfile` — Cursor CLI install block (pass-through version; pinning not supported by upstream installer) - `runner-tool-versions.yml` — Cursor CLI version tracking with explanatory comments ### Design notes - Cursor CLI `stream-json` event format is documented-but-unverified; `parse_event()` includes a NOTE comment - `CURSOR_CLI_VERSION` ARG is documentation-only; the upstream curl installer does not accept a version argument - Session IDs are persisted across pod restarts via `cursor_session_ids.json` - Env var blocklist strips platform secrets before spawning the `agent` binary Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Deploy Preview for cheerful-kitten-f556a0 canceled.
|
Contributor
|
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 Plus 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)
✨ Simplify code
Comment |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e deltas Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
runner.cursor-cli.enabled(workspace-scoped Unleash flag)ag_ui_cursor_clipackage: NDJSON parser for the Cursorstream-jsonevent format, AG-UI protocol adapter (CursorCLIAdapter) following the same pattern as the Gemini CLI adapterambient_runner.bridges.cursor_clipackage:CursorCLIBridge(subclassesPlatformBridge),CursorSessionWorker/CursorSessionManager(async subprocess management with per-thread locks, TTL eviction, session-ID persistence across pod restarts), auth helper, MCP config writer that merges into.cursor/mcp.jsonDesign notes
stream-jsonevent format is based on documentation research;parse_event()carries a NOTE comment flagging this as unverified against a real binaryCURSOR_CLI_VERSIONARG in the Dockerfile is documentation-only — the upstream curl installer does not accept a version argument; the GHA sanity check explicitly excludes it with a commentcursor_session_ids.jsonand restored on pod restart for conversation continuity_CURSOR_ENV_BLOCKLISTbefore spawning theagentbinaryTest plan
runner.cursor-cli.enabledflag for a workspacecursor:*model and verify theagentbinary is invoked with the expected flags--resumeis used on subsequent turns.cursor/mcp.jsonand merged with existing config🤖 Generated with Claude Code