feat: add cursor harness support#208
Conversation
|
Your free trial PR review limit of 300 PRs has been reached. Please upgrade your plan to continue using CodeAnt AI. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (18)
📝 WalkthroughWalkthroughThis PR adds comprehensive support for the ChangesCursor harness integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Code Review
This pull request introduces support for the cursor harness (executing the cursor-agent binary) across the CLI, persona-kit, and runtime packages. It configures the necessary sandbox mount rules, mapping of permission bypass modes to the --force flag, and handles sidecar files like AGENTS.md while hiding CLAUDE.md files. Extensive unit tests have been added to verify both interactive and non-interactive behaviors of the new harness. I have no feedback to provide as there are no review comments to address.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b98dd29699
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| configFiles: systemPrompt | ||
| ? [ | ||
| { | ||
| path: 'AGENTS.md', | ||
| contents: systemPrompt.endsWith('\n') ? systemPrompt : `${systemPrompt}\n` | ||
| } |
There was a problem hiding this comment.
Preserve Cursor prompts when disabling the mount
When a Cursor persona is launched with --install-in-repo, runInteractive disables the sandbox mount, treats any configFiles as unsafe to write, and only calls stripAgentFlag() before spawning. Since this new Cursor branch carries the entire systemPrompt only via an AGENTS.md config file and sets initialPrompt: null, that non-mount path silently starts cursor-agent --model ... without the persona prompt at all. Either avoid emitting sandbox-only config for Cursor in this mode or provide a non-mount fallback instead of dropping the prompt.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in e228042. The non-mount config-file degradation path now has a Cursor-specific branch: it warns that AGENTS.md cannot be safely materialized under --install-in-repo, then appends the persona system prompt as Cursor's initial prompt. I also added a subprocess regression test with a fake cursor-agent to verify the final argv preserves the prompt.
There was a problem hiding this comment.
2 issues found across 17 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/persona-kit/src/interactive-spec.ts">
<violation number="1" location="packages/persona-kit/src/interactive-spec.ts:597">
P1: When `--install-in-repo` is used, the sandbox mount is disabled and `configFiles` are not materialized (they are only written into the mount dir via `onBeforeLaunch`). Since the cursor branch sets `initialPrompt: null` and carries the persona's system prompt exclusively via the `AGENTS.md` config file, the non-mount path will silently launch `cursor-agent` without any persona prompt. Either provide a non-mount fallback (e.g., pass the prompt as a positional argument or write AGENTS.md with cleanup), or emit a degradation warning like the opencode path does.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| return { | ||
| bin: 'cursor-agent', | ||
| args, | ||
| initialPrompt: null, |
There was a problem hiding this comment.
P1: When --install-in-repo is used, the sandbox mount is disabled and configFiles are not materialized (they are only written into the mount dir via onBeforeLaunch). Since the cursor branch sets initialPrompt: null and carries the persona's system prompt exclusively via the AGENTS.md config file, the non-mount path will silently launch cursor-agent without any persona prompt. Either provide a non-mount fallback (e.g., pass the prompt as a positional argument or write AGENTS.md with cleanup), or emit a degradation warning like the opencode path does.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/persona-kit/src/interactive-spec.ts, line 597:
<comment>When `--install-in-repo` is used, the sandbox mount is disabled and `configFiles` are not materialized (they are only written into the mount dir via `onBeforeLaunch`). Since the cursor branch sets `initialPrompt: null` and carries the persona's system prompt exclusively via the `AGENTS.md` config file, the non-mount path will silently launch `cursor-agent` without any persona prompt. Either provide a non-mount fallback (e.g., pass the prompt as a positional argument or write AGENTS.md with cleanup), or emit a degradation warning like the opencode path does.</comment>
<file context>
@@ -536,6 +542,71 @@ export function buildInteractiveSpec(input: BuildInteractiveSpecInput): Interact
+ return {
+ bin: 'cursor-agent',
+ args,
+ initialPrompt: null,
+ warnings,
+ configFiles: systemPrompt
</file context>
There was a problem hiding this comment.
Fixed in e228042. The non-mount config-file degradation path now has a Cursor-specific branch: it warns that AGENTS.md cannot be safely materialized under --install-in-repo, then appends the persona system prompt as Cursor's initial prompt. I also added a subprocess regression test with a fake cursor-agent to verify the final argv preserves the prompt.
There was a problem hiding this comment.
Thanks for the update!
|
Your free trial PR review limit of 300 PRs has been reached. Please upgrade your plan to continue using CodeAnt AI. |
|
Addressed both issues identified by cubic in commit
Re-ran:
|
Summary
cursortocursor-agent--print --output-format text, and bypass-to---forceTests
corepack pnpm --filter @agentworkforce/persona-kit testcorepack pnpm --filter @agentworkforce/runtime testcorepack pnpm --filter @agentworkforce/cli testcorepack pnpm --filter @agentworkforce/cli... build