发布

  • [issue-5619] [BE] fix: getCostFromMetadata reads total_cost instead of total_tokens (#5630)

    frostbyte_neo 发布于 2026-03-13 18:31:20 +00:00

    • [issue-5619] [BE] fix: read total_cost field from metadata instead of total_tokens

    getCostFromMetadata() was reading cost.total_tokens instead of
    cost.total_cost, causing token counts to be misinterpreted as USD dollar
    amounts when falling back to metadata-based cost calculation.

    Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

    • [issue-5619] [BE] fix: avoid NPE when total_cost field is absent in metadata

    Use flatMap with Optional.ofNullable to safely handle missing total_cost field,
    falling through to BigDecimal.ZERO instead of throwing NullPointerException.

    Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com


    Co-authored-by: Douglas Blank doug@comet.com
    Co-authored-by: Claude Sonnet 4.6 noreply@anthropic.com

    下载附件