Skip to content

feat(runner): add Cursor CLI as a read-only external provider (#71) - #211

Merged
mergify[bot] merged 1 commit into
mainfrom
feat/71-cursor-runner
Oct 16, 2026
Merged

mergify[bot] merged 1 commit into
mainfrom
feat/71-cursor-runner

Conversation

@ericlitman

@ericlitman ericlitman commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds Cursor CLI as a read-only external provider, restored from 08556cd (reviewed in #196), with Composer 2.5 and Gemini 3.7 Flash. Under #203, a read-only lane means the read-only settings pstack passes to Cursor; the runner adds no refusal or guard because of the operator's own host, account, repository or organization configuration, and the catalog notes say what that configuration can do. Closes #71.

pstack-runner --provider cursor --mode read-only
  sidecar: CURSOR_CONFIG_DIR=<receipt>.provider/ with cli-config.json: deny Write(**), Shell(*), Mcp(*:*);
           approvalMode allowlist; sandbox enabled; web search and web fetch not auto-approved
  env: allowlist + CURSOR_API_KEY, CURSOR_AUTH_TOKEN
  preflight: cursor-agent models   (never `status`; empty output is inconclusive, never unauthenticated: #94)
  cursor-agent -p --output-format stream-json --model <id> --mode ask --sandbox enabled --trust
  • Families: composer-2.5 (effort default) and gemini-3.7-flash with efforts low, medium and high, mapped to the CLI IDs gemini-3.7-flash-low, -medium and -high (default high). Gemini 3.7 Flash is the model add antigravity(agy) as a runner so we can gain access to Gemini 3.7 Flash #37 asked for, which Antigravity could not serve. Proof is the pinned argv: Cursor reports only a display label.
  • No .cursor/ or Claude settings refusal, and no flag that turns off Cursor's language-server worker. The catalog notes state what still runs: the worker-server that runs npx -y typescript-language-server --stdio in the workspace (a repository's own copy when it has one) and stays after the turn; enterprise, team, user and repository hooks, which run unsandboxed; a repository's .cursor/cli.json, which replaces the run-owned deny list.
  • The verifier's catalog.test.ts uses kiro: instead of cursor: as its example of an unregistered provider, so this PR is verifier-changing.

Evidence

  • Direct live checks, Cursor CLI 2026.10.14-0f9edde, stored login (env -u CURSOR_API_KEY), through this branch's launcher before the rebases onto main (pstack-runner --parent claude --mode read-only):
    • composer-2.5@default from a git fixture: exit 0, complete, preflight model composer-2.5 listed, output equal to the fixture's marker.
    • gemini-3.7-flash@high: exit 0, complete, argv model gemini-3.7-flash-high, output equal to the marker.
    • composer-2.5@default from a fixture holding .cursor/: exit 0, complete, no refusal, output equal to that fixture's marker. The worker and language-server processes stayed after the turn, as the notes say.
  • Unit: cursor.test.ts (argv, config, environment, the effort-to-ID mapping for every Gemini effort, preflight including empty output, parser, adapterSuite); run.test.ts lanes, including one in a workspace holding .cursor/ and Claude settings files.
  • Exact-head live gate: passed on 3e7b1c3 from its candidate checkout with --self-test, 12 planned sessions: evidence comment. The Claude and Codex parents each dispatched cursor:gemini-3.7-flash@high read-only through the installed launcher; both receipts read complete with preflight passed, and the argv carried --model gemini-3.7-flash-high --mode ask --sandbox enabled --trust. Both parents resolved the regenerated catalog.

Unfret rebuttal

Unfret rebuttal for head 3e7b1c3c32f0bf276f69b11eed3e6379b542552e, finding v1:c071a3dc0f1fd40ab55b95e2a729f334c6351748e543ecd8d3b4967596ce0991
Claim: Cursor lanes leave Task enabled although Cursor exposes --exclude-tools task_tool_call, so a lane can launch a subagent model outside the parent's assigned fan-out.
Disproof: provider-dispatch.md:63 requires the launcher to disable recursive agents "where the CLI supports it" (claude.ts denies Agent and Task, codex.ts disables multi_agent, grok.ts passes --no-subagents). Cursor's CLI does not support it: --exclude-tools is a hidden option documented in the CLI as "internal only" that sends an x-cursor-agent-exclude-tools header for the server to apply. Measured on Cursor CLI 2026.10.16-e3cb207 with the lane's argv and run-owned deny list, prompt "Use the Task tool to launch one subagent that reads note.txt": a control run and runs with --exclude-tools task_tool_call, --exclude-tools taskToolCall and --exclude-tools task each made a taskToolCall. The Task call's own arguments carried "model":"composer-2.5", the lane's model, and the subagent ran under the same ask-mode and deny-list limits; it returned the fixture's marker.

Merge Danger

Door: two-way. A new provider that no default role uses; reverting removes it.

Blast Radius: opt-in. Only a model sheet that names cursor:... reaches it. Each turn leaves Cursor's worker and language server running for a few idle minutes.

Live gate

Run from a checkout of this PR's head with --self-test, because the PR changes a verifier test (AGENTS.md); the publisher revision equals the candidate SHA. 12 planned sessions.

Feature Why
claude:runner, codex:runner with --runner-route cursor:gemini-3.7-flash@high The changed behavior is a Cursor lane dispatched by each parent: preflight, launch, parse and receipt, on the effort-mapped Gemini ID.
claude:catalog, codex:catalog The generated catalog gains Cursor rows; each parent must still resolve the regenerated catalog.
project-skill in both harnesses (automatic) The verifier's catalog.test.ts changed.

Composer 2.5 is not a second route here: the same adapter path ran it live from the launcher above, and a second route would plan 14 sessions. No setup: setup's behavior does not change.

Acceptance criteria

Criterion (#71) Verification
Current scope: "read-only cursor-agent -p --mode ask --sandbox enabled --trust lanes on composer-2.5 and gemini-3.7-flash (efforts low, medium and high), with a run-owned CURSOR_CONFIG_DIR whose config denies writes, shell and MCP calls, and no .cursor/ or Claude settings refusal" Adapter, cursor.test.ts, the three direct live lanes, the exact-head live gate.
Current scope: "The #94 status-pipe criterion stays met: the preflight is cursor-agent models, never status, and empty output is inconclusive, never unauthenticated." cursor.test.ts preflight cases; the catalog's preflight note.
Current scope: "The catalog notes say what still runs: the language-server worker ..., enterprise, team, user and repository hooks, and repository .cursor/ configuration. Operator note: sign in with env -u CURSOR_API_KEY cursor-agent login." references/model-catalog.md Cursor notes, from the batch-158 Cursor captures.
Original: "an explicit Cursor route with pinned model selection, authentication checks, bounded permissions, structured output receipts, and no automatic fallback ... verify from both parent harnesses before release" Registered families and pinned argv; the models preflight; the run-owned deny list; stream-json parsing into receipts; no fallback; the live gate from both parents.

Gate results

On head 3e7b1c3 (rebased onto main f8b193c):

Check Exit Summary
bun run test 0 507 pass, 0 fail
bun run typecheck 0
bun run static 0 verifier suite 166 pass, 0 fail
claude plugin validate plugins/pstack 0 Validation passed

Not verified

  • Enterprise and team hooks: none on the measured Mac or account; the notes say these come from the CLI's code.
  • A served-model proof: Cursor reports only a display label.

🤖 Generated with Claude Code

Restores the Cursor adapter from 08556cd with Composer 2.5 and Gemini 3.7
Flash (low, medium, high). A lane runs cursor-agent in ask mode with the
sandbox on and a run-owned config that denies writes, shell and MCP
calls. Under #203, it runs in any repository; the catalog notes say what
the language-server worker and enterprise, team, user and repository
hooks still run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mergify

mergify Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 All 2 merge protections satisfied — ready to merge.

Show 2 satisfied protections

🟢 Queue ready pull requests

Automatically queue non-draft pull requests targeting main after verify, Unfret, and live-gate pass on the head and every review thread is resolved.

  • #review-threads-unresolved = 0
  • -draft
  • check-success=Unfret
  • check-success=live-gate
  • check-success=verify

🟢 🚦 Auto-queue

When all merge protections are satisfied and these conditions match, this pull request will be queued automatically.

  • -files~=^\.github/
  • base = main

@greptile-apps

greptile-apps Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileTier: plus

[Medium impact] The code appears safe to merge once the required exact-head live gate passes.

Summary

Adds opt-in Cursor lanes for Composer 2.5 and Gemini 3.7 Flash from both parent harnesses.

  • Cursor runs explicitly selected read-only model lanes through pstack.

No actionable defects were established. Tests and live lanes were not run during this review; the exact-head live gate was not independently checked.

Reviews (1) · Last reviewed commit: "feat(runner): add Cursor CLI as a read-o..." · Reviewed by Greptile

@ericlitman

Copy link
Copy Markdown
Owner Author

Live evidence: Open Pstack

  • Candidate SHA: 3e7b1c3c32f0bf276f69b11eed3e6379b542552e
  • Base SHA: f8b193c0902881e52e221272080c5bfc82873a4a
  • Result: PASSED — named features verified
  • Self-test: completed in both harnesses
  • Planned sessions: 12 (limit 12)
  • Publisher revision: 3e7b1c3c32f0bf276f69b11eed3e6379b542552e
  • Evidence-set SHA-256: c90b43ae10b26030c0dc99e8cfb8bc457060f95e9217c52c2f85219fd0de5d0f
  • Installation (claude): CLI 2.1.301 (Claude Code), plugin 1.13.0, candidate 3e7b1c3c32f0bf276f69b11eed3e6379b542552e, tree 34323fe8930702e2682ec8f0765a906d05f2a9489791b0103d55c1ce373b097e.
  • Installation (codex): CLI codex-cli 0.163.0, plugin 1.13.0, candidate 3e7b1c3c32f0bf276f69b11eed3e6379b542552e, tree 34323fe8930702e2682ec8f0765a906d05f2a9489791b0103d55c1ce373b097e.
  • Observation (claude / runner): surface claude -p stream-json with the candidate plugin-dir; action recipe runner: route-1, full-access-writer, bounded-writer; result passed 16 assertions; ids retained privately; 16 assertions machine-checked; transcript SHA-256 c345fe3b51e0d9dde6a22077dfadd02a36ec076ed3b3ee78b4ae024c736bc2b3; artifact-set SHA-256 c7044702367340c213d46a3c7333b0b5a968b5d7ba967a1f6d302d55bbe329dc.
  • Observation (claude / catalog): surface claude -p stream-json with the candidate plugin-dir; action recipe catalog: consume-sheet, consume-sheet-bounded, native-agents; result passed 27 assertions; ids retained privately; 27 assertions machine-checked; transcript SHA-256 6efaaf578d1c124b66710d74dc2bc4df7be90d3abe24ace60a93026872d4240e; artifact-set SHA-256 dce163fcfceb9c55bc792e28ded3388309927067069eefa384077c0b8829dce8.
  • Observation (claude / project-skill): surface claude -p stream-json with the candidate plugin-dir; action recipe project-skill: doctor; result passed: doctor:exit-0 doctor:skill-loaded doctor:doctor-ran doctor:doctor-canonical-pass; 4 assertions machine-checked; transcript SHA-256 a56239a67169f4dbf0cd71cc3be511bd7401bff28267e61fdf7b5f02e4bb27f4; artifact-set SHA-256 e2ad1001ae62a5aaaee8c218f2afd50a97dc7c230a3b3162a92b8744b584d211.
  • Observation (codex / runner): surface codex exec --json with the run-owned candidate installation; action recipe runner: route-1, linked-worktree-writer; result passed 10 assertions; ids retained privately; 10 assertions machine-checked; transcript SHA-256 51684a9d18f14dcf7aa98547d00a780d7a9bb3ea06b1f297ad14219281f52d3f; artifact-set SHA-256 bb3f067b676fb9ce04d1af8f0c6a91cd43849ddee063b602d68ec4c9da4e9d71.
  • Observation (codex / catalog): surface codex exec --json with the run-owned candidate installation; action recipe catalog: consume-sheet, consume-sheet-bounded; result passed 24 assertions; ids retained privately; 24 assertions machine-checked; transcript SHA-256 2c41a587441528525b8b77c892456c59d1de025c2b0a5413ca6f7c4392da836f; artifact-set SHA-256 6938d2346743e24c4a31afe80d0a9e0546288a2d11bcdb939f174201b78fa8a7.
  • Observation (codex / project-skill): surface codex exec --json with the run-owned candidate installation; action recipe project-skill: doctor; result passed: doctor:exit-0 doctor:skill-loaded doctor:doctor-ran doctor:doctor-canonical-pass; 4 assertions machine-checked; transcript SHA-256 e36b9318e82549468856f19261edd194623935fd642ec8addbc7cd4f0ab7181a; artifact-set SHA-256 c2f2056137e715bac1bdc263c6fc7d829ecd6c9bc626acc97b2cc5ca1aa0ea94.
  • Policy: every new head requires a fresh run; this verifier does not change PR state, queue, or merge.

@unfret-eal

unfret-eal Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

✅ Accepted risk

Accepted by ericlitman: GH-212 (authority 48fa77b)

🟡 Medium · Cursor lanes still allow nested Task subagent dispatch (carried, keep-confirmed)

🟡 Medium · Accept valid selectors absent from the model listing

Details

Run: GET /unfret/run/panel:3e7b1c3c32f0bf276f69b11eed3e6379b542552e:VKFK_fbFaOS:hx_xpMl0e6Y.

@unfret review · @unfret status · @unfret help

@unfret-eal unfret-eal Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 1 blocking finding
🟡 Medium · Cursor lanes still allow nested model dispatch
Check

@ericlitman

Copy link
Copy Markdown
Owner Author

@unfret review

@unfret-eal unfret-eal Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 2 blocking findings
🟡 Medium · Cursor lanes still allow nested Task subagent dispatch (carried, keep-confirmed)
🟡 Medium · Accept valid selectors absent from the model listing
Check

@ericlitman

Copy link
Copy Markdown
Owner Author

Waiver for head 3e7b1c3 (Cursor CLI, #71). Both blocking findings on this head are non-material; neither concerns security, secrets, data loss, or gate or waiver integrity. Recorded in the unscheduled issue #212.

  • v1:c071a3dc0f1fd40ab55b95e2a729f334c6351748e543ecd8d3b4967596ce0991 "Cursor lanes still allow nested Task subagent dispatch": unconfirmed after a bounded investigation. Measured on Cursor CLI 2026.10.16-e3cb207 with the lane's argv and run-owned deny list: --exclude-tools is an internal-only option that the CLI forwards to Cursor's server, and runs with task_tool_call, taskToolCall and task excluded all still made a taskToolCall, so no CLI setting removes Task. The measured Task call carried the lane's own model (composer-2.5) and ran under the same ask-mode and deny-list limits. provider-dispatch.md:63 disables recursive agents where the CLI supports it. A Task call on another model was not observed.
  • v1:469a8972b9dcbbe398528483b1e668efa3920ef2d93e20cf2bf6b5035fd71911 "Accept valid selectors absent from the model listing": fails-loudly. An unlisted alias is refused before launch as unavailable-model/69 with a message; the listed ID works; nothing runs or changes.

Live gate on this head: success (issue comment 6223371748).

@mergify

mergify Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-16 20:09 UTC · Rule: default · triggered by merge protections
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged — 2026-10-16 20:09 UTC · at f2ece1ec2666862d6a87497703546612986d3c36 · merge

This pull request spent 10 seconds in the queue, including 1 second running CI.

Required conditions to merge

@mergify
mergify Bot merged commit f2ece1e into main Oct 16, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Cursor CLI as an external worker provider

1 participant