fix(cursor): merge SKU catalog under ACP lock and refcount agent guard#835
Merged
Merged
Conversation
Fixes incomplete cliModelSkus while agent acp holds the CLI lock (tiann#831) and replace single-pid ACP lock with cross-process refcount (tiann#832). Web picker merges machine/session catalogs and waits for SKU readiness before showing variant labels. Fixes tiann#831 Fixes tiann#832 Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Findings
- No high-confidence issues found in the added/modified lines.
Summary
- Review mode: initial
- Reviewed the full PR diff across the Cursor ACP guard refcounting, shared Cursor model cache/SKU merge, runner prewarm, and web Cursor picker readiness paths. Residual risk: targeted tests could not be executed in this runner because
bunis unavailable in PATH.
Testing
- Not run (automation):
bunnot found in PATH.
HAPI Bot
heavygee
added a commit
to heavygee/hapi
that referenced
this pull request
Jun 7, 2026
…nn#835 Revert agentCliGuard.ts + AcpStdioTransport.ts + agentCliGuard.test.ts to upstream/main. Strip the agent-acp-active lock pre-check from maybeAutoMigrateLegacyCursorSession + simplify its test suite to match. Per tiann#832 (filed by swear01), the assumption underpinning my v8 strict-mkdirSync refusal — that Cursor's `agent` binary SIGTERMs a second `agent acp` process on the same host — is incorrect. Two `agent acp` processes coexist fine. The lock's actual job is narrower: prevent `agent --list-models` from killing an active `agent acp` child. swear01's open PR tiann#835 ("fix(cursor): merge SKU catalog under ACP lock and refcount agent guard") refactors agent-acp-active from a single-PID file to a cross-process refcount with live-pid reconciliation. We expect tiann#835 to land before tiann#824 (this PR) and have added swear01's three open ACP mop-up PRs (tiann#835/tiann#836/tiann#837) to the local driver-manifest soup so the migrator is exercised against the eventual upstream shape. Net effect on tiann#824: * agent-acp-active lock concerns are someone else's problem now (the refcount lock in tiann#835 just works for our migrator flow). * Verify probe still runs in isolated HAPI_HOME (unchanged) — that isolation is independent of the host-side lock semantics and remains the correct safety boundary for the probe. * Auto-migrate trigger in resumeSession is unchanged behaviourally; only the now-obsolete lock pre-check is gone. 53/53 unit tests pass (cursorLegacyMigrator + syncEngineAutoMigrate). Co-authored-by: Cursor <cursoragent@cursor.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
cliModelSkusfrom shared cache, session seed, and machine RPC so in-session Cursor variant picker shows CLI SKU names instead of raw ACP wire suffixes whileagent acpholds the lock.agent-acp-activelock with cross-process refcount + live-pid reconciliation so ending one Cursor ACP session does not clear the lock while another is still running.scheduleCursorModelsPrewarm()on connect (non-blocking).Resume/sidebar issues tracked separately in #833 / #834.
Fixes #831
Fixes #832
Test plan
bun typecheckbun run test(one unrelated flaky timeout in full suite; cursor tests green)Made with Cursor