@huai_xin/dsh-workbuddy 0.1.6 → 0.1.7
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/README.md +0 -13
- package/package.json +1 -1
- package/src/adapter.js +1 -22
package/README.md
CHANGED
|
@@ -353,19 +353,6 @@ node test/live/dump-stream.mjs <会话前缀> <seq,…> # 打印那一步
|
|
|
353
353
|
node test/live/sampling-probe.mjs intl 4 # 同一提示在各 temperature 下的"提前 stop"率
|
|
354
354
|
```
|
|
355
355
|
|
|
356
|
-
### 采样参数(默认不发,可按需覆盖)
|
|
357
|
-
|
|
358
|
-
插件默认**不发送** `temperature` / `top_p` / `top_k`(harness 没暴露温度设置,`options.temperature` 实际为空),因此走上游默认采样。`stop` 本质是模型采到 EOS,偏热的默认值更容易在"现在我来改……:"这种地方收尾,所以留了两个覆盖开关:
|
|
359
|
-
|
|
360
|
-
```powershell
|
|
361
|
-
$env:WORKBUDDY_TEMPERATURE = '0.3'
|
|
362
|
-
$env:WORKBUDDY_TOP_P = '0.95'
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
优先级:**调用方显式传入的 `temperature`** > 环境变量 > 不发 ✓(默认行为对所有人不变 ✓)。改完需重启 DSH ✓。
|
|
366
|
-
|
|
367
|
-
> 实测(2026-10-22,海外版免费档 `deepseek-v4.1-flash`):一个明确要求调用工具的短提示,在"不发 / 0.2 / 0.5 / 1.0"四档各跑 4 次,**16/16 都正确调用了工具** —— 单纯温度解释不了真实会话里的提前收尾(那次输入有 213k 缓存 token,`effort=max` 却只有 0 个思考 token,更像长上下文下的例行续写)。这个开关是留给真实流量验证用的,默认不改输出风格。
|
|
368
|
-
|
|
369
356
|
## 许可
|
|
370
357
|
|
|
371
358
|
MIT,见 [`LICENSE`](LICENSE)。再次说明:本项目为第三方非官方插件,与腾讯 / WorkBuddy 无关联。
|
package/package.json
CHANGED
package/src/adapter.js
CHANGED
|
@@ -651,20 +651,7 @@ export class WorkBuddyAdapter {
|
|
|
651
651
|
function: { name: tool.name, description: tool.description, parameters: tool.parameters }
|
|
652
652
|
}))
|
|
653
653
|
if (tools !== undefined && tools.length > 0) body.tools = tools
|
|
654
|
-
|
|
655
|
-
// except for an explicit override. `stop` is the model sampling its
|
|
656
|
-
// end-of-sequence token, so on a hot default it can end a turn right after
|
|
657
|
-
// "现在我来改……:" instead of calling the tool, and nothing in the harness
|
|
658
|
-
// exposes a temperature to tune that. These two variables let an operator try a
|
|
659
|
-
// cooler profile without changing the default behaviour:
|
|
660
|
-
// WORKBUDDY_TEMPERATURE=0.3 WORKBUDDY_TOP_P=0.95
|
|
661
|
-
// Measured 2026-10-22: a short tool-using prompt called the tool 16/16 times at
|
|
662
|
-
// the default and at 0.2/0.5/1.0, so sampling alone does not explain the early
|
|
663
|
-
// stops; the override exists to test the long-context case on real traffic.
|
|
664
|
-
const temperature = options.temperature ?? envNumber('WORKBUDDY_TEMPERATURE')
|
|
665
|
-
if (temperature !== undefined) body.temperature = temperature
|
|
666
|
-
const topP = envNumber('WORKBUDDY_TOP_P')
|
|
667
|
-
if (topP !== undefined) body.top_p = topP
|
|
654
|
+
if (options.temperature !== undefined) body.temperature = options.temperature
|
|
668
655
|
if (options.stop !== undefined && options.stop.length > 0) body.stop = options.stop
|
|
669
656
|
const maxTokens = positiveInt(options.maxTokens) ?? entry?.maxTokens
|
|
670
657
|
if (maxTokens !== undefined) body.max_tokens = maxTokens
|
|
@@ -1040,14 +1027,6 @@ function positiveInt(value) {
|
|
|
1040
1027
|
return typeof value === 'number' && Number.isSafeInteger(value) && value > 0 ? value : undefined
|
|
1041
1028
|
}
|
|
1042
1029
|
|
|
1043
|
-
/** A numeric override from the environment, or `undefined` when unset/unusable. */
|
|
1044
|
-
function envNumber(name) {
|
|
1045
|
-
const raw = process.env[name]
|
|
1046
|
-
if (typeof raw !== 'string' || raw.trim().length === 0) return undefined
|
|
1047
|
-
const value = Number(raw)
|
|
1048
|
-
return Number.isFinite(value) ? value : undefined
|
|
1049
|
-
}
|
|
1050
|
-
|
|
1051
1030
|
/**
|
|
1052
1031
|
* Describe a stream that ended without its terminator.
|
|
1053
1032
|
*
|