@raolin2025/claude-code-node 2.8.8 → 2.8.9
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/src/core/query-engine.js +14 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raolin2025/claude-code-node",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.9",
|
|
4
4
|
"description": "Node.js AI Code Agent CLI - Zero dependencies, pure JavaScript, security hardened, multi-channel notifications, Telegram & QQ Bot remote programming, rich media upload, multi-account management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/core/index.js",
|
package/src/core/query-engine.js
CHANGED
|
@@ -356,6 +356,20 @@ export class QueryEngine {
|
|
|
356
356
|
...(useStream && { stream: true }),
|
|
357
357
|
}
|
|
358
358
|
|
|
359
|
+
// [debug] 打印实际发送请求的关键信息,用于排查"模型为何不调用工具"
|
|
360
|
+
if (this.config.verbose) {
|
|
361
|
+
const sysCount = messages.filter(m => m.role === 'system').length
|
|
362
|
+
const toolCallsInHistory = messages.filter(m => m.role === 'assistant' && m.tool_calls).length
|
|
363
|
+
console.error(`[debug] → ${url}`)
|
|
364
|
+
console.error(`[debug] model=${body.model} | messages=${messages.length} (system=${sysCount}, user=${messages.filter(m=>m.role==='user').length}, assistant=${messages.filter(m=>m.role==='assistant').length}, tool=${messages.filter(m=>m.role==='tool').length}) | tools=${tools.length} | max_tokens=${body.max_tokens}`)
|
|
365
|
+
console.error(`[debug] history tool_calls=${toolCallsInHistory} | 首条=${messages[0]?.role}:${String(messages[0]?.content).slice(0,40)} | 末条=${messages[messages.length-1]?.role}:${String(messages[messages.length-1]?.content).slice(0,40)}`)
|
|
366
|
+
if (tools.length) {
|
|
367
|
+
console.error(`[debug] 工具名: ${tools.map(t=>t.function.name).join(', ')}`)
|
|
368
|
+
} else {
|
|
369
|
+
console.error(`[debug] ⚠️ tools 为空!请求未携带工具定义,模型不会调用工具`)
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
359
373
|
// DeepSeek V4: 默认启用 thinking mode → 要求回传 reasoning_content
|
|
360
374
|
// 这里显式关闭,避免 tool call 场景下的 400 错误
|
|
361
375
|
// thinking 参数是 DeepSeek 私有扩展,直接放在 body 顶层
|