Commit Graph

4 Commits

Author SHA1 Message Date
roboomp 9abea02420 test(stats): isolated stats tests from xdg-shared db
Stats tests set PI_CONFIG_DIR + setAgentDir(home/<config>/agent), which resolves equal to the default agent dir and routes stats.db through $XDG_DATA_HOME/omp/stats.db whenever an XDG var is set, leaking rows across tests. The shared installStatsTestIsolation helper now snapshots and clears XDG_*_HOME with PI_CONFIG_DIR on each test, points the agent dir at a fresh TempDir, closes the DB handle, and restores the prior env after the test.
2026-06-29 10:59:06 +00:00
can1357 153fd78345 feat(stats): added token usage breakdown by agent type
- Implemented agent type classification and persistence in the database, including a backfill for legacy records.
- Added `AgentType` categorization and aggregated token usage metrics to the backend services.
- Created an `AgentTokenShare` visualization component to display usage distribution on the overview dashboard.
- Integrated agent-based tracking into existing data pipelines, view models, and testing suites.
2026-06-22 17:42:58 +02:00
can1357 9d457f73d9 test: migrated test imports to package subpath exports
- Replaced relative `../src` imports with `@oh-my-pi/pi-ai` and `@oh-my-pi/pi-agent-core` subpaths.
2026-06-08 19:03:55 +02:00
can1357 c462fdf034 feat(stats): added stats range params, selectors, and all-range cutoff
- Added optional time-range parameters to stats API endpoints and client requests.
- Added dashboard time-range selector controls and wired range updates to stats refresh.
- Implemented range normalization and cutoff calculation for dashboard stat aggregation.
- Updated DB queries to support optional cutoffs and unlimited mode for `range=all`.
- Added tests for 24h, 7d, all, and unknown-range fallback filtering behavior.
2026-05-11 02:30:22 +02:00