fix(coding-agent): keep fork session id aligned

This commit is contained in:
Sviatoslav Abakumov
2026-05-20 15:54:11 +04:00
parent ac58c6f449
commit dce24ac9ff
2 changed files with 5 additions and 4 deletions

View File

@@ -292,12 +292,11 @@ export class AgentSessionRuntime {
return { cancelled: false, selectedText };
}
const sourceManager = SessionManager.open(currentSessionFile, sessionDir);
const forkedSessionPath = sourceManager.createBranchedSession(targetLeafId);
const sessionManager = SessionManager.open(currentSessionFile, sessionDir);
const forkedSessionPath = sessionManager.createBranchedSession(targetLeafId);
if (!forkedSessionPath) {
throw new Error("Failed to create forked session");
}
const sessionManager = SessionManager.open(forkedSessionPath, sessionDir);
await this.teardownCurrent("fork", sessionManager.getSessionFile());
this.apply(
await this.createRuntime({