Repository navigation
Account for cache writes and long-context pricing - #253
Merged
Merged
Conversation
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.
Cache creation was dropped from native Luna usage, and estimates ignored long-context price tiers. This understated benchmark costs: replaying 54 Luna responses changes the recorded estimate from $0.044146 to $0.045987; 79 Haiku responses change from $0.166045 to $0.718036, including context tiers.
Preserve aggregate and one-hour cache writes through adapters, core budgeting, persisted facts, session totals and displays. Canonical input includes reads and writes; normalized prompt excludes separately counted creation, so totals and charges include each token once. Raw chat usage is normalized idempotently. Share TUI normalization with the common implementation.
Carry whole-request pricing tiers with strict input thresholds and explicit native Anthropic one-hour rates. The generated catalog preserves all 470 existing model capacities and base rates while adding 94 tiers and 17 one-hour rates; snapshot provenance is documented. Provider-reported charges remain authoritative, and existing per-dimension micro-dollar rounding is retained.
Depends on qduc/agent-runtime#8. Until an owner package containing that change is published, use an owner-derived temporary patch that also preserves the existing 500k fallback. Removal conditions are documented. No packages were published; historical accepted cost facts are not rewritten.
Validation:
Seven per-file size exceptions document their local rationale and retirement conditions; global limits are unchanged. Independent review covered billing behavior and the exceptions. Cost estimates remain estimates rather than invoices.