Skip to content

Incorrect total cost display in TUI: shows much higher amount than actual DeepSeek platform consumption (possible saved/cache hit calculation bug) #2567

@caiyilian

Description

@caiyilian

Bug Description

The total cost displayed in the codewhale-tui interface is significantly higher than the actual consumption shown on the DeepSeek Open Platform dashboard.


Steps to Reproduce

  1. Use the latest Windows version of CodeWhale
  2. Run codewhale-tui and check the total cost displayed in the status bar
  3. Compare this value with the "Monthly Consumption" figure on the DeepSeek Open Platform console
    

Actual Behavior

  • CodeWhale TUI status bar shows: ¥53.90 (as shown in the first screenshot)
  • DeepSeek Open Platform actual monthly consumption: ¥15.13 (as shown in the second screenshot)
  • There is a discrepancy of over 3.5x between the two values
    

Expected Behavior

The total cost displayed in the TUI should accurately match the actual consumption billed by DeepSeek.


Additional Context

I noticed that the latest update appears to have added a "saved" indicator in the status bar (partially visible in the first screenshot). I suspect this issue may be related to the calculation of cache hit savings:

  • It seems the TUI might be incorrectly calculating the total cost by not properly accounting for the discounted pricing of cached tokens
  • Or alternatively, the "saved" amount is being added to the total cost instead of subtracted from it
  • The cache hit feature on DeepSeek charges significantly less for repeated tokens, which may not be correctly reflected in CodeWhale's internal cost calculation
    

Screenshots

  1. CodeWhale TUI status bar showing incorrect total cost:
Image
  1. DeepSeek Open Platform dashboard showing actual monthly consumption:
Image



Environment

  • OS: Windows
  • CodeWhale version: latest (as of June 2, 2026)
  • Model: DeepSeek V4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions