Repository navigation
Admin classifier: per-day hover card and estimated cost - #1280
Conversation
The daily activity chart on /admin/classifier gets the same hover/focus card as the /admin/metrics charts: the day, each series, the total, and the day's model calls and estimated cost. Each OpenRouter Decisions call now writes its usage block to a new Analytics Engine dataset (uploads_classifier_calls). The overview reads it back per day and the page shows an "Est. cost" tile for the window. Calls without a reported cost are scaled from the priced ones. Absent binding or AE token is a no-op and the tile reads unavailable. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017RAV94xRKfKGB7yS6GwyNB
|
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 2
🚫 Excluded labels (none allowed): 1
Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
AI notes · nothing to flag
1 file · add media: |
Jev bills input only, so the per-call AE point keeps cost and input tokens, and the estimate scales reported cost per input token to calls that carried no cost. The hover card shows the day's input tokens. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017RAV94xRKfKGB7yS6GwyNB

Requested by Zach · project thread
Summary
/admin/classifier). Each day shows the same card the/admin/metricscharts use (.metrics-chart-tooltip): the day, classified / skipped / failed, the total, and the day's model calls, input tokens, and estimated cost when available. Bars are focusable for keyboard. The metrics charts already had hover cards, so this was the only admin chart missing one.openRouterDecisionsRunwrites each ok Decisions response's reported cost and input tokens (Jev bills input only) with the model id to a new Analytics Engine datasetuploads_classifier_calls(CLASSIFIER_CALLSbinding, preview dataset too). No D1 writes. An absent binding is a no-op and a write never throws.fetchClassifierCostSeries, same token as the other AE panels) and addscoststo the overview payload. Calls without a reported cost are estimated from the reported cost per input token. Unavailable AE shows "-". Data starts when this deploys, so past days read as no calls.Test plan
pnpm test:api,pnpm test:webpass; new tests for the usage parser, the AE write, the cost series query, and the web cost helpersuploads_classifier_callsand the tile fills in🤖 Generated with Claude Code
https://claude.ai/code/session_017RAV94xRKfKGB7yS6GwyNB