( worktreePaths: string[], limit?: number, initialEnrichCount: number = INITIAL_ENRICH_COUNT, )
| 4307 | } |
| 4308 | |
| 4309 | export 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). |
no test coverage detected