mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-06 06:41:56 +00:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user