MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / loadSession

Method loadSession

src/session/store.ts:243–257  ·  view source on GitHub ↗
(sessionId: string)

Source from the content-addressed store, hash-verified

241 this.updateSessionWithTurn.run(usage.input, usage.output, usage.costUsd, title ?? null, sessionId);
242 } else {
243 this.updateSessionNoTurn.run(usage.input, usage.output, usage.costUsd, sessionId);
244 }
245 });
246 tx();
247 }
248
249 private getCurrentTurnNumber(sessionId: string): number {
250 const row = this.db.prepare(
251 `SELECT MAX(turn_number) as max FROM messages WHERE session_id = ?`,
252 ).get(sessionId) as { max: number | null };
253 return row.max ?? 0;
254 }
255
256 loadSession(sessionId: string): { meta: SessionMeta; messages: Message[] } | null {
257 const meta = this.db.prepare(`SELECT * FROM sessions WHERE id = ?`).get(sessionId) as
258 | SessionMeta
259 | undefined;
260 if (!meta) return null;

Callers 7

index.tsFile · 0.80
handleSlashCommandFunction · 0.80
AppFunction · 0.80
runHeadlessFunction · 0.80
resumeMethod · 0.80
runTurnMethod · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected