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

Function loadSameRepoMessageLogsProgressive

src/utils/sessionStorage.ts:4309–4331  ·  view source on GitHub ↗
(
  worktreePaths: string[],
  limit?: number,
  initialEnrichCount: number = INITIAL_ENRICH_COUNT,
)

Source from the content-addressed store, hash-verified

4307}
4308
4309export async function loadSameRepoMessageLogsProgressive(
4310 worktreePaths: string[],
4311 limit?: number,
4312 initialEnrichCount: number = INITIAL_ENRICH_COUNT,
4313): Promise<SessionLogResult> {
4314 logForDebugging(
4315 `/resume: loading sessions for cwd=${getOriginalCwd()}, worktrees=[${worktreePaths.join(', ')}]`,
4316 )
4317 const allStatLogs = await getStatOnlyLogsForWorktrees(worktreePaths, limit)
4318 logForDebugging(`/resume: found ${allStatLogs.length} session files on disk`)
4319
4320 const { logs, nextIndex } = await enrichLogs(
4321 allStatLogs,
4322 0,
4323 initialEnrichCount,
4324 )
4325
4326 // enrichLogs returns fresh unshared objects — safe to mutate in place
4327 logs.forEach((log, i) => {
4328 log.value = i
4329 })
4330 return { logs, allStatLogs, nextIndex }
4331}
4332
4333/**
4334 * Gets stat-only logs for worktree paths (no file reads).

Callers 2

loadSameRepoMessageLogsFunction · 0.85
ResumeConversationFunction · 0.85

Calls 4

getOriginalCwdFunction · 0.85
enrichLogsFunction · 0.85
logForDebuggingFunction · 0.70

Tested by

no test coverage detected