[Bug] Opencode should use config's name instead of id when using siliconflow-cn. #3990

Closed
opened 2026-02-16 17:42:12 -05:00 by yindo · 5 comments
Owner

Originally created by @Jostar1024 on GitHub (Dec 30, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

https://github.com/sst/opencode/issues/5615
After the above issue we can fetch the siliconflow-cn's model but cannot use it.

To make siliconflow-cn works with opencode, it should use the name in the config instead of id.

OpenCode version

1.0.207

Steps to reproduce

Image

For example, I tested it with deepseek-ai/DeepSeek-V3.2-Exp. It returns Bad Request: Model does not exist. Please check it carefully.

I checked the data in ~/.local/share/opencode/storage/message/ses_491b34852ffeUXhAHgQZeQ6iLm/, the output are the following.

// request
{
  "id": "msg_b6e4cb7af001mvoKGrBM0hQ8F4",
  "sessionID": "ses_491b34852ffeUXhAHgQZeQ6iLm",
  "role": "user",
  "time": {
    "created": 1767082080178
  },
  "summary": {
    "title": "Summarizing test text",
    "diffs": []
  },
  "agent": "build",
  "model": {
    "providerID": "siliconflow-cn",
    "modelID": "deepseek-ai-deepseek-v3.2-exp"
  }
}
// response
{
  "id": "msg_b6e4cb7b7001R6QFm74Sy9ood0",
  "sessionID": "ses_491b34852ffeUXhAHgQZeQ6iLm",
  "role": "assistant",
  "time": {
    "created": 1767082080183,
    "completed": 1767082080453
  },
  "error": {
    "name": "APIError",
    "data": {
      "message": "Bad Request: Model does not exist. Please check it carefully.",
      "statusCode": 400,
      "isRetryable": false,
      "responseHeaders": {
        "connection": "keep-alive",
        "content-length": "87",
        "content-type": "application/json; charset=utf-8",
        "date": "Tue, 30 Dec 2025 08:08:00 GMT",
        "x-siliconcloud-trace-id": "ti_zhibn3p1k2bfikoist"
      },
      "responseBody": "{\"code\":20012,\"message\":\"Model does not exist. Please check it carefully.\",\"data\":null}"
    }
  },
  "parentID": "msg_b6e4cb7af001mvoKGrBM0hQ8F4",
  "modelID": "deepseek-ai-deepseek-v3.2-exp",
  "providerID": "siliconflow-cn",
  "mode": "build",
  "agent": "build",
  "path": {
    "cwd": "/Users/yucheng/.config/mpv",
    "root": "/"
  },
  "cost": 0,
  "tokens": {
    "input": 0,
    "output": 0,
    "reasoning": 0,
    "cache": {
      "read": 0,
      "write": 0
    }
  }
}

After I changed the model's ID to its name in ~/.cache/opencode/models.json, opencode returns the correct result.

Image

Screenshot and/or share link

No response

Operating System

macOS 15.3.1

Terminal

Alacritty

Originally created by @Jostar1024 on GitHub (Dec 30, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description https://github.com/sst/opencode/issues/5615 After the above issue we can fetch the siliconflow-cn's model but cannot use it. To make siliconflow-cn works with opencode, it should use the `name` in the config instead of `id`. ### OpenCode version 1.0.207 ### Steps to reproduce <img width="1436" height="914" alt="Image" src="https://github.com/user-attachments/assets/54f50798-ff9d-429c-ad3e-9360e730abbb" /> For example, I tested it with `deepseek-ai/DeepSeek-V3.2-Exp`. It returns `Bad Request: Model does not exist. Please check it carefully.` I checked the data in `~/.local/share/opencode/storage/message/ses_491b34852ffeUXhAHgQZeQ6iLm/`, the output are the following. ```jsonc // request { "id": "msg_b6e4cb7af001mvoKGrBM0hQ8F4", "sessionID": "ses_491b34852ffeUXhAHgQZeQ6iLm", "role": "user", "time": { "created": 1767082080178 }, "summary": { "title": "Summarizing test text", "diffs": [] }, "agent": "build", "model": { "providerID": "siliconflow-cn", "modelID": "deepseek-ai-deepseek-v3.2-exp" } } // response { "id": "msg_b6e4cb7b7001R6QFm74Sy9ood0", "sessionID": "ses_491b34852ffeUXhAHgQZeQ6iLm", "role": "assistant", "time": { "created": 1767082080183, "completed": 1767082080453 }, "error": { "name": "APIError", "data": { "message": "Bad Request: Model does not exist. Please check it carefully.", "statusCode": 400, "isRetryable": false, "responseHeaders": { "connection": "keep-alive", "content-length": "87", "content-type": "application/json; charset=utf-8", "date": "Tue, 30 Dec 2025 08:08:00 GMT", "x-siliconcloud-trace-id": "ti_zhibn3p1k2bfikoist" }, "responseBody": "{\"code\":20012,\"message\":\"Model does not exist. Please check it carefully.\",\"data\":null}" } }, "parentID": "msg_b6e4cb7af001mvoKGrBM0hQ8F4", "modelID": "deepseek-ai-deepseek-v3.2-exp", "providerID": "siliconflow-cn", "mode": "build", "agent": "build", "path": { "cwd": "/Users/yucheng/.config/mpv", "root": "/" }, "cost": 0, "tokens": { "input": 0, "output": 0, "reasoning": 0, "cache": { "read": 0, "write": 0 } } } ``` After I changed the model's ID to its name in `~/.cache/opencode/models.json`, `opencode` returns the correct result. <img width="1025" height="914" alt="Image" src="https://github.com/user-attachments/assets/62c80a61-541c-4b41-8b88-7bf1351b2e92" /> ### Screenshot and/or share link _No response_ ### Operating System macOS 15.3.1 ### Terminal Alacritty
yindo added the bug label 2026-02-16 17:42:12 -05:00
yindo closed this issue 2026-02-16 17:42:12 -05:00
Author
Owner

@rekram1-node commented on GitHub (Dec 30, 2025):

Yeah we should fix the model then (the list is at models.dev)

@rekram1-node commented on GitHub (Dec 30, 2025): Yeah we should fix the model then (the list is at models.dev)
Author
Owner

@cravenceiling commented on GitHub (Dec 30, 2025):

@rekram1-node i just created this PR.

@cravenceiling commented on GitHub (Dec 30, 2025): @rekram1-node i just created [this PR](https://github.com/sst/models.dev/pull/587).
Author
Owner

@cravenceiling commented on GitHub (Dec 31, 2025):

@Jostar1024 the PR was merged, could you check if it's working? please.

@cravenceiling commented on GitHub (Dec 31, 2025): @Jostar1024 the PR was merged, could you check if it's working? please.
Author
Owner

@rekram1-node commented on GitHub (Dec 31, 2025):

To ensure the model list is updated run:

opencode models --refresh

@rekram1-node commented on GitHub (Dec 31, 2025): To ensure the model list is updated run: opencode models --refresh
Author
Owner

@Jostar1024 commented on GitHub (Jan 8, 2026):

Thank you I can successfully use it!

@Jostar1024 commented on GitHub (Jan 8, 2026): Thank you I can successfully use it!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3990