MCPcopy Create free account
hub / github.com/Noumena-Network/code / switchSession

Function switchSession

src/bootstrap/state.ts:474–485  ·  view source on GitHub ↗
(
  sessionId: SessionId,
  projectDir: string | null = null,
)

Source from the content-addressed store, hash-verified

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

Callers 9

runFunction · 0.85
setupFunction · 0.85
hydrateRemoteSessionFunction · 0.85
onSelectFunction · 0.85
REPLFunction · 0.85
loadInitialMessagesFunction · 0.85

Calls 2

deleteMethod · 0.80
emitMethod · 0.80

Tested by

no test coverage detected