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

Function regenerateSessionId

src/bootstrap/state.ts:441–456  ·  view source on GitHub ↗
(
  options: { setCurrentAsParent?: boolean } = {},
)

Source from the content-addressed store, hash-verified

439}
440
441export function regenerateSessionId(
442 options: { setCurrentAsParent?: boolean } = {},
443): SessionId {
444 if (options.setCurrentAsParent) {
445 STATE.parentSessionId = STATE.sessionId
446 }
447 // Drop the outgoing session's plan-slug entry so the Map doesn't
448 // accumulate stale keys. Callers that need to carry the slug across
449 // (REPL.tsx clearContext) read it before calling clearConversation.
450 STATE.planSlugCache.delete(STATE.sessionId)
451 // Regenerated sessions live in the current project: reset projectDir to
452 // null so getTranscriptPath() derives from originalCwd.
453 STATE.sessionId = randomUUID() as SessionId
454 STATE.sessionProjectDir = null
455 return STATE.sessionId
456}
457
458export function getParentSessionId(): SessionId | undefined {
459 return STATE.parentSessionId

Callers 1

clearConversationFunction · 0.85

Calls 2

randomUUIDFunction · 0.90
deleteMethod · 0.80

Tested by

no test coverage detected