jbc-dssi 1.1.74 → 1.1.75
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
|
@@ -176,9 +176,17 @@ export function createDeliver({
|
|
|
176
176
|
*/
|
|
177
177
|
const turnStepNums = new Map();
|
|
178
178
|
let lastTurn = -1;
|
|
179
|
-
/**
|
|
179
|
+
/** 本轮的过程摘要数据:turn 开始时间 + 思考次数 + 工具调用次数 + 结束时算用时。 */
|
|
180
180
|
let turnStartAt = 0;
|
|
181
181
|
let toolCalls = 0;
|
|
182
|
+
/**
|
|
183
|
+
* 思考次数(2026-11-06 老谢定:群聊那行灰字由「已思考」改成「N 次思考」)。
|
|
184
|
+
*
|
|
185
|
+
* 口径与单聊完全一致 —— **思考按段计**:一条 assistant/message 里只要有
|
|
186
|
+
* 非空的 reasoning 块就算 1 次(单聊那边就是"有 reasoning 的 segment 数")。
|
|
187
|
+
* 同一步重试会各算一次(与用量按 attempt 累加同源),不额外去重。
|
|
188
|
+
*/
|
|
189
|
+
let reasoningCount = 0;
|
|
182
190
|
|
|
183
191
|
const clearIdle = () => {
|
|
184
192
|
if (idleTimer) { clearTimeout(idleTimer); idleTimer = null; }
|
|
@@ -281,6 +289,7 @@ export function createDeliver({
|
|
|
281
289
|
if (Array.isArray(content)) {
|
|
282
290
|
for (const item of content) {
|
|
283
291
|
if (item?.type === 'tool-call' || item?.type === 'tool_use' || item?.type === 'toolUse') toolCalls += 1;
|
|
292
|
+
if (item?.type === 'reasoning' && String(item?.text ?? '').trim() !== '') reasoningCount += 1;
|
|
284
293
|
}
|
|
285
294
|
}
|
|
286
295
|
const step = typeof data.step === 'number' ? data.step : -1;
|
|
@@ -320,10 +329,10 @@ export function createDeliver({
|
|
|
320
329
|
* 预算耗尽后迟到的真实结果 → 作为**同一轮的补发行**落库(回填,不丢弃)。
|
|
321
330
|
* 这是"不用 240 秒误判长任务"的最后一环。
|
|
322
331
|
*/
|
|
323
|
-
emitLateReply(group, member, { text: lastText, usage: turnUsage, steps, stepUsages, toolCalls, durationMs }, roundNo);
|
|
332
|
+
emitLateReply(group, member, { text: lastText, usage: turnUsage, steps, stepUsages, toolCalls, reasoningCount, durationMs }, roundNo);
|
|
324
333
|
followClosed = true;
|
|
325
334
|
} else {
|
|
326
|
-
settle({ text: lastText, usage: turnUsage, steps, stepUsages, toolCalls, durationMs });
|
|
335
|
+
settle({ text: lastText, usage: turnUsage, steps, stepUsages, toolCalls, reasoningCount, durationMs });
|
|
327
336
|
}
|
|
328
337
|
if (lateTimer) { clearTimeout(lateTimer); lateTimer = null; }
|
|
329
338
|
ac.abort();
|
|
@@ -62,6 +62,7 @@ export function createSettler({ state, save, broadcast, log, now = () => Date.no
|
|
|
62
62
|
line.usage = result.usage ?? line.usage ?? null
|
|
63
63
|
line.steps = result.steps ?? 0
|
|
64
64
|
line.toolCalls = Number(result.toolCalls) || 0
|
|
65
|
+
line.reasoningCount = Number(result.reasoningCount) || 0
|
|
65
66
|
line.durationMs = Number(result.durationMs) || 0
|
|
66
67
|
line.stepUsages =
|
|
67
68
|
Array.isArray(result.stepUsages) && result.stepUsages.length > 0 ? result.stepUsages : undefined
|
|
@@ -82,6 +83,7 @@ export function createSettler({ state, save, broadcast, log, now = () => Date.no
|
|
|
82
83
|
steps: result.steps ?? 0,
|
|
83
84
|
// 「已思考 · N 次工具调用 · 用时 X」(2026-11-02):本轮总结数据,随行持久化
|
|
84
85
|
toolCalls: Number(result.toolCalls) || 0,
|
|
86
|
+
reasoningCount: Number(result.reasoningCount) || 0,
|
|
85
87
|
durationMs: Number(result.durationMs) || 0,
|
|
86
88
|
stepUsages: Array.isArray(result.stepUsages) && result.stepUsages.length > 0 ? result.stepUsages : undefined,
|
|
87
89
|
late: true,
|
|
@@ -117,6 +119,7 @@ export function createSettler({ state, save, broadcast, log, now = () => Date.no
|
|
|
117
119
|
steps: result.steps ?? 0,
|
|
118
120
|
// 「已思考 · N 次工具调用 · 用时 X」(2026-11-02):本轮总结数据,随行持久化
|
|
119
121
|
toolCalls: Number(result.toolCalls) || 0,
|
|
122
|
+
reasoningCount: Number(result.reasoningCount) || 0,
|
|
120
123
|
durationMs: Number(result.durationMs) || 0,
|
|
121
124
|
// 只有真的收到过 usage 才写这个字段;否则 JSON 里不出现(= 老格式,读侧回落)
|
|
122
125
|
stepUsages: Array.isArray(result.stepUsages) && result.stepUsages.length > 0
|