You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
App never computes session cost — costUsd is hardcoded to 0 #73
In the Electron app / standalone server, session cost is never calculated. calculateMetrics (src/main/utils/jsonl.ts:349) declares const costUsd = 0 and returns costUsd: costUsd > 0 ? costUsd : undefined, so metrics.costUsd is always undefined and the export (src/renderer/utils/sessionExporter.ts:29, formatCost) always prints N/A. Upstream has the same code. Cost exists only in the CLI (roundCostUsd, src/cli/analyzeSession.ts:203).
Вынести таблицу цен и roundCostUsd из src/cli/analyzeSession.ts в src/shared/ — единый источник для CLI и приложения.
Считать costUsd в calculateMetrics по уже дедуплицированным раундам (deduplicateByRequestId), с учётом модели каждого раунда.
Для неизвестной модели — частичная стоимость с флагом (как costPartial в CLI), а не молчаливый 0.
Показать стоимость там, где показываются токены (экспорт уже готов; UI — по необходимости).
Acceptance
CLI (totalsFromRounds) и calculateMetrics дают одинаковую стоимость на одной фикстуре — parity-тест по образцу test/shared/turnAccounting.parity.test.ts
Экспорт сессии показывает сумму вместо N/A для известных моделей
Сессия со смешанными known/unknown моделями помечается как частичная
Activity
feat(cost): compute session costUsd from the shared pricing table (#73)…