Repository navigation
fix: unify cost tracking with 3-tier pricing resolution - #79
Merged
Merged
Conversation
Delete legacy extropy/core/pricing.py (hardcoded-only) and redirect all imports to extropy/core/cost/pricing.py which resolves prices via OpenRouter API → 24h cache → hardcoded fallback. This ensures --cost footer and estimate command use fresh prices for 300+ models. - Tag every CLI command with CostTracker.set_context() for ledger entries - Show per-model cost breakdown in summary_line() when multiple models used - Update estimate command to use -s/--scenario with study context pattern - Pre-warm pricing cache eagerly when cost tracking is enabled Closes #77 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
extropy/core/pricing.py(hardcoded-only dict) and redirect all imports toextropy/core/cost/pricing.py(OpenRouter API → 24h cache → hardcoded fallback)CostTracker.set_context(command=...)so ledger entries are labeledsummary_line()when multiple models are used (previously collapsed to "2 models")estimatecommand fromscenario.yaml --study-db study.dbto-s/--scenariowith study context pattern, consistent with simulate/results/etcmain_callback()when--costorshow_costconfig is enabledTest plan
pytest --tb=short -q)ruff check . && ruff format --check .cleanextropy.core.pricingimport raisesModuleNotFoundErrorsummary_line()multi-model output:$0.29 — gpt-5: $0.26 (...) · gpt-5-mini: $0.03 (...)estimate -s extendedworks end-to-end with test study folderCloses #77
🤖 Generated with Claude Code