Blank or missing model names in /models — OpenCode v2
Quick fix
Remove empty name fields from the OpenCode configuration to restore names. Saving again in CC Switch brings the issue back; no official fix is documented.
Symptom
Section titled “Symptom”模型的名称显示为**空白**,在 `/models` 列表中这些模型看起来"消失"了(无法辨识、难以选择)。Model names appear **blank**, making these models seem to have "disappeared" from the `/models` list (unidentifiable and difficult to select).
According to the reporter, CC Switch 3.20.3 writes "name": "" for OpenCode models. OpenCode v2 resolves display names using model.name ?? modelID, falling back to the model ID only for null or undefined, so an empty string appears blank. The reporter encountered this on Linux with OpenCode v2.0.10 and said the previously used v1 1.18.x was unaffected. Multiple providers on their machine had empty name fields.
The reporter confirmed that correcting the empty name fields restored model IDs as the name values returned by the model API, but saving the configuration again in CC Switch rewrote the empty strings. The reporter proposed omitting the name field for unnamed models or treating empty strings as unnamed when reading existing data. The issue remains open, with no official fix confirmed by a maintainer.
Temporary workaround: edit ~/.config/opencode/opencode.json and remove name fields whose values are empty strings from model objects. Keep the model IDs and other configuration. The following example shows the change for a model from the original thread.
// ~/.config/opencode/opencode.json"deepseek/deepseek-v4-pro": { "name": "" },"deepseek/deepseek-v4-pro": {},Use opencode api get /api/model from the original thread to check whether the returned name values are model IDs again, and check their display in /models. The reporter confirmed that the API returned the restored names after the change.
Saving the configuration again in CC Switch rewrites empty name fields, causing the issue to recur. This is a user-verified temporary workaround; follow issue #7523 for the status of a permanent fix.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 1 real issues
(No FAQ yet)
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.