opencode-thinking-fix 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/proxy/proxy.js +11 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-thinking-fix",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Fix DeepSeek/Kimi/GLM/MiMo reasoning_content 400 errors in OpenCode. Plugin + proxy + watchdog.",
5
5
  "license": "MIT",
6
6
  "author": "tbosancheros39",
package/proxy/proxy.js CHANGED
@@ -262,10 +262,21 @@ const server = http.createServer((req, res) => {
262
262
  const bj = JSON.parse(bodyStr)
263
263
 
264
264
  // Strip unsupported params for Kimi/Moonshot thinking mode
265
+ // Moonshot hardcodes sampling params for thinking models and rejects
266
+ // explicit values. Docs: https://platform.kimi.ai/docs/api/models-overview
265
267
  const isKimi = modelName.toLowerCase().startsWith('kimi') || modelName.toLowerCase().startsWith('moonshot')
266
268
  if (isKimi) {
269
+ delete bj.temperature
267
270
  delete bj.top_p
268
271
  delete bj.top_k
272
+ delete bj.presence_penalty
273
+ delete bj.frequency_penalty
274
+ delete bj.n
275
+ // K2.7 thinking is always on; do not send thinking/reasoning_effort controls
276
+ if (modelName.toLowerCase().startsWith('kimi-k2.7')) {
277
+ delete bj.thinking
278
+ delete bj.reasoning_effort
279
+ }
269
280
  }
270
281
 
271
282
  // Inject reasoning_split for MiniMax models (avoids <think> tags in content)