feat(submit): cap unpriced warning rows and report the aggregate total

Merged
TH
2mo ago
+356-12

Long proxy-model histories fan out to one Warning: submitting … unpriced … row per provider/model pair (45+ rows in the motivating report), burying the submittable summary (Date range / Active days / Total tokens / Total cost) below screens of near-identical yellow lines. The tokenless-row reporter in the same file already solved this exact problem with a 20-row cap plus ... and N more.

This caps the per-row detail in report_unpriced_submission_usage at the same 20 rows with the same ... and N more acknowledgment, and adds one aggregate line (Unpriced total: … message(s) (… tokens) at $0.00 across … provider/model(s).) so capped-off rows are still accounted for. Per-row warning text is byte-identical, so rows under the cap render exactly as before.

What's Changed

  • feat(submit): cap unpriced warning rows and report the aggregate total

Verification

  • cargo fmt --all -- --check
  • cargo clippy --locked -p tokscale-cli --all-features -- -D warnings
  • cargo test -p tokscale-cli --test cli_tests test_submit_ (6 passed, including the new test_submit_caps_unpriced_warning_rows_and_reports_the_total with 21 distinct unpriced models and the pre-existing single-row warning test)

Full Changelog: https://github.com/junhoyeo/tokscale/compare/v4.15.1...feat/submit-warning-aggregation


Summary by cubic

Caps the unpriced submission warning at 20 provider/model rows, ranks them by token impact, and adds an aggregate total, so long proxy-model histories no longer bury the submittable summary.

  • Rows past the cap are listed by id in the ... and N more line, wrapped four per line, keeping the custom-pricing hint actionable.
  • The 20 visible rows are ordered by token impact (then message count, then provider/model) so the heaviest usage stays visible.
  • The aggregate line reports total messages, tokens, and provider/model count at $0.00.
  • Rows under the cap render byte-identically to before.