MCPcopy Index your code
hub / github.com/continuedev/continue / loadOrCreateSessionById

Function loadOrCreateSessionById

extensions/cli/src/session.ts:520–531  ·  view source on GitHub ↗
(
  sessionId: string,
  history: ChatHistoryItem[] = [],
)

Source from the content-addressed store, hash-verified

518 * preserve chat history across restarts for the same storage/agent id.
519 */
520export function loadOrCreateSessionById(
521 sessionId: string,
522 history: ChatHistoryItem[] = [],
523): Session {
524 const existing = loadSessionById(sessionId);
525 if (existing) {
526 SessionManager.getInstance().setSession(existing);
527 return existing;
528 }
529
530 return createSession(history, sessionId);
531}
532
533/**
534 * Update the current session's history

Callers 2

session.test.tsFile · 0.85
serveFunction · 0.85

Calls 4

loadSessionByIdFunction · 0.85
createSessionFunction · 0.85
setSessionMethod · 0.80
getInstanceMethod · 0.45

Tested by

no test coverage detected