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.
- package/package.json +1 -1
- package/proxy/proxy.js +11 -0
package/package.json
CHANGED
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)
|