Skip to content

T-37: add aggregated historical OMP stats via omp-stats - #112

Merged
jaesbit merged 1 commit into
develfrom
auto-work/t37-add-aggregated-historical-omp-stats
Jul 16, 2026
Merged

T-37: add aggregated historical OMP stats via omp-stats#112
jaesbit merged 1 commit into
develfrom
auto-work/t37-add-aggregated-historical-omp-stats

Conversation

@jaesbit

@jaesbit jaesbit commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Adds a filterable historical stats dashboard backed by @oh-my-pi/omp-stats.

Changes

  • GET /api/usage/stats — new endpoint, filterable by workspace (cwd), model, agentType, and range (1h|24h|7d|30d|90d|all).
  • @oh-my-pi/omp-stats integration: syncAllSessions() fires single-flight background sync (default worker pool); getDashboardStats() ensures initDb() on first request. A read-only SQLite handle runs combined WHERE-clause queries for cross-dimensional filtering.
  • Session drill-down links: resolved server-side via bridge.listSessions() path map; ancestor walk handles subagent/advisor transcripts at any depth. No raw filesystem paths sent to client.
  • source: "sessions" explicit in wire format; routine_runs excluded (satisfies acceptance criterion).
  • New protocol types: OmpStatsRange, SessionDrillDownLink, HistoricalModelStats, HistoricalWorkspaceStats, HistoricalAgentTypeStats, AggregatedStatsResponse.
  • AggregatedStatsSection in SubscriptionLimitsView: range picker, workspace/model/agentType dropdowns, byModel table with expandable session link chips, byWorkspace and byAgentType tables.

Tests

  • 17 unit tests (computeCutoff, resolveParentSessionPath, resolveDeckSession including deep-nested advisor case).
  • 7 new route-level tests verifying query-param parsing, bridge forwarding, response shape, source label.
  • tsc server: 14 pre-existing errors only. tsc web: clean. Vite build: clean.

Session: auto-work T-37

- New GET /api/usage/stats endpoint filterable by workspace (cwd),
  model, agentType, and range (1h|24h|7d|30d|90d|all).
- Backed by @oh-my-pi/omp-stats SQLite DB: syncAllSessions() runs
  single-flight in background (default worker pool, never blocks the
  server); getDashboardStats() ensures initDb() on first request.
- Custom combined WHERE-clause queries on messages table for cross-
  dimensional filtering (byModel/byWorkspace/byAgentType in one pass).
- Session drill-down links resolved server-side via bridge.listSessions()
  path map; ancestor walk handles subagents/advisors at any depth.
  No raw filesystem paths sent to the client.
- source: 'sessions' label explicit in wire format; routine_runs
  excluded (satisfies 'not mixed without explicit labeling').
- New protocol types: OmpStatsRange, SessionDrillDownLink,
  HistoricalModelStats, HistoricalWorkspaceStats, HistoricalAgentTypeStats,
  AggregatedStatsResponse.
- AggregatedStatsSection added to SubscriptionLimitsView: range picker,
  workspace/model/agentType filters, byModel table with expandable
  session link chips, byWorkspace and byAgentType tables.
- 17 unit tests (computeCutoff, resolveParentSessionPath,
  resolveDeckSession including deep-nested advisor case).
@jaesbit
jaesbit merged commit a142090 into devel Jul 16, 2026
@jaesbit
jaesbit deleted the auto-work/t37-add-aggregated-historical-omp-stats branch July 16, 2026 10:26
@jaesbit
jaesbit restored the auto-work/t37-add-aggregated-historical-omp-stats branch July 16, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant