Skip to content

chore(cleanup): remove legacy token-only pricing helpers #3848

Description

@Hmbown

Summary

Remove legacy token-only pricing helpers that are no longer used by production cost accounting.

Evidence

  • crates/tui/src/pricing.rs:246 calculate_turn_cost, :256 calculate_turn_cost_estimate, and :271 calculate_turn_cost_with_pricing are only used by pricing tests.
  • Production cost accounting uses calculate_turn_cost_from_usage, calculate_turn_cost_estimate_from_usage, and token_usage_for_pricing to honor cache-hit/cache-miss fields.
  • crates/tui/src/pricing.rs:363 format_cost has no callers; production uses currency-aware formatters.

Suggested Change

Delete token-only/USD-only legacy helpers and update or remove tests that only preserve the legacy API. Keep usage-aware cost helpers and currency-aware display helpers.

Risk & Confidence

Confidence: high. Risk: low-medium; pricing is user-visible, so tests should cover the usage-aware path after deletion.

Verification Checklist

  • Run cargo test -p codewhale-tui pricing cost_status scorecard -- --nocapture.
  • Run cargo check -p codewhale-tui --all-targets.
  • Confirm rg "calculate_turn_cost\(|calculate_turn_cost_estimate\(|format_cost\(" crates/tui/src crates/tui/tests only finds active intended APIs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cleanupCode cleanup, refactor, or maintenance worktuiTerminal UI behavior, rendering, or interaction

    Projects

    Status
    In progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions