MCPcopy Create free account
hub / github.com/WJX20/claude-code / loadSameRepoMessageLogsProgressive

Function loadSameRepoMessageLogsProgressive

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

Source from the content-addressed store, hash-verified

4085}
4086
4087export async function loadSameRepoMessageLogsProgressive(
4088 worktreePaths: string[],
4089 limit?: number,
4090 initialEnrichCount: number = INITIAL_ENRICH_COUNT,
4091): Promise<SessionLogResult> {
4092 logForDebugging(
4093 `/resume: loading sessions for cwd=${getOriginalCwd()}, worktrees=[${worktreePaths.join(', ')}]`,
4094 )
4095 const allStatLogs = await getStatOnlyLogsForWorktrees(worktreePaths, limit)
4096 logForDebugging(`/resume: found ${allStatLogs.length} session files on disk`)
4097
4098 const { logs, nextIndex } = await enrichLogs(
4099 allStatLogs,
4100 0,
4101 initialEnrichCount,
4102 )
4103
4104 // enrichLogs returns fresh unshared objects — safe to mutate in place
4105 logs.forEach((log, i) => {
4106 log.value = i
4107 })
4108 return { logs, allStatLogs, nextIndex }
4109}
4110
4111/**
4112 * Gets stat-only logs for worktree paths (no file reads).

Callers 2

loadSameRepoMessageLogsFunction · 0.85
ResumeConversationFunction · 0.85

Calls 4

logForDebuggingFunction · 0.85
getOriginalCwdFunction · 0.85
enrichLogsFunction · 0.85

Tested by

no test coverage detected