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