( sessionId: SessionId, projectDir: string | null = null, )
| 466 | * carries over from the previous session. |
| 467 | */ |
| 468 | export function switchSession( |
| 469 | sessionId: SessionId, |
| 470 | projectDir: string | null = null, |
| 471 | ): void { |
| 472 | // Drop the outgoing session's plan-slug entry so the Map stays bounded |
| 473 | // across repeated /resume. Only the current session's slug is ever read |
| 474 | // (plans.ts getPlanSlug defaults to getSessionId()). |
| 475 | STATE.planSlugCache.delete(STATE.sessionId) |
| 476 | STATE.sessionId = sessionId |
| 477 | STATE.sessionProjectDir = projectDir |
| 478 | sessionSwitched.emit(sessionId) |
| 479 | } |
| 480 | |
| 481 | const sessionSwitched = createSignal<[id: SessionId]>() |
| 482 |
no test coverage detected