Skip to content

fix(cursor): register cursorSessionId before ACP session/load#837

Merged
tiann merged 1 commit into
tiann:mainfrom
swear01:fix/cursor-resume-pregister-metadata-834
Jun 8, 2026
Merged

fix(cursor): register cursorSessionId before ACP session/load#837
tiann merged 1 commit into
tiann:mainfrom
swear01:fix/cursor-resume-pregister-metadata-834

Conversation

@swear01
Copy link
Copy Markdown
Contributor

@swear01 swear01 commented Jun 7, 2026

Summary

Pre-write cursorSessionId + cursorSessionProtocol: acp into session metadata before awaiting ACP session/load on resume, so hub/web dedup and resume checks work immediately (Zed PR #54431 pattern).

Fixes #834

Test plan

  • cursorAcpRemoteLauncher.test.ts — metadata registered before deferred session/load resolves
  • Live: archive → resume → first GET /api/sessions/:id has metadata.cursorSessionId

Made with Cursor

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>
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 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>
@tiann tiann merged commit fa363c2 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

Development

Successfully merging this pull request may close these issues.

fix(cursor): pre-register cursorSessionId on resume before ACP session/load completes

2 participants