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

Pre-write resume token into session metadata before awaiting session/load
so hub and web see cursorSessionId immediately after resume spawn.

Fixes #834

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
SSU-WEI HUANG
2026-06-08 13:31:23 +08:00
committed by GitHub
co-authored by Cursor
parent 8094b500f3
commit fa363c2f6c
2 changed files with 34 additions and 2 deletions
+5 -1
View File
@@ -96,6 +96,8 @@ class CursorAcpRemoteLauncher extends RemoteLauncherBase {
let acpSessionId: string;
if (resumeSessionId && backend.supportsLoadSession()) {
// Register pending cursorSessionId before awaiting session/load (Zed PR #54431).
session.onSessionFoundWithProtocol(resumeSessionId, 'acp');
try {
acpSessionId = await backend.loadSession({
sessionId: resumeSessionId,
@@ -119,7 +121,9 @@ class CursorAcpRemoteLauncher extends RemoteLauncherBase {
});
}
session.onSessionFoundWithProtocol(acpSessionId, 'acp');
if (acpSessionId !== resumeSessionId) {
session.onSessionFoundWithProtocol(acpSessionId, 'acp');
}
syncCursorModelsFromAcp(backend, acpSessionId);