Skip to content

fix(proxy): populate contribution USD savings#1751

Open
ketpatil77 wants to merge 3 commits into
headroomlabs-ai:mainfrom
ketpatil77:codex/headroom-windows-loop-config
Open

fix(proxy): populate contribution USD savings#1751
ketpatil77 wants to merge 3 commits into
headroomlabs-ai:mainfrom
ketpatil77:codex/headroom-windows-loop-config

Conversation

@ketpatil77

@ketpatil77 ketpatil77 commented Jul 3, 2026

Copy link
Copy Markdown

Description

Populate session contribution USD totals for compression and cache reads.

AnthropicHandlerMixin now records both compression savings and cache-read savings in dollars instead of leaving those fields at 0.

Changes Made

  • headroom/proxy/savings_tracker.py: added _estimate_cache_savings_usd() alongside the existing compression savings helper
  • headroom/proxy/handlers/anthropic.py: pass computed compression and cache savings USD into update_contribution()
  • tests/test_proxy_cache_savings_usd.py: regression tests for the new cache savings helper

Testing

  • pytest tests/test_proxy_cache_savings_usd.py
  • ruff check headroom/proxy/savings_tracker.py headroom/proxy/handlers/anthropic.py tests/test_proxy_cache_savings_usd.py

Impact

Contribution savings now show nonzero dollar values when pricing is available.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

PR governance

This PR does not yet satisfy the required template fields:

  • Missing required section Type of Change.
  • Missing required section Real Behavior Proof.
  • Missing required section Review Readiness.
  • Paste real command output or artifact links in TestingTest Output.
  • Check I have performed a self-review before requesting human review.
  • Check This PR is ready for human review or convert the PR back to draft.

Please update the PR body, or move the PR back to draft while it is still in progress.

@github-actions github-actions Bot added the status: needs author action Pull request body or readiness checklist still needs author updates label Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: needs author action Pull request body or readiness checklist still needs author updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant