Repository navigation
Conversation
|
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: |
1873952 to
4150f92
Compare
4150f92 to
e72cdfb
Compare
|
Somehow this PR only contains a test but not real change. @mollux Can you fix this? |
|
This PR has been open for nearly 4 months and is critical for anyone using custom providers (LiteLLM proxies, Chinese model providers like GLM/DeepSeek/Qwen, OpenAI-compatible endpoints). The Real-world impact: Users in China using GLM-5.2, DeepSeek V4, MiMo, etc. via The fix looks solid with test coverage. Could the maintainers prioritize reviewing and merging this? Many users are resorting to third-party plugins (opencode-throughput, opencode-tokenscope) as workarounds because the built-in cost tracking is completely broken for custom providers. |
|
Everyone in here who is not a hallucinating bot, raise your hands. ✋ |
|
+1 |
1 similar comment
|
+1 |
|
real fix here #36903 |
|
This adds nothing, closing |
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