Repository navigation
Commit a6cea53
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#28291 parent 6ca571b commit a6cea53
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
| |||
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| 131 | + | |
130 | 132 | | |
131 | 133 | | |
132 | 134 | | |
| |||
0 commit comments