[PR #973] [CLOSED] fix: Use model cost defined in config, if set. #9766

Closed
opened 2026-02-16 18:14:08 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/973
Author: @AurelienTollard
Created: 7/14/2025
Status: Closed

Base: devHead: fix/model-cost


📝 Commits (3)

  • a207d1b fix: Use model cost from config, if set
  • 44b48f5 Less verbose approach
  • 24560cf Update provider.ts

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 packages/opencode/src/provider/provider.ts (+2 -2)

📄 Description

Currently, cost that are defined in config file such as:

  "provider": {
    "openrouter": {
      "models": {
        "qwen/qwen3-235b-a22b": {
          "cost": {
            "input": 0.60,
            "output": 1.20
          },
...

Are ignored and overwritten to 0.
We should give priority to config values, then existing values and finally in last option to 0s.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/973 **Author:** [@AurelienTollard](https://github.com/AurelienTollard) **Created:** 7/14/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix/model-cost` --- ### 📝 Commits (3) - [`a207d1b`](https://github.com/anomalyco/opencode/commit/a207d1b9aa755a12ae48c26d87cc6d4c69cd8339) fix: Use model cost from config, if set - [`44b48f5`](https://github.com/anomalyco/opencode/commit/44b48f5236437b563d41686d1f85b489f61457f8) Less verbose approach - [`24560cf`](https://github.com/anomalyco/opencode/commit/24560cfebcc7e3d2b3516c2e86678e151be1f82b) Update provider.ts ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/opencode/src/provider/provider.ts` (+2 -2) </details> ### 📄 Description Currently, cost that are defined in config file such as: ```json "provider": { "openrouter": { "models": { "qwen/qwen3-235b-a22b": { "cost": { "input": 0.60, "output": 1.20 }, ... ``` Are ignored and overwritten to 0. We should give priority to config values, then existing values and finally in last option to 0s. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:14:08 -05:00
yindo closed this issue 2026-02-16 18:14:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9766