feat(analytics): add dashboard model filter#861
Conversation
roborev: Combined Review (
|
|
Applied the chunking fix in I left the mixed-model behavior session-scoped on purpose. The issue asks for filtering the main dashboard by model, and specifically calls out seeing model usage in sessions. This PR keeps the dashboard scoped to sessions that contain at least one matching model, which is the contract already described in the PR body. That keeps session-level cards, projects, tools, skills, and top sessions on one consistent population instead of partially rewriting some of them into message-level metrics. A message-scoped model-usage dashboard still seems useful, I just see that as a separate slice from this session dashboard filter. |
roborev: Combined Review (
|
|
The trends paths now clear I also added mixed-model coverage for both backends, plus a PostgreSQL query-shape test that keeps the model predicate on the outer message rows. |
roborev: Combined Review (
|
|
I also added a focused frontend test for that request path, and |
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
|
Fixed on 8a23705. Session-shape now derives length buckets and autonomy from the same filtered per-session message stats that the model-scoped analytics views already use in internal/db/analytics.go, internal/postgres/analytics.go, and internal/duckdb/analytics_usage.go, so mixed-model sessions stop leaking off-model message volume and off-model user turns into the selected model's shape view. Velocity complexity now uses those filtered message counts as well, which keeps model-filtered sessions in the correct 1-15 or 16-60 bucket instead of classifying them by the full session totals. I also added mixed-model regressions for SQLite and DuckDB, plus matching PostgreSQL pgtests for the same shape and complexity cases. |
roborev: Combined Review (
|
roborev: Combined Review (
|
|
I traced the last roborev report back to the model-scoped message loaders rather than any single panel. The shared filtered-message helpers, the velocity loaders, and the trend scans were all treating This rework keeps the model filter anchored on the selected assistant turn, but it now buffers empty-model user rows and attributes them to that assistant exchange when the reply matches the active model. I’m applying that rule in SQLite, PostgreSQL, and DuckDB, and I switched the existing mixed-model regressions over to empty-model user rows so the tests exercise the real parser shape that roborev flagged. |
roborev: Combined Review (
|
|
Follow-up pushed in |
roborev: Combined Review (
|
|
Applied the tool analytics fix. Model-scoped tool counts now resolve each call against its own message timestamp, with session fallback only when the tool row has no message timestamp, so |
The analytics dashboard can already narrow by project, machine, agent, and time, but it still rolls every chart and summary together across all models. Issue #633 asks for model-name filtering on that main dashboard, and the missing piece is end-to-end plumbing: the analytics HTTP input does not accept
model, the shared analytics filter type has no model field, the backend predicate builders do not carry model-aware message scoping through analytics and trends, and the frontend analytics store and toolbar have no dashboard-local model filter state.This change threads a comma-separated
modelfilter through the analytics route layer, the shared analytics filter object, the analytics, trends, and filtered-model lookup helpers, and the dashboard request state. When a model filter is active, the dashboard first scopes to sessions that contain at least one matching model message, then row-based analytics derive message, token, tool-call, trend-term, session-shape, and velocity metrics from matching model rows inside that session set. Summary totals, activity, heatmap, projects, tools, skills, top sessions, signals, trend terms, session shape, and velocity now stay aligned across SQLite, PostgreSQL, and DuckDB-backed modes, including mixed-model sessions and hour/day slices.On the frontend, the analytics store gains model filter state, request params, clear and toggle helpers, and active-filter chips, and the analytics toolbar gains a model dropdown that keeps known models stable across refreshes and filtered reloads. Backend analytics tests now cover the new filter behavior across SQLite, PostgreSQL pgtests, and DuckDB, including mixed-model summaries, activity, hour-of-week, trends, tools, skills, top sessions, session shape, and velocity, and the analytics store tests verify that the dashboard sends
modeland clears it correctly.Fixes #633