fix(provider): apply config model cost overrides at runtime#17645
Open
mollux wants to merge 1 commit intoanomalyco:devfrom
Open
fix(provider): apply config model cost overrides at runtime#17645mollux wants to merge 1 commit intoanomalyco:devfrom
mollux wants to merge 1 commit intoanomalyco:devfrom
Conversation
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
Any chance this will be merged soon? I use API accounts directly with providers that are often missing from the standard models.dev data, and thus specify most of my model configs (and pricing info) directly in my opencode.json config. This means that OpenCode's cost estimates are wildly inaccurate for me, even though the token usage counts are correct. In this example, it appears to be pricing the cached reads at $0 even though I have the correct config for $0.06/Mtok. The 1.5M input + 68.7K output looks to equal the $0.54 total it reports, but it's missing $0.66 of cached read cost: |
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.
Issue for this PR
Closes #17223
Type of change
What does this PR do?
This fixes a runtime gap where model prices from config could be present in resolved config but not applied on the final model object used for usage/cost calculations.
The change applies config model cost overrides during provider model finalization so cost values are consistently present before runtime usage math runs.
How did you verify your code works?
Screenshots / recordings
N/A (non-UI change)
Checklist