Skip to content

fix(cursor): use runner worktrees with unified Grok Build - #2771

Open
swear01 wants to merge 1 commit into
tiann:mainfrom
swear01:fix/2770-unified-cursor-worktree
Open

swear01 wants to merge 1 commit into
tiann:mainfrom
swear01:fix/2770-unified-cursor-worktree

Conversation

@swear01

@swear01 swear01 commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

First implementation PR for #2770. Grok Build 2.0.9 accepts agent acp but exits before ACP initialization if HAPI passes Cursor's native --worktree or --add-dir flags.

  • Detect unified Grok Build from the Cursor executable's --version output when a worktree or additional directories are requested. Keep the legacy launch path if the version is unknown or the probe times out.
  • For Cursor Worktree requests on a unified runner, use the existing HAPI Git worktree and pass its directory to the child. Check both the repository root and generated worktree against configured workspace roots. Reuse existing linked worktrees and clean up HAPI-created ones when launch fails.
  • Explain the unsupported direct Cursor flags before bootstrapping a session. Users can select Worktree in New Session or start from an existing linked worktree. Update the agent guide.

This PR addresses runner worktree startup. Session migration, unified model and permission handling, and picker consolidation remain tracked in #2770.

Verification

  • bun run typecheck:cli
  • 89 focused tests passed across the Cursor CLI, ACP argument builder, runtime probe and runner launch. Runner tests check actual Git worktree creation, cwd, workspace roots and startup cleanup.

@swear01

swear01 commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

/swear-review

This branch has not been deployed

No deployments
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