@raolin2025/claude-code-node 2.2.1 → 2.2.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raolin2025/claude-code-node",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "description": "Node.js AI Code Agent CLI - Zero dependencies, pure JavaScript, security hardened, multi-channel notifications",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -293,6 +293,8 @@ export class QueryEngine {
293
293
  }))
294
294
 
295
295
  const useStream = !this.config.noStream
296
+ const modelLower = this.config.model.toLowerCase()
297
+
296
298
  const body = {
297
299
  model: this.config.model,
298
300
  messages,
@@ -301,6 +303,13 @@ export class QueryEngine {
301
303
  ...(useStream && { stream: true }),
302
304
  }
303
305
 
306
+ // DeepSeek V4: 默认启用 thinking mode → 要求回传 reasoning_content
307
+ // 这里显式关闭,避免 tool call 场景下的 400 错误
308
+ // thinking 参数是 DeepSeek 私有扩展,直接放在 body 顶层
309
+ if (modelLower.startsWith('deepseek-v')) {
310
+ body.thinking = { type: 'disabled' }
311
+ }
312
+
304
313
  const url = apiBase.replace(/\/+$/, '') + '/chat/completions'
305
314
 
306
315
  // H3 修复:SSRF 防护 — 在 fetch 之前检查 API 主机名