Skip to content

feat: per-plugin cost trend + threshold warnings (closes #201)#502

Merged
vivekchand merged 1 commit intomainfrom
fix/gh-clawmetry-201-plugin-cost-attr-v2
Apr 2, 2026
Merged

feat: per-plugin cost trend + threshold warnings (closes #201)#502
vivekchand merged 1 commit intomainfrom
fix/gh-clawmetry-201-plugin-cost-attr-v2

Conversation

@vivekchand
Copy link
Copy Markdown
Owner

Closes #201. Adds per-plugin cost trend tracking, 7-day comparison, and threshold warnings.

- Track per-day plugin token/cost breakdown in _compute_transcript_analytics
- Add _compute_plugin_trend() helper: compares recent 7d vs prior 7d cost share
  and returns 'increasing' / 'decreasing' / 'stable'
- Enhance GET /api/usage/by-plugin: each row now includes a trend field;
  warnings[] array emitted when plugin cost share exceeds threshold (default 50%)
- New GET /api/usage/by-plugin/trend?days=N: returns daily time-series for all
  plugins in the requested window (default 14 days, max 90) enabling frontend
  charts and 'which plugins are getting more expensive?' analysis
- 6 new tests covering both endpoints and threshold/trend fields
@vivekchand vivekchand merged commit 1d20f2a into main Apr 2, 2026
19 checks passed
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.

feat: Per-plugin & per-skill cost attribution

1 participant