Repository navigation
feat: report header and bot caption show tokens, time and real cost - #17
Merged
Merged
Conversation
- Token row with provider prompt-cache share (26 599 in (7 215 cached, 27%) + 4 607 out) - Time row with the analysis duration - Local cache row only when it actually served a response, so a provider prompt-cache discount no longer reads as '0/1 hits' - Cost row says 'unknown — no price for <model>' instead of a bare $0 when the model has no pricing - Period row only for chats; videos, pages and files are analyzed whole Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CWDpwC7PyG5Rh8mvCWdLYx
…ption A model missing from [pricing] and the catalog (e.g. openai/gpt-6-luna-pro) was billed at $0 everywhere. On its first call chat_complete now fetches OpenRouter's public model list once, remembers the price under ~/.unread/storage/live_prices.json, and prices later calls from there. [ai] live_pricing = false (or UNREAD_AI_LIVE_PRICING=0) turns it off. The bot caption shows the spend as ≈$x, or $? when tokens were used but no price is known. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CWDpwC7PyG5Rh8mvCWdLYx
|
🎉 This PR is included in version 1.10.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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
The analyze report header said
Кэш: 0/1 попаданийandСтоимость: $0even though the provider served 7 215 of 26 599 prompt tokens from its cache. The model (openai/gpt-6-luna-pro) has no price in[pricing]or the catalog, so every run on it was billed at $0. The header also showed a meaninglessПериод: непрочитанные / вся историяon a YouTube video.Report header
AnalysisResultfields).26 599 in (7 215 from provider cache, 27%) + 4 607 out.unknown — no price for <model>instead of a bare$0. The analysis/enrichment split is localized.Pricing models the catalog doesn't know (
unread/ai/live_pricing.py)chat_completefetches OpenRouter's public model list once, with no key. The price it finds is remembered in~/.unread/storage/live_prices.json, so later processes don't need the network.[pricing]and the catalog still win.[ai] live_pricing = falseorUNREAD_AI_LIVE_PRICING=0. Tests run with it off.Bot caption
≈$0.0123, or$?when tokens were used but no price is known.Related issue
n/a
Test plan
uv run pytest -q: 2668 passed, including newtests/test_report_meta_usage.pyandtests/test_live_pricing.py(fetch mocked, no network)uv run ruff checkon the changed files: no new findingsuv run ruff formatChecklist
CLAUDE.mdif architecture / invariants changed (n/a)🤖 Generated with Claude Code
https://claude.ai/code/session_01CWDpwC7PyG5Rh8mvCWdLYx