@huai_xin/dsh-workbuddy 0.1.10 → 0.1.11
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/adapter.js +0 -14
package/package.json
CHANGED
package/src/adapter.js
CHANGED
|
@@ -975,20 +975,6 @@ export class WorkBuddyAdapter {
|
|
|
975
975
|
}
|
|
976
976
|
|
|
977
977
|
const argsTruncated = [...toolCalls.values()].some((block) => isTruncatedArguments(block.text))
|
|
978
|
-
// A step that ends with prose and no tool call *looks* like the model choosing to
|
|
979
|
-
// stop, so nothing else records it — and "it stopped mid-answer" arrives as a bug
|
|
980
|
-
// report with no evidence. These two shapes are the ones seen in practice:
|
|
981
|
-
// an announcement that expects a next action ("……:" / "………") and a statement of
|
|
982
|
-
// inability ("我需要先读取…" / "我无法…"). Logging them with the raw reason and the
|
|
983
|
-
// text turns the next report into a fact.
|
|
984
|
-
if (streamEnded === true && toolOrder.length === 0 && (finishReason === 'stop' || finishReason === undefined)) {
|
|
985
|
-
const prose = blocks.find((block) => block.kind === 'text')?.text ?? ''
|
|
986
|
-
const tail = prose.trim()
|
|
987
|
-
const suspicious = /[::…]$/.test(tail) || /(我需要|我没有|我无法|先读取|无法直接|不能直接)/.test(tail)
|
|
988
|
-
if (suspicious) {
|
|
989
|
-
this.ctx.logger.warn(`[workbuddy] ${this.region.id}: ${options.model} 疑似提前收尾(finish_reason=${finishReason ?? '(无)'},输出 ${outputTokens ?? '未知'} tokens,无工具调用):「${tail.slice(0, 60)}」`)
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
978
|
// A stream that stops without the `[DONE]` sentinel was cut, not finished:
|
|
993
979
|
// upstream closed the connection mid-answer. Reporting that as a normal stop
|
|
994
980
|
// ends the turn silently — the model looks like it simply chose to stop — and
|