Commit Graph
19 Commits
Author SHA1 Message Date
can1357 577d2a8eb8 style: biome format/organize-imports across integrated PRs 2026-06-27 02:06:38 +02:00
can1357 5a1c17c1cb Fix gain dashboard project scoping 2026-06-27 02:04:51 +02:00
can1357 c03a78917a test(coding-agent): disabled fsmonitor during test repo initialization
- Added core.fsmonitor configuration to the git initialization process in test setup to prevent potential environment-specific conflicts.
2026-06-25 12:55:01 +02:00
roboomp b5769a4e10 fix(stats): dedupe forked-session entries to stop double-counting
SessionManager.fork() and createBranchedSession() deep-copy a parent's
entries into the child JSONL — same entry_id, timestamp, model,
responseId, token counts, cost. Stats keyed uniqueness on
(session_file, entry_id), so both files contributed to request, token,
and cost totals.

insertMessageStats and insertUserMessageStats now skip rows whose
(entry_id, timestamp) already exists under a different session_file
(first-write-wins). A one-shot migration on initDb, gated by the
fork_dedupe_v1 meta sentinel, collapses pre-existing duplicate rows
in messages and user_messages by keeping the lowest-id row per
(entry_id, timestamp) group.

Fixes #3370
2026-06-24 14:14:25 +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
lycaon 525f4baa64 feat(stats): redesign the omp stats dashboard
Rewrite the local `omp stats` web UI on the OMP brand palette with a left nav, focused per-section views, a new Projects view, a system-aware light/dark toggle, and flicker-free navigation. Same data, endpoints, and command; the only server change is a 1h time-range bucketing fix in the aggregator.
2026-06-16 23:30:50 -06:00
can1357 34c74c4f52 test(stats): align backfill test with v6 key
The PR bumped USER_MESSAGES_BACKFILL_KEY to user_messages_v6, but the
behavior-backfill regression still seeded the dead user_messages_v5
sentinel, so it no longer exercised the user-messages backfill reset
path. Point both fixtures at v6.

Addresses review feedback on #2457.
2026-06-14 17:29:29 +02:00
can1357 3cb7b8786b test(stats): pin git-not-profanity regression
Adds a computeUserMessageMetrics() assertion that ordinary `git`
prose scores profanity: 0, so the dropped token cannot be silently
reintroduced by a future profanity-list edit.

Addresses review feedback on #2457.
2026-06-14 17:29:29 +02:00
can1357 ae415199dc feat: added build-time compatibility in ModelSpec/buildModel pipeline
- Centralized catalog and registry handling on `ModelSpec` and `buildModel`, resolving compatibility at model build time.
- Removed runtime compatibility detectors and switched provider request flows to direct `model.compat` reads.
- Added compat fields (`supportsReasoningParams`, `alwaysSendMaxTokens`, `strictResponsesPairing`, `whenThinking`).
- Persisted explicit compatibility overrides through `compatConfig` in discovery and cache merge paths.
2026-06-10 06:20:51 +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 be0d9d3e6c fix(stats): preserved service-tier across incremental parseSessionFile offsets
Stats sync depends on service_tier_change entries to derive priority premium requests since 69043d307 stopped folding priority-tier into per-message premiumRequests. parseSessionFile(path, fromOffset) initialized currentServiceTier to undefined per call, so an incremental resume past the tier change attributed subsequent priority OpenAI replies with premiumRequests: 0. When fromOffset > 0, parseSessionFile now replays bytes[0..start] purely to seed currentServiceTier from the latest service_tier_change before parsing the unprocessed tail. Bytes are already loaded, so no extra I/O.
2026-05-15 17:49:49 +02:00
can1357 a541a63547 feat: added read-selector analyzers and coverage plotting tools
- Updated read range expansion to use 1 leading and 3 trailing context lines.
- Changed read.defaultLimit from 500 to 300 in settings defaults.
- Updated read docs and tests to reflect the asymmetric context line behavior.
- Added read-selector analyzers and replay simulators to evaluate coverage and savings.
- Added plotting tools that output new session-stats PNG dashboards from local usage data.
2026-05-13 11:33:42 +02:00
can1357 e8e2f2cd83 fix(stats): preserve pending behavior backfills 2026-05-12 16:41:28 +02:00
can1357 f56cbbf4c6 feat(stats): added frustration metrics to stats parser and charting
- Added new frustration and revised behavior metrics across stats types, parser mappings, and UI charts.
- Reworked session sync to fan out parsing across a capped worker pool with SyncOptions progress callbacks.
- Added worker-based parse messaging and throttled TTY progress rendering in the stats sync command.
- Updated behavior scoring to strip structured content, ignore noisy prompts, and fix profanity boundary regressions.
- Expanded user message schema and migrations, then repaired assistant model/provider links during sync backfill.
- Updated worker-import guidance in AGENTS.md and recorded sync-progress/metrics updates in package changelogs.
2026-05-12 07:55:23 +02:00
can1357 770f175795 feat(stats): added user-message behavior metrics parsing and storage
- Added user-message behavior metric extraction and parsing for yelling/profanity/drama counts.
- Added behavior persistence and aggregate reads by extending syncSessionFile, DB schema, and query APIs.
- Added behavior dashboard support with new shared types, /api/stats/behavior route, and client views.
- Changed cost summary/chart rendering by removing per-chart 14/30/90-day filters and trend card behavior.
- Added tests for computeUserMessageMetrics edge cases like empty text, case, thresholds, and punctuation.
- Moved tailwindcss from devDependencies to dependencies for shared client styling usage.
2026-05-11 03:41:02 +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
can1357 f55b315165 fix(stats): simplify React version pinning fix
Fixes #938
2026-05-06 17:18:03 +02:00
can1357 58167af744 fix(stats): guard React bundle version parity
Fixes #938
2026-05-06 17:13:11 +02:00
can1357 c751b9c4d5 fix(stats): resolved stats openai-codex cost fallback to OpenAI rates
- Updated Codex model pricing data to include non-zero input/output/cacheRead rates.
- Added generate-models fallback to copy billable OpenAI costs into bundled openai-codex models.
- Added catalog-cost helpers to fallback openai-codex pricing to openai and compute token totals.
- Added regression tests for openai-codex cost parity and db backfill, and documented the fix in changelog.
2026-04-28 18:12:05 +02:00