dsh-plugin-subagent-bridge 0.15.2 → 0.16.0
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 +13 -3
- package/README.zh-CN.md +8 -0
- package/index.js +8 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -145,13 +145,22 @@ Two measured facts:
|
|
|
145
145
|
A worker that calls `ask_user_question` waits for a human. When the caller is another agent, nobody is there. So the bridge appends a standing instruction to every delegated task:
|
|
146
146
|
|
|
147
147
|
```
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
(If information is missing, or a choice between options is required, pick the most
|
|
149
|
+
reasonable default, finish the task, and state the assumption in one line. Do not
|
|
150
|
+
hand the decision back to the user and do not call ask_user_question.)
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Set your own wording with `assumptionPolicy`:
|
|
154
|
+
|
|
155
|
+
```yaml
|
|
156
|
+
config:
|
|
157
|
+
assumptionPolicy: "If information is missing, pick the most reasonable default, finish the task, and state the assumption in one line. Do not ask the user and do not call ask_user_question."
|
|
151
158
|
```
|
|
152
159
|
|
|
153
160
|
On by default (`assumeDefaults: false` disables it). It is skipped when the prompt already mentions `ask_user_question`.
|
|
154
161
|
|
|
162
|
+
> The built-in default text is Chinese (`如果缺少必要信息……`), which every model in this host reads; the block above is that instruction in English. Set `assumptionPolicy` to send English verbatim.
|
|
163
|
+
|
|
155
164
|
### Questions (`pendingQuestion`)
|
|
156
165
|
|
|
157
166
|
If a worker does ask, `dsh_wait` reports it:
|
|
@@ -215,6 +224,7 @@ Returns `{ ok, text, sessionId, durationMs }`. Runs `claude -p --output-format j
|
|
|
215
224
|
| `maxResultChars` | `20000` | Cap on a single result payload (the head is kept) |
|
|
216
225
|
| `taskTimeoutSeconds` | `300` | `dsh_task` wait cap (client may override, max 240) |
|
|
217
226
|
| `assumeDefaults` | `true` | Append the decide-and-continue instruction |
|
|
227
|
+
| `assumptionPolicy` | *(empty)* | Replacement text for the instruction; empty uses the built-in Chinese default |
|
|
218
228
|
| `workersFile` | `~/.dsh/bridge/workers.json` | Worker registry (`0600`) |
|
|
219
229
|
| `maxHops` | `1` | Delegation depth limit |
|
|
220
230
|
| `dispatchPerMinute` | `10` | Dispatches allowed per window |
|
package/README.zh-CN.md
CHANGED
|
@@ -152,6 +152,13 @@ dsh_followup({ worker: "w1", message: "接下来只改 src 下的文件", mode:
|
|
|
152
152
|
|
|
153
153
|
默认开启(`assumeDefaults: false` 可关闭)。prompt 里本来就提到 `ask_user_question` 时不追加。
|
|
154
154
|
|
|
155
|
+
想换成自己的措辞——比如英文——用 `assumptionPolicy`:
|
|
156
|
+
|
|
157
|
+
```yaml
|
|
158
|
+
config:
|
|
159
|
+
assumptionPolicy: "If information is missing, pick the most reasonable default, finish the task, and state the assumption in one line. Do not ask the user or call ask_user_question."
|
|
160
|
+
```
|
|
161
|
+
|
|
155
162
|
### 问题上报
|
|
156
163
|
|
|
157
164
|
worker 真的提问时,`dsh_wait` 会把问题带出来:
|
|
@@ -215,6 +222,7 @@ worker 真的提问时,`dsh_wait` 会把问题带出来:
|
|
|
215
222
|
| `maxResultChars` | `20000` | 单次结果载荷上限(保留开头) |
|
|
216
223
|
| `taskTimeoutSeconds` | `300` | `dsh_task` 等待上限(客户端可覆盖,最大 240) |
|
|
217
224
|
| `assumeDefaults` | `true` | 追加「自行决策」指令 |
|
|
225
|
+
| `assumptionPolicy` | 空 | 替换指令正文;空表示用内置中文默认 |
|
|
218
226
|
| `workersFile` | `~/.dsh/bridge/workers.json` | worker 注册表(`0600`) |
|
|
219
227
|
| `maxHops` | `1` | 委派深度上限 |
|
|
220
228
|
| `dispatchPerMinute` | `10` | 每个窗口允许的派发次数 |
|
package/index.js
CHANGED
|
@@ -76,6 +76,7 @@ const DEFAULTS = {
|
|
|
76
76
|
codexSandbox: 'workspace-write',
|
|
77
77
|
codexTimeoutMs: 300000,
|
|
78
78
|
assumeDefaults: true,
|
|
79
|
+
assumptionPolicy: '',
|
|
79
80
|
claudeBin: 'claude',
|
|
80
81
|
claudeModel: '',
|
|
81
82
|
claudeTimeoutMs: 300000,
|
|
@@ -329,7 +330,9 @@ const ASSUMPTION_POLICY =
|
|
|
329
330
|
function withAssumptionPolicy(settings, message) {
|
|
330
331
|
if (settings.assumeDefaults !== true) return message
|
|
331
332
|
if (message.includes('ask_user_question')) return message
|
|
332
|
-
|
|
333
|
+
const custom = typeof settings.assumptionPolicy === 'string' ? settings.assumptionPolicy.trim() : ''
|
|
334
|
+
const policy = custom === '' ? ASSUMPTION_POLICY : custom
|
|
335
|
+
return `${message}\n\n(${policy})`
|
|
333
336
|
}
|
|
334
337
|
|
|
335
338
|
/**
|
|
@@ -2336,6 +2339,10 @@ function resolveSettings(config) {
|
|
|
2336
2339
|
merged.assumeDefaults = value === true || value === 'true'
|
|
2337
2340
|
continue
|
|
2338
2341
|
}
|
|
2342
|
+
if (key === 'assumptionPolicy' && typeof value === 'string') {
|
|
2343
|
+
merged.assumptionPolicy = value.trim()
|
|
2344
|
+
continue
|
|
2345
|
+
}
|
|
2339
2346
|
if (key === 'claudeBin' && typeof value === 'string' && value !== '') merged.claudeBin = value
|
|
2340
2347
|
if (key === 'claudeModel' && typeof value === 'string') merged.claudeModel = value
|
|
2341
2348
|
if (key === 'workersFile' && typeof value === 'string' && value !== '') merged.workersFile = expandHome(value)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-subagent-bridge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Subagent bridge: lets Codex delegate a task to DeepSeek Harness the way it would spawn a subagent (one call, waits for the answer), plus a codex_dispatch tool for the reverse direction.",
|
|
6
6
|
"keywords": [
|