Skip to content

fix(stats): ignore usage-only session files#328

Open
OnlyYu1996 wants to merge 1 commit into
CortexLM:mainfrom
OnlyYu1996:fix-stats-ignore-usage-without-messages
Open

fix(stats): ignore usage-only session files#328
OnlyYu1996 wants to merge 1 commit into
CortexLM:mainfrom
OnlyYu1996:fix-stats-ignore-usage-without-messages

Conversation

@OnlyYu1996
Copy link
Copy Markdown

Fixes PlatformNetwork/bounty-challenge#53202.

Summary

  • Ignore top-level session usage aggregates when the session has no messages array entries.
  • Add a regression test for usage-only session JSON so stats no longer report non-zero tokens/cost with otal_messages: 0.

Validation

  • cargo +1.90.0 fmt --package cortex-cli --check
  • git diff --check

Targeted cargo +1.90.0 test -p cortex-cli test_parse_session_file_ignores_usage_without_messages -- --nocapture is blocked in this Windows/MSVC environment before crate tests run by the existing �ws-lc-sys C build failure.

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

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.

[BUG] [v0.0.7] cortex stats reports non-zero token totals with zero messages when session JSON has top-level usage but no messages array

1 participant