dsh-taskbridge 1.4.2 → 1.5.1

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +34 -2
  2. package/README.md +10 -8
  3. package/bin/dsh-delegate-mcp.d.ts +20 -3
  4. package/bin/dsh-delegate-mcp.js +15 -0
  5. package/codex/dsh-taskbridge.toml +180 -16
  6. package/docs/INTRODUCTION.md +2 -2
  7. package/docs/INTRODUCTION.zh.md +2 -2
  8. package/docs/codex-integration.md +11 -13
  9. package/docs/conversation-placement.md +44 -7
  10. package/docs/plugin-market.md +1 -1
  11. package/docs/redaction-contract.md +47 -4
  12. package/docs/releases/1.5.0-token-benchmark.zh.md +73 -0
  13. package/docs/releases/1.5.0.zh.md +51 -0
  14. package/docs/releases/1.5.1.zh.md +70 -0
  15. package/docs/runtime-compatibility.md +4 -4
  16. package/docs/silent-wait.md +157 -3
  17. package/docs/taskbridge-upgrade.md +1 -1
  18. package/docs/worker-permissions.md +154 -17
  19. package/lib/client.js +298 -103
  20. package/package.json +9 -3
  21. package/src/client/api.js +315 -34
  22. package/src/client/index.jsx +151 -67
  23. package/src/codex/installer.js +251 -11
  24. package/src/config/redact.js +72 -11
  25. package/src/http/execution-plane.js +124 -10
  26. package/src/index.d.ts +347 -0
  27. package/src/index.js +88 -5
  28. package/src/jobs/activity.js +102 -9
  29. package/src/jobs/continuation-identity.js +283 -0
  30. package/src/jobs/engine.js +491 -55
  31. package/src/jobs/history.js +96 -0
  32. package/src/mcp/continuation.js +317 -0
  33. package/src/mcp/metrics.js +366 -0
  34. package/src/mcp/server.js +1203 -53
  35. package/src/mcp/wait.js +338 -73
  36. package/src/review/prompts.js +145 -126
  37. package/src/runtime/agent-runner.js +330 -0
  38. package/src/runtime/permissions.js +192 -2
  39. package/src/runtime/question-call.js +162 -0
  40. package/src/runtime/questions.js +909 -0
  41. package/src/runtime/sandbox.js +363 -358
  42. package/src/runtime/session-placement.js +1207 -1121
  43. package/src/version.js +121 -0
  44. package/src/workspace/worktrees.js +70 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
- # Changelog
2
-
1
+ # Changelog
2
+
3
+ ## 1.5.1 — 自动保存、集成升级与可靠提醒(2026-11-15)
4
+
5
+ - 连续工具失败提醒增加稳定事件 ID;取出提醒不再提前消费,HTTP 或 MCP 回包丢失后可重新取得同一事件。
6
+ - `delegate_wait` 新增可选 `ackFailureEventId` 并返回 `failureAck`;确认幂等,错误 ID 不会清除待处理提醒。已收到的确认事实在后续网络错误、取消及审查落盘等待中保留,并发观察各自携带自己的回执。
7
+ - 更新托管 Codex 规则,按任务 ID 与事件 ID 去重、处理后确认;识别正式 1.5.0 的 LF/CRLF 原版模板以支持迁移,保留用户自定义规则。旧参数仍可调用;未确认事件会重放,旧宿主需同步更新处理规则。
8
+ - 修复长会话 `delegate_metrics` 因历史样本过多而整体报 `MCP_RESULT_OVER_BUDGET`:等待和决定样本各显示最近 8 条,累计数完整保留,明确列出全部未展示记录数,普通问答计入共享样本轴。
9
+ - 修复长审批与问答压缩时丢失 `failureAck` 的问题;问答救援路径补充生产桥接受的超大问题集回归。最终 `MCP_RESULT_OVER_BUDGET` 拒绝兜底尚未独立复现,不宣称覆盖。
10
+ - 设置页自动保存:文本输入防抖、离散选择及时保存、串行写入避免旧响应覆盖新输入;无效草稿可继续修正,移除底部两个保存按钮。
11
+ - 修复任务详情与完整审查意见展示,重复打开或切换任务时定位到详情;后台刷新不抢焦点,不用摘要替换已加载全文。
12
+ - 新增逐任务 `agentTeams` 选择,由指挥官按复杂度决定 DSH 团队模式;不改变用户选定的 API、模型和思考强度。续接继承原决定,显式值可覆盖,实际应用读回验证。原生子成员提权不由本插件桥接,需额外权限的操作仍由 root 执行并逐次审批。
13
+ - 修复 DSH 重启后隔离工作区无法续接:从已验证任务身份、真实目录和 Git 登记恢复原工作区,保留候选修改,不创建替代副本;缺失、身份不符、分支替换或已处置的目录继续拒绝。
14
+ - 统一托管规则:正常执行只静默等待;审批核验具体操作;交付后集中、有界读取与审查;同链身份无变化时复用预检事实,审查结果确认持久化。用真实 1.5.0 的 LF/CRLF 发布模板验证迁移、幂等和自定义规则保护。
15
+ - 修复迁移过 Codex 配置目录的机器每次更新都误报冲突:允许选定的 home 根目录为正常 symlink/Windows junction,将各安装、修复、移除和启动刷新操作固定到真实目录;保留根目录链接和用户自定义配置保护,不改变全局 CODEX_HOME。
16
+ - 登记已安装的 1.5.1-test.1 托管模板的准确 LF/CRLF 身份,支持后续候选升级;补充经真实 junction 升级原版模板、再次幂等及自定义文件保留的回归。
17
+ - 修复热更新时沿用旧清单缓存、将新规则误写成旧版本的问题:每次激活从当前包清单刷新版本;登记已观察到的本地测试版旧版本戳模板,支持准确迁移,继续保留自定义文件。真实热更新和重启结果见本轮验收报告。
18
+ - 本轮候选完整回归 1566 项通过;同步正式版本和补充 test.3 升级验证后,正式源码完整回归 1567 项通过,无失败、跳过或取消;前端构建产物检查通过。原生设置自动保存、任务详情与完整审查意见已实测;真实 DSH 任务确认团队关闭成功。夹具注入的事件测试不冒充全真模型验收。
19
+ - 真实模型验收通过失败提醒重放、错误确认保留、正确与重复确认、90 秒静默等待以及集中审查持久化;支持已安装 test.3 候选准确迁移到正式版。版本范围、升级方式和已知限制见 docs/releases/1.5.1.zh.md;未新增跨进程提醒持久化,不宣称新的 token 节省比例。
20
+
21
+ ## 1.5.0 — 静默等待、提问与审批闭环(2026-11-15)
22
+
23
+ - 新增 `delegate_question_answer`,转交 DSH 原生普通问题;回答后可在同一次调用继续静默等待。问题有有效期,并绑定原 Agent、Session 和工具调用;回答不授予权限。
24
+ - 审批工具支持 `waitAfterDecision: true`。已确认生效后直接续等;决定答复未知不自动重送,已生效后的等待故障仍保留回执。省略新选项保留旧协议。
25
+ - 新增只读 `delegate_metrics`,统计程序调用、内部观察、等待原因、字节数与决定/回答事实。宿主模型 token 和费用仍标记未接入,账单对照单独核算。
26
+ - 修复正常 `dsh-delegate` / `dsh-taskbridge` 路径误脱敏;分离显示投影和可恢复身份,重启后核验真实路径/摘要并续接原对话。已丢失可信证据的旧记录不猜测恢复。
27
+ - 审批证据上限提高至单项8192字符、总计16384字符;超限仍明确阻止允许。拒绝理由送达同一个执行Agent,原操作继续拒绝,后续申请独立决定。
28
+ - 问题完整提供或明确不可答;需要脱敏改义的题目拒绝发布。裁剪优先保留待处理问题和已应用回执,避免重复作答或重复审批。
29
+ - MCP/插件版本从自身包清单读取;更新Codex托管规则和等待配置。识别已发布1.4.2及本地test.1/test.2原版模板,保留用户自定义规则。
30
+ - 候选真实验收:原生提问、拒绝反馈、972字符审批、90秒操作、集中审查、DSH实际重启续接、约21分23秒真实模型通道验收均通过。20分钟内无中间结果查询,外层客户端到期后续接同一调用。
31
+ - 1.5.0版本戳及测试版升级规则更新后,完整自动回归1468项通过,发布针对性检查160项通过。
32
+ - 等待阶段账单样本:token总量从9,986,839降至457,224,少95.42%;按任务时长折算少94.46%。这是不同任务的等待样本对照,旧任务含审批、新验收无审批,不代表整任务或所有用户的固定降幅;完整方法和同类动作对照见 `docs/releases/1.5.0-token-benchmark.zh.md`。
33
+ - 保留默认通用加载策略;不新增CLI执行通道或Claude Code一键安装。更新方法、验收范围与客户端限制见 `docs/releases/1.5.0.zh.md`。
34
+
3
35
  ## 1.4.2 — 移除 DSH 版本白名单,默认通用加载(2026-11-14)
4
36
 
5
37
  - 删除 `engines.dsh`,将宿主提供的 `@deepseek-ai/dsh-*` peer 范围改为 `*`,不再因 DSH 版本号不在枚举列表中而拒绝安装或加载;包含截图所示的 `0.2.2-rc.3` 场景。
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # DSH TaskBridge
2
2
 
3
- **1.4.2** 默认通用,不再按 DSH 版本白名单拦截安装或加载;保留必要的运行时接口检查。详见 [1.4.2 更新说明](docs/releases/1.4.2.zh.md)。
3
+ **1.5.1** 修复更新后 Codex 集成误报冲突,加入设置自动保存,修复详情与完整审查意见,并完善失败提醒确认和重启续接。详见 [1.5.1 更新说明](docs/releases/1.5.1.zh.md)。
4
4
 
5
5
  **让 Claude Code 或 Codex 指挥 DSH 完成任务,在 DSH 插件中配置 API、执行模型和思考强度。**
6
6
 
@@ -10,6 +10,8 @@
10
10
  - [从 DSH Delegate/TaskDispatch 迁移到 TaskBridge](docs/taskbridge-upgrade.md):包名为 `dsh-taskbridge`,保留旧数据和 MCP 技术标识,不要同时启用新旧插件。
11
11
  - [在 DSH“发现”中搜索和安装](docs/plugin-market.md):添加本项目的自定义索引,安装源固定到本项目的 Git 提交。
12
12
  - [Claude Code 手动 MCP 接入](docs/claude-code.md);Codex 继续使用设置页的安装/修复按钮。Claude Code 的一键安装按钮和真实客户端验收尚未完成。
13
+ - [1.5.1 更新说明](docs/releases/1.5.1.zh.md):自动保存、更新冲突修复、完整审查意见与失败提醒确认;附真实验收范围和已知限制。
14
+ - [1.5.0 更新说明](docs/releases/1.5.0.zh.md):新增提问工具、审批/回答后同调用续等;Windows 实际重启续接与超过20分钟真实通道验收通过。[Codex token 对照](docs/releases/1.5.0-token-benchmark.zh.md)给出等待阶段样本的实测结果和适用边界。
13
15
  - [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)保留。
14
16
 
15
17
  DeepSeek Harness(DSH)的委托插件:让 MCP 宿主在你开启本机总开关后,调用 DSH
@@ -18,7 +20,7 @@ DeepSeek Harness(DSH)的委托插件:让 MCP 宿主在你开启本机总
18
20
  新安装时本机调用总开关默认关闭。开关状态会保存在插件设置中,重启后恢复保存值;
19
21
  关闭时拒绝新的委派任务,并请求停止正在运行的任务。
20
22
 
21
- > **当前版本:`1.4.2`(移除 DSH 版本白名单,默认通用加载)。** 源码仓库和可下载的 Release
23
+ > **当前源码版本:`1.5.1`(自动保存、集成升级与可靠提醒;正式发布以 npm/GitHub 状态为准)。** 源码仓库和可下载的 Release
22
24
  > 位于 [GitHub](https://github.com/ranranyya/dsh-taskbridge)。npm 安装标识为 **`dsh-taskbridge`**,
23
25
  > GitHub Release 同时提供 `.tgz`。`1.1.0` 的静默等待说明见
24
26
  > [`docs/silent-wait.md`](./docs/silent-wait.md);`1.2.0` 修正了其中三处真实问题(等待中断的
@@ -49,13 +51,13 @@ profile 是**应用保留的**:npm / `dsh plugin` CLI 对该 profile 的操作
49
51
  Desktop 侧的包操作只能交给应用完成——不要在 Desktop 的正式 profile 里执行 npm/pnpm
50
52
  命令,也不要直接编辑其中的文件。
51
53
 
52
- 1. 打开 Desktop 的 **Plugins manager → 添加插件**,输入 **`dsh-taskbridge@1.4.2`**。
54
+ 1. 打开 Desktop 的 **Plugins manager → 添加插件**,输入 **`dsh-taskbridge@1.5.1`**。
53
55
  若中国大陆镜像尚未同步,先选择 npm 官方源再重试。安装后的显示名为 **DSH TaskBridge**。
54
56
  也可以从本项目 Release 下载 `.tgz`,或在仓库根目录打包:
55
57
 
56
58
  ```bash
57
59
  npm pack
58
- # → dsh-taskbridge-1.4.2.tgz
60
+ # → dsh-taskbridge-1.5.1.tgz
59
61
  ```
60
62
 
61
63
  2. 使用本地包时,通过 **添加插件**入口选择下载或生成的 `.tgz`(或本仓库目录)完成安装。
@@ -69,7 +71,7 @@ Desktop 侧的包操作只能交给应用完成——不要在 Desktop 的正式
69
71
 
70
72
  ```bash
71
73
  # 装进一个 profile(例:web)
72
- dsh plugin --profile web add ./dsh-taskbridge-1.4.2.tgz && dsh plugin --profile web why dsh-taskbridge
74
+ dsh plugin --profile web add ./dsh-taskbridge-1.5.1.tgz && dsh plugin --profile web why dsh-taskbridge
73
75
 
74
76
  # 启动(首次启动会自动把插件 bundle 追加到 dsh.profile.bundles)
75
77
  dsh --profile web
@@ -82,7 +84,7 @@ dsh --profile web
82
84
  ### 说明与注意
83
85
 
84
86
  - **不要装进你正在用的正式 profile 做试验。** 建议先用一次性 profile:
85
- `dsh plugin --profile dsh-delegate-try add ./dsh-taskbridge-1.4.2.tgz`,再把
87
+ `dsh plugin --profile dsh-delegate-try add ./dsh-taskbridge-1.5.1.tgz`,再把
86
88
  `DSH_HOME` 指向临时目录做隔离验证。该命令同样只用于 CLI profile。
87
89
  - 该包声明了 `@deepseek-ai/dsh-*` 的 peer,若你的包管理器默认自动安装 peer,
88
90
  安装过程会尝试解析这些版本。可显式关闭:`npm_config_auto_install_peers=false`
@@ -407,7 +409,7 @@ worker 请求把**某一次调用**的沙箱权限提升时,那次调用会暂
407
409
  - 提醒有冷却:同一次静默里到点报一次,之后要再过同样的间隔才会再报。
408
410
  - 间隔是全局设置(`monitoring.selfCheckSeconds` / `monitoring.attentionSeconds`,存成整秒),
409
411
  项目覆盖和单任务覆盖都不能改它。设置页在「执行设置」里的**进阶:静默监控间隔**卡片,
410
- 以分钟呈现、按秒保存,也可以点页面底部的「保存设置」一起保存。
412
+ 以分钟呈现、按秒保存,修改后自动保存,无需再点击底部按钮。
411
413
  - 修改只影响**之后新提交**的任务;运行中的任务保留它开始时冻结的那份间隔快照。
412
414
  - 任务记录页在有进行中任务、且页面可见时每 5 秒只读刷新一次;终端状态的任务不会触发刷新。
413
415
  详情里显示阶段、最近进展、当前工具与其耗时、无进展诊断;旧版本写的记录会如实显示
@@ -517,7 +519,7 @@ Codex 子智能体现在按「提交 → `delegate_wait` 同一任务」运作
517
519
  # 不要在 Desktop 的正式 profile 下执行下面的 CLI 命令。
518
520
 
519
521
  # CLI web profile 的升级:换成本地新包或(将来)新版本
520
- dsh plugin --profile web add ./dsh-taskbridge-1.4.2.tgz
522
+ dsh plugin --profile web add ./dsh-taskbridge-1.5.1.tgz
521
523
 
522
524
  # 导出:界面里"导出非敏感配置"按钮,或用只读 API
523
525
  # GET /api/dsh-delegate/settings
@@ -44,12 +44,29 @@ export declare function readConfig(env: Record<string, string | undefined>): Mcp
44
44
  * - `observe` → `POST /dsh-delegate/x/tasks/observe` (bounded long-poll read)
45
45
  * - `cancel` → `POST /dsh-delegate/x/tasks/cancel`
46
46
  * - `permission`→ `POST /dsh-delegate/x/tasks/permission`
47
+ * - `question` → `POST /dsh-delegate/x/tasks/question`
48
+ * - `review` → `POST /dsh-delegate/x/tasks/review`
47
49
  * - `preflight` → `POST /dsh-delegate/x/workspace/preflight`
48
50
  *
49
- * `observe` backs `delegate_wait`; `preflight` is the read-only workspace
50
- * inspection behind `delegate_preflight`, and it creates nothing.
51
+ * `observe` backs `delegate_wait`; `review` records the commander's delivery conclusion
52
+ * (the only writer of `hostAcceptance`); `preflight` is the read-only workspace
53
+ * inspection behind `delegate_preflight`, and it creates nothing. `question` answers an
54
+ * ordinary question a worker asked — it settles one paused call and grants nothing, which
55
+ * is why it is NOT a second permission route.
56
+ *
57
+ * There is deliberately NO route for `delegate_metrics`: that tool reports this process's
58
+ * own census and never reaches the plane.
51
59
  */
52
- export type ExecutionRoute = 'submit' | 'status' | 'result' | 'observe' | 'cancel' | 'permission' | 'preflight';
60
+ export type ExecutionRoute =
61
+ | 'submit'
62
+ | 'status'
63
+ | 'result'
64
+ | 'observe'
65
+ | 'cancel'
66
+ | 'permission'
67
+ | 'question'
68
+ | 'review'
69
+ | 'preflight';
53
70
 
54
71
  /**
55
72
  * Per-call context passed beside the route and payload.
@@ -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 ordinary-question answer. Spelled out like every other route: the plane registers
74
+ // exactly `/tasks/question`, and a name-to-path guess would 404 on the one call that
75
+ // resumes a worker paused on a human question.
76
+ question: Object.freeze({ method: 'POST', path: '/tasks/question' }),
73
77
  // The commander's delivery review. Spelled out like every other route: the plane
74
78
  // registers exactly `/tasks/review`, so a missing entry here refused the one call that
75
79
  // records `hostAcceptance` with `MCP_ROUTE_UNMAPPED` before any request was sent.
@@ -262,6 +266,17 @@ async function main() {
262
266
  callExecution: createExecutionClient(config),
263
267
  logger: { warn: (...args) => process.stderr.write(`dsh-delegate-mcp: ${args.join(' ')}\n`) },
264
268
  });
269
+ // One bounded diagnostics line on the way out, on STDERR (stdout is the protocol
270
+ // stream). It carries counts, durations and byte totals only — no task content, no
271
+ // tool arguments — and it states explicitly that the host model's own activity is not
272
+ // observed here, so nobody can read it as a wake-up or token count.
273
+ process.once('exit', () => {
274
+ try {
275
+ process.stderr.write(`${server.diagnosticsLine()}\n`);
276
+ } catch {
277
+ // An exit-time diagnostic must never change the exit status.
278
+ }
279
+ });
265
280
  await serveStdio({
266
281
  input: process.stdin,
267
282
  output: process.stdout,
@@ -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.2"
4
+ version = "1.5.1"
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."
@@ -24,7 +24,7 @@ ACTIVATION (check this before anything else)
24
24
  clarifying question instead of dispatching.
25
25
 
26
26
  DISPATCH (only for an explicitly assigned implementation task)
27
- 1. PREFLIGHT FACTS FIRST. Call `delegate_status` first, then call
27
+ 1. PREFLIGHT FACTS FIRST — FOR A NEW TASK. Call `delegate_status` first, then call
28
28
  `delegate_preflight` with the exact authorized workspace path as
29
29
  `workspacePath`. `delegate_status` reports whether delegation is enabled at all;
30
30
  `delegate_preflight` reports what the workspace actually looks like and which
@@ -35,10 +35,26 @@ DISPATCH (only for an explicitly assigned implementation task)
35
35
  A `delegate_status` answer that says the switch is off ends the dispatch here:
36
36
  the preflight may still be read for reporting, but nothing may be submitted.
37
37
  2. APPLY THE ISOLATION DECISION. `delegate_preflight` answers with an `isolation`
38
- of `worktree`, `shared` or `block` and a stable `reason` code. For an explicit
39
- follow-up, use the parent's original source `workspacePath` for preflight and
40
- submit, then follow rule 4b: the engine pins the parent's isolation, so do not
41
- choose a new mode from the current preflight result.
38
+ of `worktree`, `shared` or `block` and a stable `reason` code.
39
+ 2a. PREFLIGHT IS PER CHAIN, NOT PER DISPATCH. Preflight a NEW task: `delegate_status`,
40
+ then `delegate_preflight` on the original authorized source path, then the dirty-tree
41
+ decision below. For a CONTINUATION of a task chain you already verified, do NOT redo
42
+ the dirty-tree decision every round: when the source path is the same, the goal and
43
+ boundaries are unchanged, and there is no identity or isolation anomaly, reuse the
44
+ already-verified preflight facts and go straight to the submit in rule 4b. The
45
+ worker's own uncommitted candidate changes in that chain are the expected state of
46
+ the chain, not a fresh dirty-tree decision to re-litigate. Re-verify when the source
47
+ path changed, the work is unrelated, an identity/isolation refusal came back, or the
48
+ engine reports a mismatch — and then preflight afresh. This reuse changes NOTHING in
49
+ the engine: every submission still carries the ORIGINAL source `workspacePath` plus
50
+ the latest `continueFromTaskId`, and the engine still re-checks ownership, paths, the
51
+ original checkout and the Session on every submit. Never route a refused or blocked
52
+ chain through a new task to get past the refusal.
53
+ 2b. For an explicit follow-up, submit with the parent's original source `workspacePath`
54
+ — and re-run `delegate_preflight` only when needed under 2a (source changed, work
55
+ unrelated, identity/isolation refusal, or an engine mismatch). A verified chain is NOT
56
+ preflighted mechanically every round. The engine pins the parent's isolation, so do
57
+ not choose a new mode from any fresh preflight result.
42
58
  - `isolation: "worktree"` (reason `PREFLIGHT_CLEAN_REPOSITORY`) — the repository
43
59
  is clean. Dispatch with the worktree isolation configured in the DSH TaskBridge
44
60
  plugin settings; do not change it.
@@ -87,6 +103,35 @@ DISPATCH (only for an explicitly assigned implementation task)
87
103
  override the configured provider, model, reasoning effort or timeout, and never
88
104
  encode a route in the task prompt. `allowShared` on the preflight records the
89
105
  decision but does not change the submitted job's isolation by itself.
106
+ 4a. AGENT TEAMS IS YOUR DECISION, NOT THE OPERATOR'S. `delegate_submit` accepts an
107
+ optional boolean `agentTeams`: it selects DSH's Agent Teams mode
108
+ ("启用智能体团队协作", the switch in the DSH model menu) for THIS task's own DSH
109
+ Session. It is NOT Codex's own multi-agent feature and NOT the additional review
110
+ model. The operator decides ONCE that you choose per task; do not ask them per
111
+ dispatch.
112
+ - Simple single-file or strongly sequential work: turn it OFF EXPLICITLY with
113
+ `agentTeams: false` whenever the loaded schema accepts the field. OMITTING the field
114
+ is NOT "off": an omitted value makes no new decision, so the run keeps (or, on a
115
+ continuation, inherits) whatever selection the Session already has. A repository
116
+ whose AGENTS.md forbids delegating again must send `false` and state which actions
117
+ the ROOT execution must perform instead (those still need normal approval).
118
+ - Turn it on only when the work genuinely splits into independent modules that can
119
+ proceed in parallel AND the gain clearly covers the coordination cost. Say the
120
+ reason in the dispatch text.
121
+ - A continuation does not re-decide it: the plugin inherits the chain's choice, so an
122
+ omitted value on a follow-up keeps the parent's mode. Pass `agentTeams: false`
123
+ explicitly when you want THIS follow-up off, and an explicit value when the scope
124
+ changed enough to justify flipping it.
125
+ - Execution provider/model/effort remain the operator's configuration. `agentTeams`
126
+ never overrides them, and you never encode a model in it.
127
+ - Express it ONLY through this schema field. If the loaded tool version does not
128
+ accept `agentTeams`, say so and ask for the newer integration — never fake success,
129
+ never route it through another field, the task prompt or a different channel.
130
+ - Team members run under DSH's native policy (their own approvals default to
131
+ `never`), so they only do what is already permitted. A concrete action that needs
132
+ more permission must be done by the ROOT execution and decided through this
133
+ channel's normal single-call approval. Never claim member approvals are bridged,
134
+ never widen `owns`, never change the host's policy.
90
135
  4b. TASK THREADS. Every submission starts a NEW DSH task conversation by default,
91
136
  even when the same workspace has been used for many earlier tasks; a
92
137
  directory-level reuse setting no longer exists. Pass `continueFromTaskId` ONLY
@@ -120,6 +165,31 @@ DISPATCH (only for an explicitly assigned implementation task)
120
165
  raising it — when a wait ends you simply call it again on the same taskId.
121
166
  A shorter explicit `waitSeconds` is legal but is only for a one-off diagnostic the
122
167
  operator explicitly asked for; it is never the normal loop.
168
+ 5a0. FOUR DIFFERENT THINGS, never conflated.
169
+ - `wait-limit` — THIS call's own wait budget ran out and nothing changed. Wait again
170
+ on the same taskId. Not a result, not a stall, not a task event.
171
+ - An OUTER limit — your client handed the call back on its own tool/exec time limit.
172
+ The MCP observation did not end and the worker did not stop. Continue the SAME exec
173
+ cell and ask for the largest yield it supports (see 5d).
174
+ - `attention` — genuine inactivity: no real progress for the configured threshold
175
+ (ten minutes by default) while the task still runs. A question, not a verdict.
176
+ - The task's TOTAL execution timeout — the worker's own budget, which ends the run and
177
+ is reported as a terminal state. It is not `wait-limit`, not `attention` and not a
178
+ client-side event.
179
+ A real hard failure is worth ONE de-duplicated reminder to the host. An ordinary
180
+ single failing test inside the worker is the WORKER's job to diagnose and fix: it is
181
+ not a host event, and you must not resubmit, cancel or take over for it.
182
+ ORDER OF WORK: you plan, approve and review; the worker implements. In a normal run
183
+ your only operation is `delegate_wait` on the task you submitted. Do not read the
184
+ worker's in-progress code, do not run the tests yourself to "help", and do not use an
185
+ approval to take over the implementation.
186
+ ONE COMPLETE BRIEF: state the goal, the boundaries and the acceptance checks once, up
187
+ front. After an approval, continue observing with `waitAfterDecision: true` on the SAME
188
+ task (or `delegate_wait` on it) instead of submitting anything new.
189
+ BOUNDED DIAGNOSIS, NOT TAKEOVER: only when the task is a proven blocker, reports
190
+ `attention`, shows a genuinely abnormal signal, or the operator asks, you may run a
191
+ BOUNDED diagnosis — facts first, then a decision. Never start writing the implementation
192
+ during it.
123
193
  5a. WHAT THE WAIT REASONS MEAN, and what you do next.
124
194
  - `heartbeat`: nothing to report. The wait expired with no news. You will normally
125
195
  never see this, because the tool re-issues internally. If you do see it, call
@@ -136,11 +206,22 @@ DISPATCH (only for an explicitly assigned implementation task)
136
206
  stated error justifies anything else, and then you report it instead of silently
137
207
  restarting work.
138
208
  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),
209
+ "repeated-tool-failure"`, with `eventId`, `toolName`, `failureCode`, `consecutive`), the
210
+ task is NOT silent: the worker has repeated ONE operation and failed the same way
211
+ several times in a row. That is a different situation and needs a different decision.
212
+ The SAME reminder (same `eventId`) is REDELIVERED on later waits until you acknowledge
213
+ it, so a lost answer is never a lost reminder: do not read the repetition as several
214
+ failures or new events; it is one notification you have not confirmed yet. After you
215
+ decide how to proceed, call `delegate_wait` with `ackFailureEventId` set to the
216
+ `eventId` you saw. That acknowledgment stops the redelivery; it decides nothing about
217
+ the task and stops nothing. The answer reports the verdict in `failureAck`:
218
+ `acknowledged: true` means it landed; `acknowledged: false` means it did NOT land.
219
+ When the reason says the ack was refused or the event is unknown, do NOT resend the
220
+ same id blindly: keep the fact, keep following the task with plain `delegate_wait`,
221
+ and act on the NEW event if a different one appears. A superseded episode needs no
222
+ confirmation at all — just continue waiting on the SAME task. Only a transport-level
223
+ uncertainty (the wait itself failed or was cancelled) justifies one bounded retry of
224
+ the SAME ack. Decide deliberately: keep waiting (the worker may still recover),
144
225
  cancel, or write a follow-up that gives the worker the missing information. Do not
145
226
  repeat the identical instruction and hope for another outcome, and do not take the
146
227
  reminder itself as proof the task can never succeed.
@@ -150,7 +231,20 @@ DISPATCH (only for an explicitly assigned implementation task)
150
231
  - You are the deciding commander. Do not invoke another approval or review model,
151
232
  do not ask the operator to choose routine within-task decisions, and do not
152
233
  delegate the approval decision to the worker. The worker's own `reason` is a
153
- claim, never authority.
234
+ CLAIM awaiting verification, never evidence and never authority.
235
+ - Approval verifies the OPERATION, not the story: the complete, concrete command or
236
+ script, every path it touches, and the process ownership (whose program would run
237
+ and which directory it would act in). If any of those is missing or materially
238
+ incomplete, refuse and ask for the exact command.
239
+ - Reading source does not need approval. A simple source search or field lookup is a
240
+ plain PowerShell built-in (`Select-String`/`Get-Content`), and you must not start
241
+ `node`, Electron or another interpreter just to READ a file. An external program
242
+ earns a one-off request ONLY when there is concrete evidence that the built-in
243
+ path genuinely fails in this same environment — and then you request exactly ONE
244
+ bounded command and say which error it resolves.
245
+ - A test writing into its own temporary directory is NOT a source commit. Do not
246
+ refuse, and do not treat it as history rewriting; the ban is on your own commits,
247
+ pushes, tags and history edits in the repository.
154
248
  - Inspect the FULL operation the wait returned at the top level: the tool, the
155
249
  redacted arguments, completeness and bounds, the call identity, the session and
156
250
  the repository. Read whatever local evidence you need to understand an
@@ -163,18 +257,81 @@ DISPATCH (only for an explicitly assigned implementation task)
163
257
  operation, the request still reported as pending, and you quote that request's
164
258
  exact `fingerprint`. Call `delegate_permission_decide` with the `taskId`, the
165
259
  `requestId`, a `decision` of `allow-once` or `reject`, that `fingerprint`, and a
166
- short bounded `reason`. Then call `delegate_wait` on the SAME task.
260
+ short bounded `reason`. When your MCP channel supports it, ALSO pass
261
+ `waitAfterDecision: true`: the decision and the following wait then happen in ONE
262
+ call, so a following request does not cost a second tool call. The answer is the
263
+ same compact `delegate_wait` shape plus `decisionReceipt`; a NEW request comes
264
+ back in it, and the request you just decided is never re-asked. Read
265
+ `decisionReceipt` first. `applied: true` is claimed ONLY when the harness confirmed
266
+ the SAME task, the SAME request and the SAME operation: the decision is in force,
267
+ so keep it — even when this answer instead carries `reason: null` and a
268
+ `waitError` block, which means the DECISION SUCCEEDED and only the FOLLOWING WAIT
269
+ failed, was cancelled or was interrupted. In that case never send the decision
270
+ again, never cancel or reassign the task, and resume following the same taskId with
271
+ `delegate_wait`. `applied: null` with `confirmation: "unknown"` means nothing was
272
+ established — the call failed before the harness answered, or the answer
273
+ contradicted or lacked the evidence to confirm it (the refusal names which, under
274
+ `error.details.decisionReceipt`): read the task with `delegate_result` before
275
+ sending anything again, and never resend automatically. If your client does not
276
+ offer the flag, decide first and then call `delegate_wait` on the SAME task — the
277
+ decision alone does not resume your observation.
167
278
  - An invalid or stale decision grants nothing. If an allow is refused as stale or
168
279
  changed, re-read the CURRENT pending request and decide again safely. Never
169
280
  retry under broader settings, never widen the sandbox, and never silently
170
281
  enable anything to get past a refusal. An approval covers exactly one tool
171
282
  call; it is never host acceptance and never a standing sandbox grant.
283
+ - A `reject` reaches the WORKER with your reason. It is sent back into the same
284
+ agent as a note, so the worker can read WHY and adjust. Write the reason as a
285
+ statement of what to change ("the command was too long for the evidence bound,
286
+ shorten it and ask again", "that path is outside the authorised workspace, use
287
+ the source checkout"), never as a hidden instruction. The note is not a grant:
288
+ the call stays rejected, and a new attempt is decided on its own.
289
+ - `question`: the worker asked YOU a question and is paused until you answer.
290
+ This is NOT a permission request and grants nothing. `question.questions[]` gives
291
+ each question's `id`, `question`, optional `header`/`detail`, its `options`
292
+ (each with a `label`) and whether it is `multiSelect`; `question.grantsAccess` is
293
+ always false. Answer with `delegate_question_answer({ taskId, requestId, answers })`,
294
+ where `answers` has one entry per question naming that question's `id` exactly
295
+ once, with `selected` (labels the question actually offered) and/or non-empty
296
+ `custom` text; a question with no options needs `custom`. Every asked question
297
+ must be answered, a single-select question takes at most one offered label, and an unknown
298
+ id or an unoffered label is refused while the question stays pending. When your
299
+ channel supports it, pass `waitAfterAnswer: true` to answer and keep following the
300
+ SAME task in one call: the answer is the compact wait shape plus `answerReceipt`.
301
+ If the answer IS applied but the following wait fails, the call still succeeds with
302
+ `answerReceipt.applied: true`, `reason: null` and a `waitError` — the answer stands
303
+ and must not be resent. A question whose `intent` is `approval` is REFUSED on this
304
+ channel by design: a permission decision must go through
305
+ `delegate_permission_decide`, so tell the worker through its next step or reject
306
+ the tool call; never treat a question answer as a way to grant access. Answering a
307
+ `plan-review` question is information only and grants nothing either.
308
+ - A question is published WHOLE or refused. If `delegate_wait` reports
309
+ `questionAnswerable: false`, `questionsOmitted: true`, `QUESTION_PAYLOAD_REDACTED`,
310
+ or `QUESTION_PAYLOAD_TOO_LARGE` (or a task view has no `question` block while the phase
311
+ is `awaiting-question`), the worker's question set was too large to carry intact and
312
+ was refused BEFORE it reached you: you never saw a shortened version of it, and you
313
+ must not answer it. Applied receipts still stand; do not resend them. Tell the worker
314
+ in its next step to ask a smaller question (fewer questions, or
315
+ shorter detail), or reject that tool call. Never invent questions or ids to work
316
+ around it.
317
+ - A question also has a FINITE life (ten minutes by default). If it expires the worker
318
+ gets `ASK_TIMED_OUT` and continues on its own; that is not a failure you must
319
+ unblock, and an expired `requestId` can never be answered afterwards.
172
320
  - `ready`: execution finished and the task now waits for HOST REVIEW. That is not
173
321
  acceptance: the plugin never approves its own work. Call `delegate_result` ONCE
174
322
  for the same task to read the full evidence (diff, validation output, review
175
323
  findings, changed files) and then do the review yourself, in Codex. If the diff
176
324
  is large, inspect only the files that matter for this change, once each. Do not
177
325
  re-read the same evidence repeatedly, and never reply "done" without reviewing.
326
+ READ IN THIS ORDER, and keep the read small:
327
+ 1. the short summary, the changed-file list, and the test results with their log
328
+ paths and stated limitations;
329
+ 2. only then the specific files the review gap actually needs, one file or one
330
+ bounded range at a time. Do NOT dump whole large files or a whole-repository
331
+ diff: a truncated read forces a re-read and proves nothing.
332
+ Record every verified conclusion WITH its evidence path (file plus line, or log path)
333
+ as you go, so a later question is answered from that note instead of a second full
334
+ read.
178
335
  The review note is up to 8000 Unicode code points; a longer answer states
179
336
  `noteOmitted: true` and the note is read in pages with `reviewNoteOffset` and
180
337
  `reviewNoteLimit` (2000 code points per page) until `complete` is true. Read the
@@ -195,6 +352,12 @@ DISPATCH (only for an explicitly assigned implementation task)
195
352
  `continueFromTaskId`; do not overwrite the old task's decision. Never mark old
196
353
  records accepted in bulk, and never claim a decision was saved when an older
197
354
  server lacks this tool.
355
+ THE REVIEW WRITE IS THE RECORD. A report you paste into the conversation is NOT a
356
+ review: it is recorded only when `delegate_review` answers that the write is
357
+ durable. If nothing was written, nothing was reviewed.
358
+ ONE ROUND PER DELIVERY. Collect every defect you find into a single correction list
359
+ and send it as ONE follow-up on the same chain (`continueFromTaskId`); do not trickle
360
+ one correction per submission.
198
361
  Reviewing is done in ONE pass per delivery: do not call `delegate_review` to
199
362
  "check in" while the run is still going, and do not review the same result more
200
363
  than once.
@@ -287,9 +450,10 @@ DISPATCH (only for an explicitly assigned implementation task)
287
450
  available yield is genuinely short and there is no automatic continuation, a long
288
451
  wait costs one resumed turn per yield window. In that case say so plainly to the
289
452
  operator once. Never invent an automatic wake-up, never claim the plugin will notify
290
- you in the background, and never report a "background wait" that no interface
291
- provides. Changing the operator's Codex configuration to work around it is also
292
- outside your authority.
453
+ you in the background, never report a "background wait" that no interface
454
+ provides, and never promise the plugin will wake you or achieve zero wake-ups
455
+ across clients — no such interface exists. Changing the operator's Codex
456
+ configuration to work around it is also outside your authority.
293
457
  - Asking for a long yield is a request, not a guarantee; the host may still return
294
458
  early — including for a permission request that arrives during the wait. When it
295
459
  does, resume the same cell as above; the plugin side did not fail.
@@ -1,6 +1,6 @@
1
1
  # DSH TaskBridge
2
2
 
3
- Version 1.4.2 removes the DSH version whitelist while retaining runtime capability checks and the 1.4.1 review fixes. Install `dsh-taskbridge@1.4.2` or use its release tarball. See the [release notes](releases/1.4.2.zh.md).
3
+ Version 1.5.1 fixes managed Codex integration upgrades and adds automatic settings saving, usable full task details, acknowledged failure reminders and original worktree recovery. Install `dsh-taskbridge@1.5.1`. See the [release notes and known limits](releases/1.5.1.zh.md). The [1.5.0 billing comparison](releases/1.5.0-token-benchmark.zh.md) is historical evidence; this release claims no new fixed token reduction.
4
4
 
5
5
  Let Claude Code or Codex direct DSH tasks. Choose the execution API, model and supported reasoning effort in the DSH plugin settings.
6
6
 
@@ -16,4 +16,4 @@ Codex has a managed agent/MCP installation button. Version 1.3.2 names the compa
16
16
 
17
17
  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.
18
18
 
19
- In DSH's Add plugin dialog, use `dsh-taskbridge@1.4.2`; 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.
19
+ In DSH's Add plugin dialog, use `dsh-taskbridge@1.5.1`; 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.
@@ -1,6 +1,6 @@
1
1
  # DSH TaskBridge
2
2
 
3
- 1.4.2 默认通用,不再按 DSH 版本白名单拦截;保留 1.4.1 的历史补审、可靠保存和长审查意见。安装 `dsh-taskbridge@1.4.2` 或对应的 Release 安装包;详见 [1.4.2 更新说明](releases/1.4.2.zh.md)。
3
+ 1.5.1 修复 Codex 集成升级冲突,提供设置自动保存、完整任务详情、可靠的失败提醒确认与原工作区恢复。安装标识为 `dsh-taskbridge@1.5.1`;详见 [1.5.1 更新说明](releases/1.5.1.zh.md)。1.5.0 的 token 实测见[账单对照](releases/1.5.0-token-benchmark.zh.md),本版不宣称新的固定节省比例。
4
4
 
5
5
  **让 Claude Code 或 Codex 指挥 DSH 完成任务,在 DSH 插件里配置执行所用的 API、模型和思考强度。**
6
6
 
@@ -31,7 +31,7 @@
31
31
 
32
32
  ## 安装、升级和边界
33
33
 
34
- 项目原名 DSH Delegate,1.3.0 曾使用 DSH TaskDispatch。1.3.1 起统一为 **DSH TaskBridge**,包名为 `dsh-taskbridge`。从旧包升级请先阅读 [更名升级说明](taskbridge-upgrade.md)。在 DSH“添加插件”中输入 `dsh-taskbridge@1.4.2`;中国大陆镜像若尚未同步,改选 npm 官方源。GitHub Release 同时提供安装包。
34
+ 项目原名 DSH Delegate,1.3.0 曾使用 DSH TaskDispatch。1.3.1 起统一为 **DSH TaskBridge**,包名为 `dsh-taskbridge`。从旧包升级请先阅读 [更名升级说明](taskbridge-upgrade.md)。在 DSH“添加插件”中输入 `dsh-taskbridge@1.5.1`;中国大陆镜像若尚未同步,改选 npm 官方源。GitHub Release 同时提供安装包。
35
35
 
36
36
  [插件索引与更新说明](plugin-market.md)介绍如何添加索引,在 DSH 的“发现”中搜索本插件。发布自定义索引不代表已进入官方内置市场;DSH 当前需要用户自行添加可信索引。
37
37
 
@@ -1,7 +1,11 @@
1
1
  # Codex integration contract
2
2
 
3
- Status: implemented in 1.4.2 (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.
3
+ Status: implemented in 1.5.1 (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
+ 1.5.1 refreshes the manifest on each activation, resolves a normal linked home root, and upgrades exact shipped/candidate templates while preserving custom content. See [1.5.1 notes](releases/1.5.1.zh.md).
6
+
7
+ 1.5.0 adds `delegate_question_answer`, combined decision/answer-and-wait flows and program metrics. Managed upgrades recognize the exact published 1.4.2 and verified local test.1/test.2 companions; customized files remain operator-owned. See the [1.5.0 release notes](releases/1.5.0.zh.md).
8
+
5
9
  1.4.2 also recognizes the exact published 1.4.1 companion for managed upgrades.
6
10
  The review behavior introduced in 1.4.1 recognizes the exact unmodified
7
11
  1.4.0 companion in LF and CRLF forms, and updates the review contract: a completed
@@ -50,7 +54,7 @@ not apply to custom wrappers, other directories, or automatic startup refresh.
50
54
  | --- | --- | --- | --- |
51
55
  | `$CODEX_HOME/agents/dsh-taskbridge.toml` | managed copy of `codex/dsh-taskbridge.toml` | create it **exclusively** on explicit install when absent; refresh a byte-exact known build during plugin startup or explicit install; delete it on `remove` only after re-reading it and finding the same bytes it classified | overwrite or delete a file that is not that exact build — including a file with an old version line whose body was edited, and including a file that changed in the window between the status read and the write/removal |
52
56
  | `$CODEX_HOME/config.toml`, table `mcp_servers.dsh-delegate` | operator, with one managed entry | add the entry when absent; update `command`/`args`/its own `env.DSH_DELEGATE_DISCOVERY_FILE` when the entry carries **the plugin marker** *and* is the exact shape this plugin writes; on an explicit `install`/`repair` only, adopt a recorded `args[0]` that is a PROVED real installation of this package (manifest `name` + `bin["dsh-delegate-mcp"]` mapping) | touch any other key, table, comment or ordering; adopt, update or delete an unmarked same-name entry, even one whose values coincide; adopt a differing script path from the automatic startup check |
53
- | `$CODEX_HOME` and `$CODEX_HOME/agents` | Codex | read them (lstat **and** the Windows file attributes); create `agents` (`0700`) when both are real directories | create them relative to the process working directory; **follow a link at either level** (POSIX symlink, Windows junction/reparse point) for any read-through, write or delete |
57
+ | `$CODEX_HOME` and `$CODEX_HOME/agents` | Codex | resolve and pin a normal root symlink/junction to its real directory; inspect the real root and agents directory; create missing agents (`0700`) | retarget or delete the root alias; follow a link in the agents subdirectory or final file; write through an unusable or unverified target |
54
58
  | DSH local-call switch | operator | report it | change it |
55
59
 
56
60
  `$CODEX_HOME` resolution: `CODEX_HOME` when set and absolute; otherwise
@@ -62,15 +66,14 @@ nobody named.
62
66
 
63
67
  `lstat` on the final file is not enough: if `$CODEX_HOME/agents` is a junction,
64
68
  `mkdir -p` and the file create walk *through* it and write
65
- `agents/dsh-taskbridge.toml` outside the Codex home entirely. Both directories are
66
- therefore inspected as *boundaries*:
69
+ `agents/dsh-taskbridge.toml` outside the Codex home entirely. Since 1.5.1 the selected HOME root is first pinned to its real directory; that real root and the agents subdirectory are then inspected as boundaries:
67
70
 
68
71
  | `$CODEX_HOME` | `$CODEX_HOME/agents` | result |
69
72
  | --- | --- | --- |
70
73
  | real directory | missing | normal: install creates `agents` (`0700`) |
71
74
  | real directory | real directory | normal |
72
75
  | real directory | link (symlink or junction) | `agent.state = conflict`, `reason = agents-dir-is-link`; install/repair/remove all refuse with `AGENT_PATH_CONFLICT` |
73
- | link | not inspected (nothing below a link is examined) | `agent.state = conflict`, `reason = codex-home-is-link`; same refusal |
76
+ | root symlink/junction with a real directory target | checked under the pinned real target | normal root alias; alias preserved, agents/file links still refused |
74
77
  | could not be verified | — | `agent.state = conflict`, `reason = boundary-unverified`; same refusal |
75
78
 
76
79
  A **junction** is the case `lstat` cannot see: Windows reports it as an ordinary
@@ -439,12 +442,7 @@ A successful `install` records the directory even when it wrote nothing because
439
442
  installation was already exactly right: `changed: []` is a success, not "nothing happened".
440
443
  A REFUSED install records nothing, so a refusal cannot become the remembered target.
441
444
 
442
- A default that is a link (or cannot be verified) is reported as `default-is-link` /
443
- `default-unverified`; a home that does not exist is `no-codex-home`. When no supported
444
- directory applies, `status()` and the actions REFUSE with `CODEX_HOME_INVALID` instead of
445
- falling back, and so does `refreshManagedIntegration` when the caller passes a
446
- `startupTarget` whose `home` is `null` — the plugin never walks a junction and never
447
- substitutes a tree nobody named.
445
+ In 1.5.1 the selected home root is pinned by the installer to its real target after this precedence resolution. A normal root symlink/junction is supported; an unresolvable or unverifiable target is refused. A missing home remains `no-codex-home`; a null startup target does not silently fall back to another tree. The root alias is preserved, and links below it in agents or the final files remain forbidden.
448
446
 
449
447
  The explicit 安装 / 更新 TaskBridge 智能体 button (action `install`) is unchanged and remains
450
448
  the way to *create* the two managed targets. `status` reports the drift (`mcp.drift`)
@@ -528,7 +526,7 @@ successful diagnosis.
528
526
  ```jsonc
529
527
  {
530
528
  "codexHome": "…",
531
- "packageVersion": "1.4.2",
529
+ "packageVersion": "1.5.1",
532
530
  "boundary": { "blocked": false, "link": null, "unknown": false, "home": "directory", "agents": "directory" },
533
531
  "agent": {
534
532
  "path": "…", "state": "installed", "installed": true, "managed": true,
@@ -940,7 +938,7 @@ session (or a restart) is required to load the new file and the new MCP entry.
940
938
  | --- | --- |
941
939
  | `CODEX_HOME` relative | 400 `CODEX_HOME_INVALID`; nothing read or written |
942
940
  | `CODEX_HOME` unset | diagnosed against `~/.codex` |
943
- | `$CODEX_HOME` is a symlink or a Windows junction | `conflict` (`codex-home-is-link`); nothing below it is inspected, written or deleted |
941
+ | `$CODEX_HOME` is a normal symlink or Windows junction | pin and verify its real directory target, preserve the root alias, then apply the same managed-content checks; broken or unverifiable targets are refused |
944
942
  | `$CODEX_HOME/agents` is a symlink or a Windows junction | `conflict` (`agents-dir-is-link`); install/repair/remove refuse with `AGENT_PATH_CONFLICT` and no file is created outside the home |
945
943
  | an ordinary real Windows directory | `directory` in every spelling of the helper's boolean (`dir/False`, `dir/false`); never reported as a link |
946
944
  | `repair` with the agent file missing or `outdated` | `changed: ["mcp"]` or `[]`; the agent file is not created and not refreshed, and `agents/` is not created |