dsh-taskbridge 1.3.2 → 1.4.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/CHANGELOG.md +10 -0
- package/README.md +17 -13
- package/bin/dsh-delegate-mcp.js +4 -0
- package/codex/dsh-taskbridge.toml +116 -24
- package/docs/INTRODUCTION.md +3 -1
- package/docs/INTRODUCTION.zh.md +4 -2
- package/docs/codex-integration.md +51 -20
- package/docs/plugin-market.md +1 -1
- package/docs/releases/1.4.0-token-benchmark.zh.md +40 -0
- package/docs/releases/1.4.0.zh.md +54 -0
- package/docs/runtime-compatibility.md +11 -9
- package/docs/silent-wait.md +73 -10
- package/docs/taskbridge-upgrade.md +1 -1
- package/lib/client.js +149 -47
- package/package.json +143 -140
- package/src/client/api.js +205 -46
- package/src/client/index.jsx +82 -27
- package/src/codex/installer.js +31 -6
- package/src/config/defaults.js +12 -0
- package/src/config/settings.js +12 -10
- package/src/config/validate.js +26 -11
- package/src/http/execution-plane.js +58 -4
- package/src/http/respond.js +179 -175
- package/src/index.d.ts +102 -2
- package/src/index.js +1 -1
- package/src/jobs/activity.js +1369 -1008
- package/src/jobs/diagnostics.js +15 -0
- package/src/jobs/engine.js +295 -10
- package/src/jobs/history.js +28 -0
- package/src/mcp/server.js +140 -14
- package/src/mcp/wait.js +49 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.4.0 — 静默等待、重复失败提醒与宿主审查闭环
|
|
4
|
+
|
|
5
|
+
- **长等待与集中审查。** Codex companion、MCP 说明和文档统一要求正常调用 `delegate_wait({ taskId })` 时省略短 `waitSeconds`。外层工具允许长 yield 时保持同一次等待;提前返回仍运行的单元则续接同一个单元,不重复派工、不反复读取中间代码。执行期间由程序观察,交付后由指挥端集中审查,需要修正时续接原任务。
|
|
6
|
+
- **澄清无活动监控。** 保留默认连续 5 分钟无活动时程序自检、10 分钟时请求指挥端判断。真实输出、思考和工具事件重新计时;心跳和页面刷新不重置。等待结束不代表执行结束,提醒不自动取消、重派、换模型或延长时限。
|
|
7
|
+
- **新增重复失败提醒。** `monitoring.repeatFailureThreshold` 默认 3,允许 0–20,0 关闭。只对相同工具、相同操作的连续相同结构化失败提醒一次;成功或失败身份变化重新计数。审批和任务结局优先,原始参数、错误正文和思考内容不进入提醒记录。高级设置、任务详情、历史与公开类型同步支持。
|
|
8
|
+
- **宿主审查写回。** 新增 `delegate_review`,由宿主审查后明确记录 accepted/changes-requested;任务页显示“审查通过”或“需要修正”。保留旧执行状态兼容,执行者不能通过交付自动验收,旧记录不补写虚构结论。审查写回不授予权限、不合并工作树、不修改执行路由。
|
|
9
|
+
- **阶段和兼容修复。** 执行尚未开始时保留 before-create,失败后同步失败阶段;晚到事件不覆盖审批或终态。补齐已发布 1.3.2 Codex 模板的精确识别和启动刷新;保留自定义智能体。旧监控配置及历史字段兼容,修复表单校验与保存时丢失其他草稿的问题。
|
|
10
|
+
- **验证与测量口径。** 当前客户端已完成真实墙钟 20 分 2 秒的模拟活动等待,中途零 GPT 续等;它不是提供方连续执行 20 分钟的任务。另做同聊天、同模型、每组约 45 秒的实际用量对照,等待阶段输入加输出从 507,885 降至 169,734 token,样本减少 66.58%。不将该比例宣传为完整任务、账单或所有客户端的固定节省。
|
|
11
|
+
- 本版未新增 CLI 执行通道或 Claude Code 一键安装。更新方法和验证边界见 `docs/releases/1.4.0.zh.md`,测量方法见 `docs/releases/1.4.0-token-benchmark.zh.md`。
|
|
12
|
+
|
|
3
13
|
## 1.3.2 — TaskBridge companion and descriptive task workspace names
|
|
4
14
|
|
|
5
15
|
- Rename the shipped Codex companion to `dsh-taskbridge` (`agents/dsh-taskbridge.toml`). Install and startup migrate an unchanged, recognized published `dsh-delegate.toml` and remove the old managed file; edited agent files remain operator-owned. Add TaskBridge CLI aliases while retaining the existing binaries and internal MCP identifiers.
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
- [从 DSH Delegate/TaskDispatch 迁移到 TaskBridge](docs/taskbridge-upgrade.md):包名为 `dsh-taskbridge`,保留旧数据和 MCP 技术标识,不要同时启用新旧插件。
|
|
9
9
|
- [在 DSH“发现”中搜索和安装](docs/plugin-market.md):添加本项目的自定义索引,安装源固定到本项目的 Git 提交。
|
|
10
10
|
- [Claude Code 手动 MCP 接入](docs/claude-code.md);Codex 继续使用设置页的安装/修复按钮。Claude Code 的一键安装按钮和真实客户端验收尚未完成。
|
|
11
|
-
- [1.
|
|
11
|
+
- [1.4.0 更新说明](docs/releases/1.4.0.zh.md):长等待规则、重复失败提醒和宿主审查结果写回;[等待阶段 token 测量](docs/releases/1.4.0-token-benchmark.zh.md)说明短时样本的 66.58% 降幅及适用边界。历史 [1.3.2 更新说明](docs/releases/1.3.2.zh.md)保留。
|
|
12
12
|
|
|
13
13
|
DeepSeek Harness(DSH)的委托插件:让 MCP 宿主在你开启本机总开关后,调用 DSH
|
|
14
14
|
已配置的接口执行任务,执行结果回到宿主(例如 Codex)自行验收。
|
|
@@ -16,7 +16,7 @@ DeepSeek Harness(DSH)的委托插件:让 MCP 宿主在你开启本机总
|
|
|
16
16
|
新安装时本机调用总开关默认关闭。开关状态会保存在插件设置中,重启后恢复保存值;
|
|
17
17
|
关闭时拒绝新的委派任务,并请求停止正在运行的任务。
|
|
18
18
|
|
|
19
|
-
> **发布版本:`1.
|
|
19
|
+
> **发布版本:`1.4.0`(静默等待、重复失败提醒与审查状态闭环)。** 源码仓库和可下载的 Release
|
|
20
20
|
> 位于 [GitHub](https://github.com/ranranyya/dsh-taskbridge)。npm 安装标识为 **`dsh-taskbridge`**,
|
|
21
21
|
> GitHub Release 同时提供 `.tgz`。`1.1.0` 的静默等待说明见
|
|
22
22
|
> [`docs/silent-wait.md`](./docs/silent-wait.md);`1.2.0` 修正了其中三处真实问题(等待中断的
|
|
@@ -47,13 +47,13 @@ profile 是**应用保留的**:npm / `dsh plugin` CLI 对该 profile 的操作
|
|
|
47
47
|
Desktop 侧的包操作只能交给应用完成——不要在 Desktop 的正式 profile 里执行 npm/pnpm
|
|
48
48
|
命令,也不要直接编辑其中的文件。
|
|
49
49
|
|
|
50
|
-
1. 打开 Desktop 的 **Plugins manager → 添加插件**,输入 **`dsh-taskbridge@1.
|
|
50
|
+
1. 打开 Desktop 的 **Plugins manager → 添加插件**,输入 **`dsh-taskbridge@1.4.0`**。
|
|
51
51
|
若中国大陆镜像尚未同步,先选择 npm 官方源再重试。安装后的显示名为 **DSH TaskBridge**。
|
|
52
52
|
也可以从本项目 Release 下载 `.tgz`,或在仓库根目录打包:
|
|
53
53
|
|
|
54
54
|
```bash
|
|
55
55
|
npm pack
|
|
56
|
-
# → dsh-taskbridge-1.
|
|
56
|
+
# → dsh-taskbridge-1.4.0.tgz
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
2. 使用本地包时,通过 **添加插件**入口选择下载或生成的 `.tgz`(或本仓库目录)完成安装。
|
|
@@ -67,7 +67,7 @@ Desktop 侧的包操作只能交给应用完成——不要在 Desktop 的正式
|
|
|
67
67
|
|
|
68
68
|
```bash
|
|
69
69
|
# 装进一个 profile(例:web)
|
|
70
|
-
dsh plugin --profile web add ./dsh-taskbridge-1.
|
|
70
|
+
dsh plugin --profile web add ./dsh-taskbridge-1.4.0.tgz && dsh plugin --profile web why dsh-taskbridge
|
|
71
71
|
|
|
72
72
|
# 启动(首次启动会自动把插件 bundle 追加到 dsh.profile.bundles)
|
|
73
73
|
dsh --profile web
|
|
@@ -80,7 +80,7 @@ dsh --profile web
|
|
|
80
80
|
### 说明与注意
|
|
81
81
|
|
|
82
82
|
- **不要装进你正在用的正式 profile 做试验。** 建议先用一次性 profile:
|
|
83
|
-
`dsh plugin --profile dsh-delegate-try add ./dsh-taskbridge-1.
|
|
83
|
+
`dsh plugin --profile dsh-delegate-try add ./dsh-taskbridge-1.4.0.tgz`,再把
|
|
84
84
|
`DSH_HOME` 指向临时目录做隔离验证。该命令同样只用于 CLI profile。
|
|
85
85
|
- 该包声明了 `@deepseek-ai/dsh-*` 的 peer,若你的包管理器默认自动安装 peer,
|
|
86
86
|
安装过程会尝试解析这些版本。可显式关闭:`npm_config_auto_install_peers=false`
|
|
@@ -146,14 +146,18 @@ dsh --profile web
|
|
|
146
146
|
|
|
147
147
|
## 6. MCP(stdio)接入
|
|
148
148
|
|
|
149
|
-
包内可执行文件 `bin/dsh-delegate-mcp.js`(bin 名 `dsh-delegate-mcp
|
|
149
|
+
包内可执行文件 `bin/dsh-delegate-mcp.js`(bin 名 `dsh-delegate-mcp`)实现了八个工具:
|
|
150
150
|
`delegate_status` / `delegate_preflight` / `delegate_submit` / `delegate_wait` / `delegate_result` / `delegate_cancel` /
|
|
151
|
-
`delegate_permission_decide`。
|
|
151
|
+
`delegate_permission_decide` / `delegate_review`。
|
|
152
152
|
它**不提供**授权、配置写入或凭据读写工具。`delegate_permission_decide` 是唯一一条窄例外:
|
|
153
153
|
它只能回答一个**已经挂起**的「单次调用授权请求」,给 `allow-once`(仅这一次调用可继续)或
|
|
154
154
|
`reject`。它不能创建或扩大任何**长期有效**的授权,不能修改设置、凭据、本机开关、提供方/模型或隔离方式,
|
|
155
155
|
也不能预先批准后续调用。
|
|
156
156
|
|
|
157
|
+
`delegate_review` 只记录已交付任务的宿主审查结论。指挥端检查结果和验证证据后,传入
|
|
158
|
+
`decision: "accepted"` 或 `"changes-requested"` 与简短 `note`;任务页显示“审查通过”或“需要修正”。
|
|
159
|
+
它不会授予工具权限或自动合并文件。旧记录缺少结论时仍保留待审,不把执行完成自动标成通过。
|
|
160
|
+
|
|
157
161
|
在需要调用委派工具的 MCP 宿主中添加 stdio server(以下为通用配置示意;Codex 用见 6.1,
|
|
158
162
|
插件会替你写这条并给出正确路径):
|
|
159
163
|
|
|
@@ -173,8 +177,8 @@ dsh --profile web
|
|
|
173
177
|
每次工具调用前都会重新读取,因此 DSH 重启并更换端口后无需改 Codex 配置。
|
|
174
178
|
- 默认发现路径使用 `DSH_HOME`,未设置时为 `~/.dsh`。若 DSH 和 MCP 宿主使用不同的 DSH_HOME,
|
|
175
179
|
可通过 `DSH_DELEGATE_DISCOVERY_FILE` 指向该发现文件。`DSH_DELEGATE_BASE_URL` 仅作为手动固定地址覆盖。
|
|
176
|
-
- 工具为 `delegate_status`、`delegate_preflight`、`delegate_submit`、`delegate_result`、
|
|
177
|
-
`delegate_cancel` 和 `
|
|
180
|
+
- 工具为 `delegate_status`、`delegate_preflight`、`delegate_submit`、`delegate_wait`、`delegate_result`、
|
|
181
|
+
`delegate_cancel`、`delegate_permission_decide` 和 `delegate_review`。
|
|
178
182
|
- 开关关闭时,`delegate_submit` 与 `delegate_permission_decide` 返回 `DELEGATION_DISABLED`;状态、
|
|
179
183
|
预检、结果和取消工具仍可使用。`delegate_preflight` 只读取工作区事实,不创建任何东西,因此不受
|
|
180
184
|
开关和并发上限限制。
|
|
@@ -511,7 +515,7 @@ Codex 子智能体现在按「提交 → `delegate_wait` 同一任务」运作
|
|
|
511
515
|
# 不要在 Desktop 的正式 profile 下执行下面的 CLI 命令。
|
|
512
516
|
|
|
513
517
|
# CLI web profile 的升级:换成本地新包或(将来)新版本
|
|
514
|
-
dsh plugin --profile web add ./dsh-taskbridge-1.
|
|
518
|
+
dsh plugin --profile web add ./dsh-taskbridge-1.4.0.tgz
|
|
515
519
|
|
|
516
520
|
# 导出:界面里"导出非敏感配置"按钮,或用只读 API
|
|
517
521
|
# GET /api/dsh-delegate/settings
|
|
@@ -571,8 +575,8 @@ dsh plugin --profile web remove dsh-taskbridge
|
|
|
571
575
|
第二个模型审查、也不依赖人工点击。
|
|
572
576
|
- **工作树隔离需要 git**:默认 `worktree` 隔离要求源目录是已提交的 git 仓库;
|
|
573
577
|
否则显式拒绝。`shared` 模式不是隔离,界面会如实标注。
|
|
574
|
-
-
|
|
575
|
-
|
|
578
|
+
- **交付与验收分开**:附加模型审查只产出发现;执行交付时等待宿主审查,由指挥端明确写回结论,
|
|
579
|
+
任务页才显示“审查通过”或“需要修正”。
|
|
576
580
|
- **Codex 集成的限制**:
|
|
577
581
|
- 一键安装按钮只支持 Codex;Claude Code 可按接入说明手动配置标准 MCP,尚无一键安装按钮或真实客户端验收。
|
|
578
582
|
- **不宣称**当前 Codex 桌面版/CLI 支持用 `@dsh-taskbridge` 在输入框直接选中该子智能体:
|
package/bin/dsh-delegate-mcp.js
CHANGED
|
@@ -70,6 +70,10 @@ const ROUTES = Object.freeze({
|
|
|
70
70
|
// plane registers exactly this path, and a name-to-path guess would 404 with
|
|
71
71
|
// `EXECUTION_ROUTE_UNKNOWN` on the one call that unblocks a paused worker.
|
|
72
72
|
permission: Object.freeze({ method: 'POST', path: '/tasks/permission' }),
|
|
73
|
+
// The commander's delivery review. Spelled out like every other route: the plane
|
|
74
|
+
// registers exactly `/tasks/review`, so a missing entry here refused the one call that
|
|
75
|
+
// records `hostAcceptance` with `MCP_ROUTE_UNMAPPED` before any request was sent.
|
|
76
|
+
review: Object.freeze({ method: 'POST', path: '/tasks/review' }),
|
|
73
77
|
// Read-only workspace facts. Registered on the execution plane beside `/status`
|
|
74
78
|
// so it answers with the switch off; it creates nothing to clean up.
|
|
75
79
|
preflight: Object.freeze({ method: 'POST', path: '/workspace/preflight' }),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# dsh-taskbridge Codex companion — managed by the DSH TaskBridge plugin settings page.
|
|
2
2
|
# Editing this file turns it into an operator-owned file: the plugin then never
|
|
3
3
|
# overwrites or removes it, and reports it as "modified" instead.
|
|
4
|
-
version = "1.
|
|
4
|
+
version = "1.4.0"
|
|
5
5
|
|
|
6
6
|
name = "dsh-taskbridge"
|
|
7
7
|
description = "Dispatch an explicitly assigned implementation task to DSH through the dsh-taskbridge MCP tools, then return evidence for Codex review."
|
|
@@ -68,8 +68,8 @@ DISPATCH (only for an explicitly assigned implementation task)
|
|
|
68
68
|
- `isolation: "shared"` (reason `PREFLIGHT_DIRTY_SHARED_EXPLICIT`) — a dirty
|
|
69
69
|
workspace was already allowed explicitly. Dispatch only if that allowance is
|
|
70
70
|
part of this request; it must be preserved.
|
|
71
|
-
3. Set `title` to a short description of the actual work, in the operator's language
|
|
72
|
-
(for example, "修复登录错误" or "制作潘德 G 版装备表"). Do not use role instructions,
|
|
71
|
+
3. Set `title` to a short description of the actual work, in the operator's language
|
|
72
|
+
(for example, "修复登录错误" or "制作潘德 G 版装备表"). Do not use role instructions,
|
|
73
73
|
task ids or generic labels as the title. Then submit one complete, bounded task
|
|
74
74
|
containing the exact authorized workspace path supplied by the parent session, the concrete work to perform, and
|
|
75
75
|
the acceptance checks. Never guess a different workspace. Include the workspace
|
|
@@ -106,28 +106,44 @@ DISPATCH (only for an explicitly assigned implementation task)
|
|
|
106
106
|
recorded isolation even if the current settings changed. If the original tree
|
|
107
107
|
is unavailable or cannot be proven, report the refusal and ask; do not retry as
|
|
108
108
|
a new task to get past it.
|
|
109
|
-
5. SUBMIT, THEN WAIT. Keep the returned taskId and call `delegate_wait` with
|
|
110
|
-
same taskId. Repeat `delegate_wait` on the SAME
|
|
111
|
-
reasons below. Do NOT poll `delegate_result`
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
109
|
+
5. SUBMIT, THEN WAIT. Keep the returned taskId and call `delegate_wait({ taskId })` with
|
|
110
|
+
that same taskId and NO `waitSeconds` argument. Repeat `delegate_wait` on the SAME
|
|
111
|
+
taskId until it returns one of the reasons below. Do NOT poll `delegate_result` or
|
|
112
|
+
`delegate_status` in a loop while a task runs: one `delegate_wait` already blocks
|
|
113
|
+
internally and re-issues its own bounded observation requests, so it IS the waiting
|
|
114
|
+
loop. That internal cadence (about one observation every 25 seconds) belongs to the
|
|
115
|
+
tool, not to you: it is not a rhythm you should imitate, narrate or act on.
|
|
116
|
+
Never submit a duplicate because a task is still running; use `delegate_cancel` to
|
|
117
|
+
stop it. Keep that taskId for later follow-ups.
|
|
118
|
+
`delegate_wait` already waits up to 3600 seconds (one hour) by default and cannot
|
|
119
|
+
wait longer than that. So: do not shorten it, and do not try to "stay longer" by
|
|
120
|
+
raising it — when a wait ends you simply call it again on the same taskId.
|
|
121
|
+
A shorter explicit `waitSeconds` is legal but is only for a one-off diagnostic the
|
|
122
|
+
operator explicitly asked for; it is never the normal loop.
|
|
117
123
|
5a. WHAT THE WAIT REASONS MEAN, and what you do next.
|
|
118
124
|
- `heartbeat`: nothing to report. The wait expired with no news. You will normally
|
|
119
125
|
never see this, because the tool re-issues internally. If you do see it, call
|
|
120
126
|
`delegate_wait` on the SAME task again. Never treat it as progress, as a stall or
|
|
121
127
|
as an excuse to submit anything.
|
|
122
|
-
- `attention`: the task has been
|
|
123
|
-
|
|
124
|
-
is
|
|
125
|
-
returns (phase, last activity, current tool
|
|
126
|
-
verdict, elapsed) and decide whether to keep
|
|
127
|
-
call `delegate_wait` on the SAME task. Never cancel,
|
|
128
|
-
and never submit a replacement merely because a task is
|
|
129
|
-
or test has been running a long time. Only a concrete,
|
|
130
|
-
anything else, and then you report it instead of silently
|
|
128
|
+
- `attention`: the task has been COMPLETELY SILENT for longer than the configured
|
|
129
|
+
inactivity threshold (ten minutes by default). It does NOT mean an ordinary wait
|
|
130
|
+
ended — a wait ending is `wait-limit`, not `attention`. This is a QUESTION, not a
|
|
131
|
+
verdict. Read the compact diagnostic it returns (phase, last activity, current tool
|
|
132
|
+
and how long it has run, the self-check verdict, elapsed) and decide whether to keep
|
|
133
|
+
waiting. DEFAULT: keep waiting — call `delegate_wait` on the SAME task. Never cancel,
|
|
134
|
+
never mark the task failed, and never submit a replacement merely because a task is
|
|
135
|
+
quiet or because one tool or test has been running a long time. Only a concrete,
|
|
136
|
+
stated error justifies anything else, and then you report it instead of silently
|
|
137
|
+
restarting work.
|
|
138
|
+
If the same answer instead carries a `failure` block (`kind:
|
|
139
|
+
"repeated-tool-failure"`, with `toolName`, `failureCode`, `consecutive`), the task is
|
|
140
|
+
NOT silent: the worker has repeated ONE operation and failed the same way several
|
|
141
|
+
times in a row. That is a different situation and needs a different decision. It is
|
|
142
|
+
reported ONCE per occurrence, and nothing was cancelled, retimed or reconfigured
|
|
143
|
+
automatically. Decide deliberately: keep waiting (the worker may still recover),
|
|
144
|
+
cancel, or write a follow-up that gives the worker the missing information. Do not
|
|
145
|
+
repeat the identical instruction and hope for another outcome, and do not take the
|
|
146
|
+
reminder itself as proof the task can never succeed.
|
|
131
147
|
- `permission`: the worker is PAUSED on one native tool call awaiting YOUR
|
|
132
148
|
decision. This is not a stall and not a failure. Do not submit a duplicate and do
|
|
133
149
|
not cancel it merely because it waits.
|
|
@@ -159,6 +175,16 @@ DISPATCH (only for an explicitly assigned implementation task)
|
|
|
159
175
|
findings, changed files) and then do the review yourself, in Codex. If the diff
|
|
160
176
|
is large, inspect only the files that matter for this change, once each. Do not
|
|
161
177
|
re-read the same evidence repeatedly, and never reply "done" without reviewing.
|
|
178
|
+
After the review, call `delegate_review` on THAT task with `decision: "accepted"`
|
|
179
|
+
or `decision: "changes-requested"` and a short, factual `note` describing the
|
|
180
|
+
checks or required corrections. Record accepted only when the delivered evidence
|
|
181
|
+
supports it. This records your conclusion; it grants no tool permission and does
|
|
182
|
+
not merge files. Wait for the write to succeed before reporting the decision as
|
|
183
|
+
recorded. A failed write is a recording problem, not proof that execution failed.
|
|
184
|
+
For changes-requested, consolidate corrections and submit a follow-up using
|
|
185
|
+
`continueFromTaskId`; do not overwrite the old task's decision. Never mark old
|
|
186
|
+
records accepted in bulk, and never claim a decision was saved when an older
|
|
187
|
+
server lacks this tool.
|
|
162
188
|
- `failed`, `cancelled`: the run ended without deliverables. Call
|
|
163
189
|
`delegate_result` ONCE for the same task to read the recorded reason, then report
|
|
164
190
|
it. Do not resubmit identical work hoping for a different result; if a correction
|
|
@@ -177,10 +203,19 @@ DISPATCH (only for an explicitly assigned implementation task)
|
|
|
177
203
|
stopped. Keep the taskId, and FIRST check one fact with `delegate_result` (state,
|
|
178
204
|
recorded outcome, whether it is still live) before deciding anything. Do not
|
|
179
205
|
re-wait indefinitely on a task you cannot classify.
|
|
180
|
-
- `wait-limit
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
206
|
+
- `wait-limit`: your own wait budget ran out and NOTHING about the task changed. The
|
|
207
|
+
answer carries `actionable: false` and `terminal: false`: no result, no decision and
|
|
208
|
+
no business action is required. Call `delegate_wait` on the SAME task immediately,
|
|
209
|
+
again with no `waitSeconds`. It is not a failure, not a stall, and not a reason to
|
|
210
|
+
submit a new task or to check the implementation yourself.
|
|
211
|
+
- A CLIENT-SIDE tool timeout (your host's own limit ending the call — whatever that
|
|
212
|
+
limit happens to be, not necessarily a minute) is NOT `wait-limit` and says NOTHING
|
|
213
|
+
about the task: it does not prove the
|
|
214
|
+
execution stopped, and it does not prove it is still alive. Keep the taskId and
|
|
215
|
+
call `delegate_wait` on the SAME task again. If you genuinely need to know more,
|
|
216
|
+
read one compact fact with `delegate_result`; do not assume an outcome, and never
|
|
217
|
+
submit a duplicate, restart or cancel a task because a client timeout fired. Waiting
|
|
218
|
+
for a task and having your own observation interrupted are different events.
|
|
184
219
|
5b. WHEN THE HOST CANNOT SEND A SECOND CALL. Some hosts forward one tool call at a time,
|
|
185
220
|
so while a long `delegate_wait` is outstanding this session cannot send anything
|
|
186
221
|
else — not a status read, not a cancel. If the operator asks to STOP or INSPECT the
|
|
@@ -208,6 +243,43 @@ DISPATCH (only for an explicitly assigned implementation task)
|
|
|
208
243
|
for both preflight and submit. Then call `delegate_wait` on the NEW task id and
|
|
209
244
|
follow the reasons again. Never submit a correction as an unrelated new task to
|
|
210
245
|
escape a long wait, and never reuse an id to "keep context".
|
|
246
|
+
5d. OUTER WAIT: WHEN YOUR HOST TAKES THE CALL BACK. Your host, not this plugin,
|
|
247
|
+
decides how long one tool call may occupy your turn. A `delegate_wait` can be
|
|
248
|
+
handed back EARLY even though it asks for an hour, because the host's own tool or
|
|
249
|
+
exec time limit fired. That is an OUTER event:
|
|
250
|
+
- It does NOT mean the MCP wait ended, and it is NOT `wait-limit`. Neither of those
|
|
251
|
+
is something you can observe from the outside; only the answer's own `reason`
|
|
252
|
+
field reports those.
|
|
253
|
+
- It says NOTHING about the task: the execution may still be running exactly as
|
|
254
|
+
before. Never conclude it stopped, and never conclude it finished.
|
|
255
|
+
- Do NOT open a SECOND wait, do NOT read `delegate_result`, do NOT poll
|
|
256
|
+
`delegate_status`, and do NOT submit a duplicate or a replacement. If an exec cell
|
|
257
|
+
for this task is still open, CONTINUE THAT SAME CELL rather than starting a new
|
|
258
|
+
one; the taskId you already hold is the whole state you need.
|
|
259
|
+
- Ask the host for the longest yield it actually supports instead of handing control
|
|
260
|
+
back on a habit. When your client offers a yield/pragmas parameter, a normal wait
|
|
261
|
+
should ask for something on the order of 1200000 ms (20 minutes), not a minute. A
|
|
262
|
+
short yield is not a "safe" default: re-issuing every second, or every minute, is
|
|
263
|
+
not waiting — it is polling with extra steps, it re-enters your turn for nothing,
|
|
264
|
+
and it prevents the quiet period this mechanism exists for.
|
|
265
|
+
- A one-minute return is a CALLER CHOICE, not a documented hard limit. Do not describe
|
|
266
|
+
one minute as the client's inherent maximum, and do not claim every client supports
|
|
267
|
+
the same long yield: state what this client actually offers and use the longest value
|
|
268
|
+
it accepts.
|
|
269
|
+
- Handing control back to the human is a UI decision, NOT a statement that the
|
|
270
|
+
delegated observation stopped. The plugin keeps its own observation loop; the
|
|
271
|
+
worker keeps running.
|
|
272
|
+
- BOUNDARY, stated honestly: this plugin does not own your scheduler and cannot
|
|
273
|
+
create a background waiter, a timer or a callback that would wake you. If the
|
|
274
|
+
available yield is genuinely short and there is no automatic continuation, a long
|
|
275
|
+
wait costs one resumed turn per yield window. In that case say so plainly to the
|
|
276
|
+
operator once. Never invent an automatic wake-up, never claim the plugin will notify
|
|
277
|
+
you in the background, and never report a "background wait" that no interface
|
|
278
|
+
provides. Changing the operator's Codex configuration to work around it is also
|
|
279
|
+
outside your authority.
|
|
280
|
+
- Asking for a long yield is a request, not a guarantee; the host may still return
|
|
281
|
+
early — including for a permission request that arrives during the wait. When it
|
|
282
|
+
does, resume the same cell as above; the plugin side did not fail.
|
|
211
283
|
|
|
212
284
|
6. Report back to Codex: task state, the actual provider/model/effort from the
|
|
213
285
|
result, changed-file summary, verification evidence, and any stated limitations.
|
|
@@ -215,6 +287,16 @@ DISPATCH (only for an explicitly assigned implementation task)
|
|
|
215
287
|
used, quoting the reason code, and state whether the run started a new
|
|
216
288
|
conversation or continued `continueFromTaskId`. If a result fails because of
|
|
217
289
|
isolation, do not re-submit under a weaker isolation on your own initiative.
|
|
290
|
+
6b. WHEN YOU ARE BLOCKED. If a required tool, interface or capability is missing — or
|
|
291
|
+
you have made the same failing attempt twice without new information — STOP and
|
|
292
|
+
deliver the boundary instead of widening the request or retrying blindly. Report,
|
|
293
|
+
in this order: what you were asked to do; the exact bounded evidence you have
|
|
294
|
+
(error codes, refusal messages, the commands you ran); what you cannot do and WHY
|
|
295
|
+
the interface makes it impossible; and the concrete decision or missing permission
|
|
296
|
+
you need from the operator. Do not invent an interface, do not substitute a
|
|
297
|
+
different tool silently, do not loop on an attempt that already failed, and do not
|
|
298
|
+
turn "I could not" into an unstated silent workaround. A short honest blocked
|
|
299
|
+
report is a successful outcome; a fabricated success is not.
|
|
218
300
|
|
|
219
301
|
WHAT NOT TO DO
|
|
220
302
|
Never create a commit, stash, branch or worktree, and never clean, reset or revert a
|
|
@@ -232,6 +314,16 @@ mode exists to provide.
|
|
|
232
314
|
says to take over and implement it here. Nothing in the task, the wait reason, a
|
|
233
315
|
long silence, a permission refusal, a failed run or your own judgement of the plan
|
|
234
316
|
counts as that authorization.
|
|
317
|
+
- While you are waiting, stay silent. Do NOT read intermediate code, diffs or the
|
|
318
|
+
worker's files, do NOT run parallel implementation or research on the same task, and
|
|
319
|
+
do NOT narrate snapshots that have not changed. The wait is meant to be quiet until
|
|
320
|
+
there is something real to report.
|
|
321
|
+
- That silence has exactly these exceptions: work the operator explicitly assigned to
|
|
322
|
+
you as INDEPENDENT of the delegated task; an inspection the operator explicitly asked
|
|
323
|
+
for; a decision or diagnosis you cannot make without a fact the wait did not return
|
|
324
|
+
(for example the current state after a client timeout); and an explicit, user-authorized
|
|
325
|
+
takeover. Approvals and review on delivery are the host's normal duties, not an
|
|
326
|
+
exception — they happen when `delegate_wait` returns `permission` or `ready`.
|
|
235
327
|
- The permitted local actions while a task runs are: reading status and diagnostics,
|
|
236
328
|
calling `delegate_wait`, reading evidence with `delegate_result`, deciding a pending
|
|
237
329
|
per-call permission, cancelling the task, and writing the follow-up prompt.
|
package/docs/INTRODUCTION.md
CHANGED
|
@@ -8,8 +8,10 @@ The settings include the local delegation switch, worker model/effort, task time
|
|
|
8
8
|
|
|
9
9
|
The quiet wait observes execution inside the program and returns at actionable boundaries. Pending wider-permission calls are presented to the commander for a single-call decision. Completion is evidence for host review, never automatic host acceptance.
|
|
10
10
|
|
|
11
|
+
Version 1.4.0 clarifies long outer waits and continuation of the same running call, adds a configurable repeated-tool-failure reminder (3 by default; 0 disables it), and lets the host explicitly record an accepted or changes-requested decision with `delegate_review`. Task records display that decision instead of remaining indefinitely awaiting review.
|
|
12
|
+
|
|
11
13
|
Codex has a managed agent/MCP installation button. Version 1.3.2 names the companion `dsh-taskbridge` and migrates unchanged published legacy companions. New DSH Workspaces use the task's work-content title; explicit follow-ups keep the original Workspace and conversation. Claude Code connects using standard stdio MCP; see [the manual guide](claude-code.md). A Claude one-click installer and native client mention selection are not promised.
|
|
12
14
|
|
|
13
15
|
Version 1.3.1 adopts DSH TaskBridge and the package identity `dsh-taskbridge`, replacing `dsh-delegate` and the GitHub-only `dsh-taskdispatch` 1.3.0. Read the [upgrade guide](taskbridge-upgrade.md) before replacing an old installation. Historical data, MCP tools, environment variables and the Codex `dsh-delegate` technical identifier remain compatible. Do not run old and new bundles together.
|
|
14
16
|
|
|
15
|
-
In DSH's Add plugin dialog, use `dsh-taskbridge@1.
|
|
17
|
+
In DSH's Add plugin dialog, use `dsh-taskbridge@1.4.0`; use the official npm registry if a regional mirror has not synchronized yet. Distribution also uses GitHub releases and a [DSH custom plugin index](plugin-market.md) pinned to exact Git commits. This is not universal official marketplace inclusion. A single same-model, approximately 45-second waiting comparison reduced recorded waiting-response tokens by 66.58% (3 model responses to 1); this is not a full-task or billing reduction. See the [measurement report](releases/1.4.0-token-benchmark.zh.md). Client time limits and full Desktop upgrade behavior require environment-specific verification.
|
package/docs/INTRODUCTION.zh.md
CHANGED
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
|
|
19
19
|
需要更大权限的工具调用会暂停,指挥端根据准确操作和指纹决定单次允许或拒绝,不是默认全部放行。交付后集中审查,修正通过 `continueFromTaskId` 续接原对话与执行工作区。
|
|
20
20
|
|
|
21
|
+
1.4.0 明确长等待及同一等待单元续接规则,新增默认 3 次的重复工具失败提醒(可调整,0 关闭)。指挥端审查交付后通过 `delegate_review` 写回结论,任务页区分“审查通过”“需要修正”和尚未审查,避免记录始终停在待审。
|
|
22
|
+
|
|
21
23
|
1.3.2 起,新建的 DSH 工作区按实际工作内容命名,例如“制作潘德 G 版装备表”,不再只显示工作树的任务编号。指挥端随派工提交标题,旧客户端则从任务目标提取;续接同一任务时保留原名称与对话。
|
|
22
24
|
|
|
23
25
|
## 连接 Claude Code 与 Codex
|
|
@@ -27,8 +29,8 @@
|
|
|
27
29
|
|
|
28
30
|
## 安装、升级和边界
|
|
29
31
|
|
|
30
|
-
项目原名 DSH Delegate,1.3.0 曾使用 DSH TaskDispatch。1.3.1 起统一为 **DSH TaskBridge**,包名为 `dsh-taskbridge`。从旧包升级请先阅读 [更名升级说明](taskbridge-upgrade.md)。在 DSH“添加插件”中输入 `dsh-taskbridge@1.
|
|
32
|
+
项目原名 DSH Delegate,1.3.0 曾使用 DSH TaskDispatch。1.3.1 起统一为 **DSH TaskBridge**,包名为 `dsh-taskbridge`。从旧包升级请先阅读 [更名升级说明](taskbridge-upgrade.md)。在 DSH“添加插件”中输入 `dsh-taskbridge@1.4.0`;中国大陆镜像若尚未同步,改选 npm 官方源。GitHub Release 同时提供安装包。
|
|
31
33
|
|
|
32
34
|
[插件索引与更新说明](plugin-market.md)介绍如何添加索引,在 DSH 的“发现”中搜索本插件。发布自定义索引不代表已进入官方内置市场;DSH 当前需要用户自行添加可信索引。
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
同一 Codex 模型的约 45 秒等待对照样本中,长等待把模型响应从 3 次减少为 1 次,记录的等待阶段 token 总量减少 66.58%。这不是整个任务或账单的节省比例;方法与边界见[测量报告](releases/1.4.0-token-benchmark.zh.md)。插件不保证所有客户端完全零唤醒,Windows 与隔离迁移测试也不等同于所有平台和客户端均已验收。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Codex integration contract
|
|
2
2
|
|
|
3
|
-
Status: implemented in 1.
|
|
3
|
+
Status: implemented in 1.4.0 (1.1.0 introduced wait rules, 1.2.0 added installed-integration upgrades, 1.4.0 clarifies outer long waits and explicit host-review recording). This automatic installer covers Codex. Claude Code uses the separate manual MCP guide.
|
|
4
4
|
|
|
5
5
|
This document is the contract between the plugin's settings page (browser half),
|
|
6
6
|
the host-side installer (`src/codex/installer.js`) and the two files it manages.
|
|
@@ -17,6 +17,12 @@ operator-owned destination remain untouched; startup does not perform a first
|
|
|
17
17
|
installation when no previous managed companion exists. The MCP table remains
|
|
18
18
|
`mcp_servers.dsh-delegate`, and `delegate_*` tool names remain compatible.
|
|
19
19
|
|
|
20
|
+
1.4.0 recognizes the exact published 1.3.2 companion and refreshes its waiting rules
|
|
21
|
+
on plugin startup. After examining a delivered result, the companion records its own
|
|
22
|
+
accepted or changes-requested conclusion with `delegate_review`; the plugin never
|
|
23
|
+
derives acceptance from completion. A client may need reloading to see the refreshed
|
|
24
|
+
agent and tool catalog. Edited companion files remain operator-owned.
|
|
25
|
+
|
|
20
26
|
Explicit install/repair can also adopt a marked standard legacy MCP path after
|
|
21
27
|
the old `dsh-delegate` or `dsh-taskdispatch` package has been uninstalled from the
|
|
22
28
|
same `node_modules` as the current `dsh-taskbridge`. This narrow exception does
|
|
@@ -106,11 +112,17 @@ tool_timeout_sec = 3660
|
|
|
106
112
|
* `tool_timeout_sec = 3660` (1.1.0) is an **owned scalar on this entry only**. The
|
|
107
113
|
`delegate_wait` tool defaults to a 3600-second wait and caps it there, so a client that
|
|
108
114
|
honours this field is allowed to let one call run that long. The plugin cannot prove that
|
|
109
|
-
every client honours it: a client that applies its own
|
|
110
|
-
|
|
111
|
-
*requests* 3660 s — the 3600-second wait plus one minute of slack, never a
|
|
112
|
-
window — while a client-side cap that ignores the field remains a client
|
|
113
|
-
cannot lift. This is not a Codex-wide setting and the plugin writes it
|
|
115
|
+
every client honours it: a client that applies its own tool timeout may still end the
|
|
116
|
+
wait earlier. That is an OUTER limit and is not a `wait-limit` answer. The managed entry
|
|
117
|
+
therefore *requests* 3660 s — the 3600-second wait plus one minute of slack, never a
|
|
118
|
+
second wait window — while a client-side cap that ignores the field remains a client
|
|
119
|
+
limit the plugin cannot lift. This is not a Codex-wide setting and the plugin writes it
|
|
120
|
+
nowhere else.
|
|
121
|
+
* When a client exposes a yield/pragmas parameter, an ordinary wait should request
|
|
122
|
+
roughly `1200000` ms (20 minutes), not one minute. A one-minute return is a caller
|
|
123
|
+
choice, not a documented hard maximum, and not every client supports the same long
|
|
124
|
+
yield — the agent is told to state what its client actually offers rather than
|
|
125
|
+
describe one minute as inherent.
|
|
114
126
|
* A managed entry written by an earlier release has no such field. It is classified
|
|
115
127
|
`outdated` and repaired **in place** (the line is inserted inside our table), so an
|
|
116
128
|
existing installation updates through the settings page instead of being reported as
|
|
@@ -503,7 +515,7 @@ successful diagnosis.
|
|
|
503
515
|
```jsonc
|
|
504
516
|
{
|
|
505
517
|
"codexHome": "…",
|
|
506
|
-
"packageVersion": "1.
|
|
518
|
+
"packageVersion": "1.4.0",
|
|
507
519
|
"boundary": { "blocked": false, "link": null, "unknown": false, "home": "directory", "agents": "directory" },
|
|
508
520
|
"agent": {
|
|
509
521
|
"path": "…", "state": "installed", "installed": true, "managed": true,
|
|
@@ -746,20 +758,32 @@ one fails the build:
|
|
|
746
758
|
on preflight records the decision but does not change the submitted job's
|
|
747
759
|
isolation by itself.
|
|
748
760
|
9. **One task, WAITED — not polled (1.1.0).** Keep the returned `taskId` and call
|
|
749
|
-
`delegate_wait`
|
|
750
|
-
reason. `delegate_result` is **not** a polling loop: one
|
|
751
|
-
|
|
752
|
-
loop. Never submit a duplicate because a task is still running;
|
|
753
|
-
stops it. The wait defaults to 3600 seconds and the tool caps it
|
|
761
|
+
`delegate_wait({ taskId })` — with no `waitSeconds` argument — repeating it until it
|
|
762
|
+
returns a reason that needs the host. `delegate_result` is **not** a polling loop: one
|
|
763
|
+
`delegate_wait` blocks internally and re-issues its own bounded observation requests,
|
|
764
|
+
which is the waiting loop. Never submit a duplicate because a task is still running;
|
|
765
|
+
`delegate_cancel` stops it. The wait defaults to 3600 seconds and the tool caps it
|
|
766
|
+
there, so there is nothing to raise: when a wait ends, call it again on the same task.
|
|
767
|
+
A shorter explicit `waitSeconds` stays legal but is only for a one-off diagnostic the
|
|
768
|
+
operator explicitly asked for.
|
|
769
|
+
While the wait runs, stay silent: do not read intermediate code or diffs, do not run
|
|
770
|
+
parallel implementation or research, and do not narrate unchanged snapshots. The only
|
|
771
|
+
exceptions are work explicitly assigned as independent of the task, an inspection the
|
|
772
|
+
operator explicitly asked for, a decision or diagnosis that genuinely needs a fact the
|
|
773
|
+
wait did not return, and an explicit user-authorized takeover. Review happens once, on
|
|
774
|
+
delivery.
|
|
754
775
|
`heartbeat` means "nothing to report" and is internal: the tool re-waits rather than
|
|
755
776
|
handing it to the model, so normal progress never wakes Codex.
|
|
777
|
+
The roughly 25-second internal observation cadence belongs to the program, not to the
|
|
778
|
+
agent: it is not a polling rate the model should imitate.
|
|
756
779
|
10. **Each wait reason has a stated policy (1.1.0).**
|
|
757
780
|
- `attention` — the run has been completely silent past the configured attention
|
|
758
|
-
interval. It
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
and
|
|
762
|
-
|
|
781
|
+
interval (ten minutes by default). It does **not** mean an ordinary wait ended: a
|
|
782
|
+
wait ending is `wait-limit`. It is a QUESTION, not a verdict: read the compact
|
|
783
|
+
diagnostic (phase, last activity, current tool and its elapsed time, self-check
|
|
784
|
+
verdict) and **default to waiting again** on the same task. Never cancel, never mark
|
|
785
|
+
failed, and never resubmit merely because a task is quiet or one tool or test is
|
|
786
|
+
slow. Only a concrete, stated error justifies anything else, and then it is reported
|
|
763
787
|
rather than silently restarted.
|
|
764
788
|
- `permission` — a per-call decision is outstanding; see item 12. After deciding,
|
|
765
789
|
wait the SAME task again.
|
|
@@ -768,9 +792,16 @@ one fails the build:
|
|
|
768
792
|
Codex. A large diff is inspected file by relevant file, once each, not re-read.
|
|
769
793
|
- `failed` / `cancelled` — read `delegate_result` once for the recorded reason and
|
|
770
794
|
report it; do not resubmit identical work hoping for a different outcome.
|
|
771
|
-
- `wait-limit`
|
|
772
|
-
|
|
773
|
-
|
|
795
|
+
- `wait-limit` — this call's own wait budget ran out with nothing changed. The answer
|
|
796
|
+
carries `actionable: false` and `terminal: false`: it is not a result, requires no
|
|
797
|
+
business decision, and ends nothing. Immediately `delegate_wait` the same task
|
|
798
|
+
again (no `waitSeconds`). It is not a failure, a stall, or a reason to submit
|
|
799
|
+
anything new or to check the implementation locally.
|
|
800
|
+
A **client-side tool timeout** is a different event and is *not* `wait-limit`: the
|
|
801
|
+
host's own limit ending the call does not prove the execution stopped, and does not
|
|
802
|
+
prove it is alive. Keep the `taskId` and wait again; if a compact fact is genuinely
|
|
803
|
+
needed, read it with `delegate_result`. Never duplicate, restart or cancel a task
|
|
804
|
+
because a wait or a client timeout ended.
|
|
774
805
|
- `interrupted` — **the wait was cut off; that is not by itself a finished
|
|
775
806
|
execution.** One call answers it at once (it does not loop), so the answer's own
|
|
776
807
|
fields decide the response (1.2.0):
|
package/docs/plugin-market.md
CHANGED
|
@@ -15,7 +15,7 @@ https://ranranyya.github.io/dsh-taskbridge/index.json
|
|
|
15
15
|
3. 搜索 **DSH TaskBridge** 或 **dsh-taskbridge**。
|
|
16
16
|
4. 安装确认框应显示本项目 GitHub 仓库和精确提交。核对后安装,不要改填别人的 `dsh-delegate` 或 `dsh-dispatch` npm 包。
|
|
17
17
|
|
|
18
|
-
当前索引采用固定 Git 提交作为安装来源,不依赖本机 npm 登录。另一种安装方式是直接在“添加插件”中输入 `dsh-taskbridge@1.
|
|
18
|
+
当前索引采用固定 Git 提交作为安装来源,不依赖本机 npm 登录。另一种安装方式是直接在“添加插件”中输入 `dsh-taskbridge@1.4.0`,无需添加索引;若中国大陆镜像未同步,改选 npm 官方源。GitHub Release 同时提供 `.tgz` 和 SHA256 文件。
|
|
19
19
|
|
|
20
20
|
## 新版本
|
|
21
21
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# 1.4.0 等待阶段 token 对照报告
|
|
2
|
+
|
|
3
|
+
测量日期:2026-11-13。目的:验证外层短续等改成长等待后,当前 Codex 等待流程是否减少模型响应及其伴随 token。报告与发布结论由指挥端 Codex 撰写。
|
|
4
|
+
|
|
5
|
+
## 方法
|
|
6
|
+
|
|
7
|
+
两组在同一聊天中顺序运行,模型均为 `gpt-6.1-sol`。两组运行同一个 `scripts/verify-silent-wait.mjs --duration-seconds 45 --activity-seconds 5`,使用生产 `TaskMonitor` 与 `waitForTask`、真实墙钟和当前外层工具通道。执行活动由程序每 5 秒模拟,不调用 DSH 提供方模型,不改变安装设置。
|
|
8
|
+
|
|
9
|
+
- 短续等组:外层选择短 yield,返回仍运行的单元后,由 GPT 两次续接同一单元。
|
|
10
|
+
- 长等待组:外层允许等待 120 秒,程序保持同一次调用直到约 45 秒的任务交付。
|
|
11
|
+
- 只统计发出实验等待或续等工具调用的 GPT 响应;前期规划、程序审查、报告撰写及最终交付审查不混入本表。
|
|
12
|
+
- 从本机 `token_usage_record` 读取单次 `usage`,按 `response_id` 去重;不累加累计 `thread_token_usage`,缓存输入是输入的子集,推理 token 不重复加到总量。
|
|
13
|
+
|
|
14
|
+
## 实测结果
|
|
15
|
+
|
|
16
|
+
| 项目 | 短续等组 | 长等待组 | 减少比例 |
|
|
17
|
+
|---|---:|---:|---:|
|
|
18
|
+
| 等待程序实际时长 | 44,165 ms | 44,175 ms | 同时长对照 |
|
|
19
|
+
| GPT 响应数 | 3 | 1 | 66.67% |
|
|
20
|
+
| 外层中途交回 | 2 | 0 | 100% |
|
|
21
|
+
| 输入 token | 507,408 | 169,443 | 66.61% |
|
|
22
|
+
| 其中缓存输入 | 506,651 | 169,320 | 66.58% |
|
|
23
|
+
| 非缓存输入 | 757 | 123 | 83.75% |
|
|
24
|
+
| 输出 token | 477 | 291 | 38.99% |
|
|
25
|
+
| 输入+输出 | 507,885 | 169,734 | **66.58%** |
|
|
26
|
+
| 序列化工具返回字节 | 530 | 394 | 25.66% |
|
|
27
|
+
|
|
28
|
+
两组等待程序均以 `ready` 返回,检查通过,均只产生一个任务业务结局。短续等组额外两次模型响应来自外层交回后的续接,不来自执行任务的需要判断事件。
|
|
29
|
+
|
|
30
|
+
## 如何理解
|
|
31
|
+
|
|
32
|
+
这次样本说明:当前客户端把正常执行包在一次长等待内,确实能省去中间续等的模型回合。本次减少主要来自不重复携带整段上下文;输入大部分已命中缓存,因此 **66.58% 不是费用或额度扣减比例**。
|
|
33
|
+
|
|
34
|
+
本实验只有每组一次,顺序固定,后组上下文会略增长,没有置信区间,也没有控制冷缓存差异。它验证等待机制,不能推出所有任务或完整开发成本固定减少同样百分比,更不能把 45 秒结果直接外推成 20 分钟实测费用。
|
|
35
|
+
|
|
36
|
+
过去骑砍任务的内容、上下文和执行结果不一致;它们用于定位短等待和重复读取问题,不作为本版因果节省率。本次将短时 token 对照与先前 20 分钟零中途唤醒的等待验收分开记录。
|
|
37
|
+
|
|
38
|
+
## 复核
|
|
39
|
+
|
|
40
|
+
本轮本地证据包含 `1.4.0-token-wait-benchmark.json`、`measure_wait_tokens.py` 及两份等待探针日志;保留逐响应用量和工具调用定位,不复制完整对话、执行者思考或凭据。正式 Release 提供脱敏的汇总 JSON 与探针日志;核算方式是 `(短组总量 - 长组总量) / 短组总量`。
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# DSH TaskBridge 1.4.0 更新说明
|
|
2
|
+
|
|
3
|
+
让 Claude Code 或 Codex 指挥 DSH 工作,在 DSH 插件中选择 API、执行模型和思考强度。1.4.0 重点改进静默等待、重复失败提醒和交付审查状态。
|
|
4
|
+
|
|
5
|
+
## 执行期间由程序观察,指挥端按需介入
|
|
6
|
+
|
|
7
|
+
- 正常派工后使用 `delegate_wait({ taskId })`,省略短 `waitSeconds`。程序在内部持续观察,不把每次心跳交给 GPT,也不反复搬运中间对话和代码差异。
|
|
8
|
+
- Codex 集成规则明确要求使用客户端支持的长等待;外层提前交回仍在运行的执行单元时,续接同一个单元,不重新派工、不另开等待、不把等待中断当作任务失败。
|
|
9
|
+
- 原有无活动监控保持默认 5/10 分钟:连续无新活动 5 分钟由程序自检,10 分钟才交给指挥端判断;真实输出、思考流和工具事件重新计时,连接心跳及页面刷新不重置计时。
|
|
10
|
+
- 权限申请、交付、失败、取消和中断及时返回。正常执行期间集中等待,交付后集中审查;修改意见通过 `continueFromTaskId` 续接原任务对话和执行工作区。
|
|
11
|
+
- 修正执行阶段显示:实际执行尚未开始时不提前显示执行中;失败后不保留执行阶段,晚到事件不覆盖审批或终态。
|
|
12
|
+
|
|
13
|
+
## 新增重复失败提醒
|
|
14
|
+
|
|
15
|
+
高级设置增加“重复失败提醒(次)”,默认 3 次,可设 0 关闭,允许 0–20 的整数。同一工具、同一操作连续出现相同的结构化失败时提醒指挥端一次;成功或失败身份变化后重新计数。
|
|
16
|
+
|
|
17
|
+
提醒沿用紧凑的 `attention` 返回,不自动取消、换模型、重派或延长时限。权限请求和执行结局优先。普通输出出现 error 字样、长时间思考、运行长测试或没有文件改动,不会被当作重复工具失败。任务详情和历史保留有界提醒,不记录原始参数、错误正文或思考内容。
|
|
18
|
+
|
|
19
|
+
## 宿主审查结论写回任务记录
|
|
20
|
+
|
|
21
|
+
新增 `delegate_review`,由指挥端读取结果、检查改动和验证证据后,明确记录“审查通过”或“需要修正”,任务页同步显示。执行者交付本身仍然不等于通过审查。
|
|
22
|
+
|
|
23
|
+
审查记录只针对一个已交付任务,不授予工具权限,不修改模型、开关或隔离方式,也不会合并工作树。需要修正时续接原任务;已有决定保留在原记录中。底层执行状态继续兼容旧客户端,旧历史记录不批量补写虚构的通过结论。
|
|
24
|
+
|
|
25
|
+
## Codex 集成和配置兼容
|
|
26
|
+
|
|
27
|
+
- 更新包内 `dsh-taskbridge` 智能体规则,支持识别未修改的已发布 1.3.2 模板,在插件加载时刷新已有托管集成。
|
|
28
|
+
- 新安装仍由设置页“安装/更新 TaskBridge 智能体”按钮创建智能体与 MCP;更新后必要时重新加载 Codex,让客户端读取新规则和工具目录。
|
|
29
|
+
- 用户自行修改过的智能体文件保留,并显示需要处理的状态;无需删除整个 Codex 配置目录。
|
|
30
|
+
- 旧设置缺少重复失败字段时采用默认值;表单空值、越界和小数给出明确校验。修复监控设置保存和旧历史字段的兼容问题。
|
|
31
|
+
|
|
32
|
+
## 安装与更新
|
|
33
|
+
|
|
34
|
+
在 DSH 插件管理中更新 `dsh-taskbridge`,或添加 `dsh-taskbridge@1.4.0`,也可使用本 Release 的 `dsh-taskbridge-1.4.0.tgz`。区域镜像尚未同步时改选 npm 官方源。
|
|
35
|
+
|
|
36
|
+
同包更新后确认插件加载成功,在 Codex 集成页查看智能体及 MCP 状态;旧客户端可能需要重新加载。首次安装点击集成安装按钮;有冲突时使用插件提示的安装/修复操作。从旧包名迁移仍按现有迁移指南处理,不同时启用新旧插件。
|
|
37
|
+
|
|
38
|
+
## 等待阶段 token 实测
|
|
39
|
+
|
|
40
|
+
在同一聊天、同一 `gpt-6.1-sol` 模型中,对同一个生产等待程序各运行约 45 秒:短外层等待产生 3 次 GPT 响应,长等待产生 1 次。按实际逐响应用量记录,输入加输出从 507,885 降至 169,734 token,**这次等待样本减少 66.58%**;其中非缓存输入从 757 降至 123。
|
|
41
|
+
|
|
42
|
+
这是单轮、短时、先短后长的等待通道对照,执行活动由程序模拟。它不是整个开发任务、真实模型执行或账单的节省比例,不能宣传成所有任务固定节省 66.58%。完整口径见[测量报告](1.4.0-token-benchmark.zh.md)。此前真实墙钟 20 分 2 秒的正常活动模拟等待,已验证中途零 GPT 续等;真实 DSH 任务也独立验证了多分钟等待及权限申请返回。
|
|
43
|
+
|
|
44
|
+
## 发布前验证
|
|
45
|
+
|
|
46
|
+
- 最终全量回归:**1,222 项通过,0 失败、0 跳过**;客户端构建及构建一致性检查通过。
|
|
47
|
+
- 宿主审查专项覆盖 20 项,包括通过/要求修正、落盘和重载、重复请求、并发写入、持久化失败回滚、关闭派工开关后的结论记录,以及界面标签一致性。
|
|
48
|
+
- 包内实测补齐了审查路由的中间转发映射,并新增真实转发客户端的路由与载荷回归,避免只测工具和服务端而遗漏中间连接。
|
|
49
|
+
- 安装包另做隔离安装、真实 stdio 握手和 8 个工具目录检查;临时 Codex 目录验证 1.3.2 托管规则升级、等待超时配置与自定义智能体保留。审查闭环使用安装包实现、真实本机 HTTP 与历史文件,原生执行服务和 Git 证据使用测试夹具,不调用提供方模型。
|
|
50
|
+
- 正式 Desktop 配置不由本次测试修改。用户在插件管理中更新并重新加载 Codex 后,才会在实际使用环境启用新的工具和规则。
|
|
51
|
+
|
|
52
|
+
## 边界
|
|
53
|
+
|
|
54
|
+
插件不控制所有客户端的工具时限,单次 MCP 等待最多 60 分钟;客户端提前返回或达到等待上限时,仍需续接同一任务。重复失败检测不代替交付质量审查。本版没有新增 CLI 执行通道、Claude Code 一键安装或普遍适用的原生 `@` 能力。
|