Skip to content

fix(cursor): merge SKU catalog under ACP lock and refcount agent guard#835

Merged
tiann merged 1 commit into
tiann:mainfrom
swear01:fix/cursor-model-picker-831-832
Jun 8, 2026
Merged

fix(cursor): merge SKU catalog under ACP lock and refcount agent guard#835
tiann merged 1 commit into
tiann:mainfrom
swear01:fix/cursor-model-picker-831-832

Conversation

@swear01
Copy link
Copy Markdown
Contributor

@swear01 swear01 commented Jun 7, 2026

Summary

Resume/sidebar issues tracked separately in #833 / #834.

Fixes #831
Fixes #832

Test plan

  • bun typecheck
  • bun run test (one unrelated flaky timeout in full suite; cursor tests green)
  • API smoke: M1 machine catalog, M3 in-session catalog, M4 dual-session lock, M2 cold-start cache
  • Manual: in-session Model/Variant picker shows friendly SKU names on active Cursor session

Made with Cursor

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>
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

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 bun is unavailable in PATH.

Testing

  • Not run (automation): bun not 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>
@tiann tiann merged commit ad038bb into tiann:main Jun 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants