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