fix(cursor): register cursorSessionId before ACP session/load#837
Merged
tiann merged 1 commit intoJun 8, 2026
Merged
Conversation
Pre-write resume token into session metadata before awaiting session/load so hub and web see cursorSessionId immediately after resume spawn. Fixes tiann#834 Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Findings
No findings.
Summary
Review mode: initial
No issues found in the added/modified lines. Residual risk: the live archive -> resume flow remains unverified in this environment.
Testing
Not run (automation): attempted bun test cli/src/cursor/cursorAcpRemoteLauncher.test.ts, but bun is not installed in this runner.
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
Pre-write
cursorSessionId+cursorSessionProtocol: acpinto session metadata before awaiting ACPsession/loadon resume, so hub/web dedup and resume checks work immediately (Zed PR #54431 pattern).Fixes #834
Test plan
cursorAcpRemoteLauncher.test.ts— metadata registered before deferredsession/loadresolvesGET /api/sessions/:idhasmetadata.cursorSessionIdMade with Cursor