diff --git a/src/compare.tsx b/src/compare.tsx index 0012a215..0424462b 100644 --- a/src/compare.tsx +++ b/src/compare.tsx @@ -5,7 +5,7 @@ import type { ModelStats, ComparisonRow, CategoryComparison, WorkingStyleRow } f import { aggregateModelStats, computeComparison, computeCategoryComparison, computeWorkingStyle, findModelStat, projectSessionIds, scanSelfCorrections } from './compare-stats.js' import { formatCost, formatTokens } from './format.js' import { filterProjectsByName, parseAllSessions, setInteractiveScanUI } from './parser.js' -import { getAllProviders } from './providers/index.js' +import { getAllProviders, safeDiscoverSessions } from './providers/index.js' import type { ProjectSummary, DateRange } from './types.js' import { patchStdoutForWindows } from './ink-win.js' import { startUserTimingGuard } from './user-timing-guard.js' @@ -420,7 +420,7 @@ export function CompareView({ projects, onBack, presetModels, scopeToProjects }: const providers = await getAllProviders() const dirs: string[] = [] for (const p of providers) { - const sessions = await p.discoverSessions() + const sessions = await safeDiscoverSessions(p) for (const s of sessions) dirs.push(s.path) } const corrections = await scanSelfCorrections(dirs, scopeToProjects ? projectSessionIds(projectsRef.current) : undefined) diff --git a/src/dashboard.tsx b/src/dashboard.tsx index db1fef08..1924e962 100644 --- a/src/dashboard.tsx +++ b/src/dashboard.tsx @@ -14,7 +14,7 @@ import { aggregateModelTotals } from './model-breakdown.js' import { buildDurableOverviewFromNormalizedIndex, buildDurablePeriod, hydrateDailyCacheFromNormalizedProjects, type ExcludedGatewayTotals } from './usage-aggregator.js' import { loadDailyCache, type DailyCache } from './daily-cache.js' import { exitAfterCacheCleanup } from './session-cache.js' -import { getAllProviders } from './providers/index.js' +import { getAllProviders, safeDiscoverSessions } from './providers/index.js' import { classHeaderLine, classTotals, findingBasis, findingClass, scanAndDetect, type FindingClass, type WasteFinding, type WasteAction, type OptimizeResult } from './optimize.js' import { appliedFixGlyph, formatAppliedFix, type AppliedFix } from './act/types.js' import { aggregateFileChurn, buildCoachingNotes, computePricingCoverage, medianTimeToFirstEditMs, scanUserCorrections, worstOneShotCategory, type ReworkedFile } from './workflow-insights.js' @@ -1707,7 +1707,7 @@ export function InteractiveDashboard({ initialProjects, initialDailyHistoryProje let cancelled = false async function detect() { const found: string[] = [] - for (const p of await getAllProviders()) { const s = await p.discoverSessions(); if (s.length > 0) found.push(p.name) } + for (const p of await getAllProviders()) { const s = await safeDiscoverSessions(p); if (s.length > 0) found.push(p.name) } if (!cancelled) setDetectedProviders(found) } detect() diff --git a/src/main.ts b/src/main.ts index 636c691b..1e0a716e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -8,7 +8,7 @@ import { reportUnmatchedProjectPatterns } from './project-filter-warnings.js' import { getVercelGatewayApiKey } from './providers/vercel-gateway.js' import { BILLING_FILTER_VALUES, ROUTE_FILTER_VALUES, filterProjectsByBillingRoute } from './billing-filter.js' import { AGGREGATE_ONLY_PROVIDER, aggregateOnlyCostUSD, excludesAggregateOnlyProviders, parseAllSessions, filterProjectsByName, filterProjectsByDateRange, clearSessionCache, setInteractiveScanUI, computeCorpusFingerprint, isSessionHydrationComplete, startProgressKeepalive, stopProgressKeepalive, withLoadWindow } from './parser.js' -import { allProviderNames, getAllProviders } from './providers/index.js' +import { allProviderNames, getAllProviders, safeDiscoverSessions } from './providers/index.js' import { getProvider } from './providers/index.js' import { getClaudeConfigDirs, getDesktopSessionsDirs } from './providers/claude.js' import { convertCost, formatCost } from './currency.js' @@ -2546,7 +2546,7 @@ program const providers = await getAllProviders() const dirs: string[] = [] for (const provider of providers) { - const sessions = await provider.discoverSessions() + const sessions = await safeDiscoverSessions(provider) for (const session of sessions) dirs.push(session.path) } const scope = opts.project.length > 0 || opts.exclude.length > 0 ? projectSessionIds(projects) : undefined