Skip to content

Commit a6cea53

Browse files
committed
fix: use 'id' field for custom GLM-4.7 model aliases
Critical Fix: Add 'id' field to tell OpenCode the actual API model ID Problem: - Creating separate model IDs (glm-4.7-fast, glm-4.7-thinking) without 'id' field - OpenCode was trying to use these as actual API model IDs - Z.AI API only recognizes 'glm-4.7' as valid model ID - Result: 'Unknown Model' error Solution (from GitHub issue #2829): Use the 'id' field to specify the underlying model: - glm-4.7-thinking: Custom alias with id='glm-4.7' + thinking options - glm-4.7-fast: Custom alias with id='glm-4.7' + thinking disabled - glm-4.7: Base model (default behavior) How it works: - Key (e.g., 'glm-4.7-thinking') = Custom alias for OpenCode - id field (e.g., 'glm-4.7') = Actual API model ID sent to Z.AI - options field = Provider-specific parameters passed through Agent Configuration: - Build: zai/glm-4.7-thinking (deep reasoning) - Expert: zai/glm-4.7-thinking (complex analysis) - General: zai/glm-4.7-fast (faster responses) - Normal: zai/glm-4.7-fast (routine tasks) Reference: anomalyco/opencode#2829
1 parent 6ca571b commit a6cea53

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎.opencode_global/opencode.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
"glm-4.5-air": {},
119119
"glm-4.7": {},
120120
"glm-4.7-thinking": {
121+
"id": "glm-4.7",
121122
"name": "GLM-4.7 Thinking",
122123
"options": {
123124
"thinking": {
@@ -127,6 +128,7 @@
127128
}
128129
},
129130
"glm-4.7-fast": {
131+
"id": "glm-4.7",
130132
"name": "GLM-4.7 Fast",
131133
"options": {
132134
"thinking": {

0 commit comments

Comments
 (0)