Commit 3741101
committed
fix(provider): gate zai/zhipuai thinking injection on reasoning capability and restore GLM variants
- Only inject `thinking: { type: "enabled", clear_thinking: false }` for
z.ai/zhipuai models that have `capabilities.reasoning = true`. Previously
this was sent unconditionally, causing non-reasoning GLM models (e.g.
glm-5-turbo, glm-4.5-flash) to return empty responses silently.
- Remove `id.includes("glm")` from the early-return exclusion block in
`variants()`. GLM reasoning models routed through `@ai-sdk/openai-compatible`
now fall through to the correct switch case and return
`{ low, medium, high }` reasoning-effort variants.
- Update tests: GLM variant test now asserts reasoning efforts are returned;
add non-reasoning z.ai model test to confirm thinking is not injected.1 parent cfbbae7 commit 3741101
2 files changed
Lines changed: 33 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
410 | | - | |
411 | 410 | | |
412 | 411 | | |
413 | 412 | | |
| |||
828 | 827 | | |
829 | 828 | | |
830 | 829 | | |
831 | | - | |
| 830 | + | |
| 831 | + | |
832 | 832 | | |
833 | 833 | | |
834 | 834 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
172 | 193 | | |
173 | 194 | | |
174 | 195 | | |
| |||
2099 | 2120 | | |
2100 | 2121 | | |
2101 | 2122 | | |
2102 | | - | |
| 2123 | + | |
2103 | 2124 | | |
2104 | | - | |
2105 | | - | |
| 2125 | + | |
| 2126 | + | |
2106 | 2127 | | |
2107 | | - | |
2108 | | - | |
| 2128 | + | |
| 2129 | + | |
2109 | 2130 | | |
2110 | 2131 | | |
2111 | 2132 | | |
2112 | 2133 | | |
2113 | | - | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
2114 | 2139 | | |
2115 | 2140 | | |
2116 | 2141 | | |
| |||
0 commit comments