dsh-baton-mcp 0.6.18 → 0.6.20

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  <p align="center"><img src="./assets/logo/dsh-baton.svg" width="96" alt="dsh-baton logo"></p>
2
2
 
3
3
  <p align="center">
4
- <picture><source media="(prefers-color-scheme: dark)" srcset="./assets/readme/en/hero-dark.gif"><img src="./assets/readme/en/hero.gif" width="100%" alt="dsh-baton: pass the baton from Claude Code or Codex to DeepSeek Harness, watch it run live, and get it handed back when it's done"></picture>
4
+ <picture><source media="(prefers-color-scheme: dark)" srcset="./assets/readme/en/hero-dark.gif"><img src="./assets/readme/en/hero.gif" width="100%" alt="dsh-baton: pass the baton from Claude Code, Codex or Antigravity to DeepSeek Harness, watch it run live, and get it handed back when it's done"></picture>
5
5
  </p>
6
6
 
7
7
  <p align="center">
@@ -16,6 +16,7 @@
16
16
  <img src="https://img.shields.io/badge/Node.js-not%20needed-5FA04E?logo=nodedotjs&logoColor=white" alt="Node.js not needed">
17
17
  <img src="https://img.shields.io/badge/dependencies-zero-2EA44F" alt="zero dependencies">
18
18
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-DFB317" alt="MIT license"></a>
19
+ <a href="https://glama.ai/mcp/servers/JialaoLiu/dsh-baton"><img src="https://glama.ai/mcp/servers/JialaoLiu/dsh-baton/badges/score.svg" alt="dsh-baton MCP server on Glama"></a>
19
20
  </p>
20
21
 
21
22
  <p align="center"><a href="#quick-start"><b>Quick start</b></a> &nbsp;·&nbsp; <a href="#see-it-run"><b>See it run</b></a> &nbsp;·&nbsp; <a href="#how-it-compares"><b>How it compares</b></a> &nbsp;·&nbsp; <a href="#token-usage"><b>Token usage</b></a> &nbsp;·&nbsp; <a href="#how-it-works"><b>How it works</b></a> &nbsp;·&nbsp; <a href="#tools"><b>Tools</b></a> &nbsp;·&nbsp; <a href="#security-and-limits"><b>Security</b></a></p>
@@ -75,7 +76,7 @@ Nothing else to install: no Node.js, no terminal. It is the same on macOS and Wi
75
76
 
76
77
  **Check that it works:**
77
78
 
78
- ① **Open a new chat:** in Claude Code or Codex, start a **new** conversation; one that was already open does not see dsh-baton yet. It is the same in both. Antigravity starts its MCP servers only when it starts: restart it once after the plugin is switched on. Codex asks you to approve MCP tool calls: approve the `dsh-baton` tools (for unattended `codex exec` runs, add `--approve-for-me`).
79
+ ① **Open a new chat:** in Claude Code or Codex, start a **new** conversation; one that was already open does not see dsh-baton yet. Antigravity starts its MCP servers only when it starts: restart it once after the plugin is switched on. Codex asks you to approve MCP tool calls: approve the `dsh-baton` tools (for unattended `codex exec` runs, add `--approve-for-me`).
79
80
 
80
81
  ② **Ask for the workspaces:** ask it to call `dsh_list_workspaces`. It lists your Harness workspaces.
81
82
 
@@ -182,7 +183,7 @@ Working alone, Astra rated its own work 23/23; the independent check found 17/23
182
183
  </p>
183
184
 
184
185
  <p align="center">
185
- <picture><source media="(prefers-color-scheme: dark)" srcset="./assets/readme/en/flow-dark.gif"><img src="./assets/readme/en/flow.gif" width="100%" alt="Typical flow: create a workspace, send the task, wait without polling (Claude Code is woken once, Codex waits up to 59 minutes in one dsh_wait call), follow up in the same session"></picture>
186
+ <picture><source media="(prefers-color-scheme: dark)" srcset="./assets/readme/en/flow-dark.gif"><img src="./assets/readme/en/flow.gif" width="100%" alt="Typical flow: create a workspace, send the task, wait without polling (Claude Code is woken once, Codex makes one dsh_wait call an hour, however long the run), follow up in the same session"></picture>
186
187
  </p>
187
188
 
188
189
  <p align="center">
@@ -209,7 +210,8 @@ Working alone, Astra rated its own work 23/23; the independent check found 17/23
209
210
  <summary>Waiting in detail: each client, several runs, goals, changing the request</summary>
210
211
 
211
212
  - **Claude Code** waits for a run in the background (the `wait_command` that `dsh_send` returns) and is woken once, when the run ends.
212
- - **Codex** waits inside `dsh_wait`. The plugin sets Codex's tool timeout for dsh-baton to an hour (`tool_timeout_sec = 3600`), so one call waits up to 59 minutes: a run that ends within the hour costs one model request to wait for, however long it takes, and the result comes back as an ordinary tool result in the chat. A longer run returns `timed_out` with just the state after 59 minutes, and Codex calls again without summarising. Pressing Stop ends the wait at once. Codex gets no `wait_command`: its terminal cannot wake it, so it would poll. A conversation without that setting waits 270 s per call. Measured in the Codex desktop app: a 28-minute run took one `dsh_wait` call; a 62-minute run took two, the first returning `timed_out` after 59 minutes and the second getting the result 3 minutes later, with no `dsh_status` calls in between.
213
+ - **Antigravity** waits the same way, on macOS and Windows: it runs the `wait_command` in the background, ends its turn, and is woken when the run ends. Where its sandboxed terminal may not open Harness's pipe, the command follows the run through its record file in `~/.dsh-baton/host-runs` instead. Antigravity ends any MCP tool call after 3 minutes, so a `dsh_wait` there waits at most 170 s.
214
+ - **Codex** waits inside `dsh_wait`. The plugin sets Codex's tool timeout for dsh-baton to an hour (`tool_timeout_sec = 3600`), so it waits for a run of any length with one call an hour: a run that ends within the hour costs one model request to wait for, and the result comes back as an ordinary tool result in the chat. A longer run returns `timed_out` with just the state after 59 minutes, and Codex calls again without summarising. Pressing Stop ends the wait at once. Codex gets no `wait_command`: its terminal cannot wake it, so it would poll. A conversation without that setting waits 270 s per call. Measured in the Codex desktop app: a 28-minute run took one `dsh_wait` call; a 62-minute run took two, the first returning `timed_out` after 59 minutes and the second getting the result 3 minutes later, with no `dsh_status` calls in between.
213
215
  - **Several runs at once.** When a task is split across sessions (say docs, front end and back end, each in its own worktree), the client sends them all, then waits for them together: Claude Code runs one `wait_command` per run in the background, and Codex calls `dsh_wait` with `run_ids`. That call returns as soon as any of the runs ends or stops to ask a person, with every run that has (`ended`) and the ones still going (`still_running`); the client reviews those, sends fixes right away, and waits again with the rest plus the fixes. Measured on a three-part task: waiting for one run at a time, the back end that ended first was read 2 min 53 s late; waiting with `run_ids`, each result was read within a second of its run ending.
214
216
  - **Sessions with a Harness goal.** A goal (a message starting with `/goal` sets one) makes Harness start the next round by itself as soon as a turn ends. A `dsh_send` message `/goal <objective>` sets the goal through Harness's own goal service, as typing it in Harness does, and the objective goes in as the run's message; `/goal edit <objective>` replaces the objective of the goal there is. `/goal pause`, `resume` and `clear` work only in the Harness window; sent through dsh-baton they are refused, and so is a new `/goal` for a session whose goal is still active. A run sent to such a session is waited for until the goal stops, not just its first round, so "hand this to Harness" brings back the finished work; sessions without a goal are waited for as before. When the user asks for progress reports ("report every 10 minutes"), the client passes `until` `turn`: it then reports at the end of a round once 10 minutes (`every_minutes`) have passed since the last report, with every round since. To follow a session without sending anything, the client calls `dsh_wait` with `session_id` (Claude Code runs the `follow_command` in the background instead). Each report carries every round since the last one (the latest round's closing reply (up to 1500 characters), each earlier round as a one-line digest with its tools; any round in full through `dsh_read_session`), the files changed in the folder since the last report (since the run began, for the first), and the goal's state (phase, rounds started of the most allowed, whether Harness goes on with it), plus a `cursor` that the next call passes back, so switching between the two modes neither repeats nor misses a round. Both return at once when Harness asks a question (answer it with `dsh_answer` and `session_id`) or waits for an approval, when the goal is complete, paused, blocked or cleared, or when Harness will not go on with it by itself (for example after a Harness restart, until you press Continue). In Codex one call follows a goal for at most 15 minutes and Codex then calls again, so a message you type reaches it within that time; such an in-between return carries only the goal's state and how many rounds wait, not their texts.
215
217
  - **Changing the request while it waits.** In Codex, send the change with **Steer**: Codex stops waiting at once, steers it into the same Harness session (`dsh_send` with `mode` `steer`) and waits on the new run; Harness does both in the same turn. Sent with **Queue**, Codex sees it only when the run ends; you can also press Stop first and then send it. In Claude Code, just send it: it waits in the background, so it steers the change in right away. A steered run ends together with the original and they share one result; a queued run comes back on its own. Runs working in the same folder at the same time are named in each other's results, so neither removes the other's files.
@@ -251,8 +253,8 @@ The server's MCP instructions are a single sentence; how to hand over, wait and
251
253
  | `dsh_list_models` | The models Harness can run (provider, id, name, reasoning efforts) and its default model |
252
254
  | `dsh_read_session` | Recent prompts and replies of one session (with tool names); `archived: true` for an archived session |
253
255
  | `dsh_send` | Send a message: `session_id` continues that session. Without it, a task for a folder where this conversation already has an idle session continues that session, so Harness keeps the earlier context (`continued_session` says so; `new_session` `true` starts a fresh one); a busy session is never reused, so parts sent in parallel get a session each. Otherwise a new one starts in `cwd` or `workspace_id`, or, with neither, in the folder the conversation works in (a `cwd` that is not a workspace yet is registered first; a `cwd` outside the conversation's folder is allowed and noted in `folder_note`). A `cwd` inside the conversation's folder joins that folder's workspace instead of getting one of its own: the session opens in the conversation's folder and the message names the subfolder (`work_folder`), where `checks` run. Folders a client makes per conversation share one workspace each: Codex chats without a project (Codex chats), Claude scratch folders (Claude scratch), Codex worktrees (Codex worktrees) and a project's Claude worktrees (Claude worktrees). A folder that is a workspace already, or a Git worktree, keeps its own. `checks`: test commands dsh-baton runs itself when the run ends (see [How a hand-over is checked](#how-a-hand-over-is-checked)). Returns a `run_id` at once. In Harness the message is marked "Sent by Claude / ChatGPT from another chat". An archived session is refused: unarchive it in Harness, or start a new session. To a busy session, `mode` `followup` queues the message after the current turn and `steer` adds it to the running turn; left out, it does what Harness's own setting says (Settings → sending while busy: queue or steer), and `followup` when that cannot be read. `mode_source` says which applied. `model` only when the user names one ("DeepSeek-V4 Pro", "v4-pro"; `reasoning_effort` likewise): it is matched against Harness's own model list, ignoring case, spaces, hyphens and a leading DeepSeek, so a model Harness adds later (V4.1 Pro) works as soon as Harness lists it; a name that matches nothing or several fails the send, before anything is created, with the list (`provider/model` picks one). It is set on that session before the message goes in, and Harness's default model is put back as it was (Harness saves a session's pick as the default too). Left out, a continued session keeps its own model and a new one uses the hand-over default from the plugin page, else Harness's default. The reply says which in `model` and `model_source` (`requested`, `handover_default`, `default` or `session`), and `model_note` says when a hand-over default was skipped or Harness's default changed since the last new hand-over. `team` (Harness 0.2.2-rc.2 or later): `true` turns Agent Teams on for the session before the message goes in, `false` turns them off; refused, with nothing sent, on an older Harness or on a sub-agent's session |
254
- | `dsh_status` | Run progress: state, recent text and tool calls, final reply; `waiting_on` when the turn is over but sub-agents or jobs still run; `human_interjections` when someone typed in the Harness UI mid-run; state `interrupted` for a run cut short by a Harness restart; `model` the run was sent with. With `session_id` instead of `run_id`: what the session is doing, its Harness goal and its last turn's reply |
255
- | `dsh_wait` | Wait for the run to end; a finished run carries `evidence` (files changed, check results) when the message was sent with `checks` (or until it stops to ask a person, see `dsh_answer`): up to 3540 s per call for Codex (its tool timeout for dsh-baton less 60 s; 270 s when that is not set), 50 s for other clients. Still going: returns `timed_out` with just the state; call it again. Clients that can wait in the background use `dsh_send`'s `wait_command` instead; for a run a background `wait_command` already waits for, `dsh_wait` returns at once (`waiting_in_background`) rather than waiting a second time. `dsh_status` is a one-off look, not a way to wait. A run in a session with a Harness goal is waited for until the goal stops (`until` `turn` and `every_minutes` for progress reports). With `session_id` instead of `run_id` it follows the session's Harness goal without sending anything (`until`, `cursor`, `every_minutes`; see How each client waits). With `run_ids` it waits for several runs and returns as soon as any ends or asks (`ended`, `still_running`) |
256
+ | `dsh_status` | Run progress: state, recent text and tool calls, final reply; `waiting_on` when the turn is over but sub-agents or jobs still run (sub-agents are waited for until they end; background jobs and reminders for at most 5 minutes after the turn, then the run completes with `left_running` naming what still runs); `human_interjections` when someone typed in the Harness UI mid-run; state `interrupted` for a run cut short by a Harness restart; `model` the run was sent with. With `session_id` instead of `run_id`: what the session is doing, its Harness goal and its last turn's reply |
257
+ | `dsh_wait` | Wait for the run to end; a finished run carries `evidence` (files changed, check results) when the message was sent with `checks` (or until it stops to ask a person, see `dsh_answer`): up to 3540 s per call for Codex (its tool timeout for dsh-baton less 60 s; 270 s when that is not set), 170 s for Antigravity (it ends any tool call after 3 minutes), 50 s for other clients. Still going: returns `timed_out` with just the state; call it again. Clients that can wait in the background use `dsh_send`'s `wait_command` instead; for a run a background `wait_command` already waits for, `dsh_wait` returns at once (`waiting_in_background`) rather than waiting a second time. `dsh_status` is a one-off look, not a way to wait. A run in a session with a Harness goal is waited for until the goal stops (`until` `turn` and `every_minutes` for progress reports). With `session_id` instead of `run_id` it follows the session's Harness goal without sending anything (`until`, `cursor`, `every_minutes`; see How each client waits). With `run_ids` it waits for several runs and returns as soon as any ends or asks (`ended`, `still_running`) |
256
258
  | `dsh_answer` | Send your answer to the questions a run stopped to ask (Harness's ask_user_question): per question, an option number or label, free text, or skip; on a single choice, free text replaces the option. `dsh_wait` and `wait_command` return as soon as a run asks, with the questions (`needs_input`, `question`; the option Harness's model would pick is in `harness_suggested`); the main agent asks you and sends your answer. You can also answer in the Harness window: whoever answers first wins |
257
259
  | `dsh_session_activity` | Codex: through `dsh_call`. What a session is doing now: running turn, sub-agents (any depth), background jobs; `archived: true` for an archived session |
258
260
  | `dsh_update_queued` | Codex: through `dsh_call`. Change a message still waiting in the queue of a busy session, by its `run_id`: `edit` its text, `remove` it, or `steer` it into the running turn now. Once it has reached the conversation it can no longer be changed |
@@ -335,7 +337,7 @@ Version history is on [GitHub Releases](https://github.com/JialaoLiu/dsh-baton/r
335
337
 
336
338
  **Codex's cwd for dsh-baton.** Codex starts an MCP server in the conversation's folder unless its table sets `cwd`; when that folder is gone (a project on an external drive that is not connected) the server cannot start and the conversation has no `dsh_*` tools. The plugin writes `cwd` (your home folder) into `[mcp_servers.dsh-baton]` and adds it to an existing table that has none; a `cwd` you set yourself is kept.
337
339
 
338
- **Updates need no restart.** When a newer version lands in `~/.dsh-baton/app` (a plugin update, `setup`, or a copy by hand), or the same version with changed files, conversations already open in Claude Code, Codex and Antigravity use it from their next `dsh_*` call: the server checks the folder before each call, starts the new version, and says once in that call's result that it was updated. A `dsh_wait` that is already running finishes on the old version first. If the new version cannot start, the old one keeps working and the result says why. A tool added in the new version shows up in Claude Code at once (the server tells the client its tool list changed); Codex keeps the tool list a conversation started with, so it does not show a new tool until the next conversation; it can still use one at once through `dsh_call`, which the update note points to, and the tools it already has run the new code right away.
340
+ **Updates need no restart.** When a newer version lands in `~/.dsh-baton/app` (a plugin update, `setup`, or a copy by hand that also rewrites `package.json`), or the same version with changed files and a newly written `package.json`, conversations already open in Claude Code, Codex and Antigravity use it from their next `dsh_*` call: the server checks the folder before each call, starts the new version, and says once in that call's result that it was updated. A `dsh_wait` that is already running finishes on the old version first. If the new version cannot start, the old one keeps working and the result says why. A tool added in the new version shows up in Claude Code at once (the server tells the client its tool list changed); Codex keeps the tool list a conversation started with, so it does not show a new tool until the next conversation; it can still use one at once through `dsh_call`, which the update note points to, and the tools it already has run the new code right away.
339
341
 
340
342
  **`npx -y dsh-baton-mcp setup`** does the same registration from a terminal: for a plugin that could not register, or when you come from an MCP directory. With the plugin already registered it changes nothing, then points you to the plugin if it is missing.
341
343
 
@@ -382,7 +384,7 @@ codex mcp add dsh-baton -- "$(command -v node)" "$PWD/dsh-baton/src/server.mjs"
382
384
  </p>
383
385
 
384
386
  <p align="center">
385
- <picture><source media="(prefers-color-scheme: dark)" srcset="./assets/readme/en/limits-dark.svg"><img src="./assets/readme/en/limits.svg" width="100%" alt="Good to know: a message typed in the UI mid-run is flagged on the run as a human interjection, run records survive a Harness restart (cut-short runs show interrupted), Claude Code is woken once when a run ends, Codex waits up to 59 minutes in one call"></picture>
387
+ <picture><source media="(prefers-color-scheme: dark)" srcset="./assets/readme/en/limits-dark.svg"><img src="./assets/readme/en/limits.svg" width="100%" alt="Good to know: a message typed in the UI mid-run is flagged on the run as a human interjection, run records survive a Harness restart (cut-short runs show interrupted), Claude Code is woken once when a run ends, Codex makes one call an hour, however long the run"></picture>
386
388
  </p>
387
389
 
388
390
  Any process running as your OS user can drive Harness through the socket, the same as running `dsh` directly. dsh-baton relies on Harness's internal service APIs (0.2.1 and 0.2.2 today), so a major Harness update may need a follow-up release.
package/README.zh-CN.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <p align="center"><img src="./assets/logo/dsh-baton.svg" width="96" alt="dsh-baton logo"></p>
2
2
 
3
3
  <p align="center">
4
- <picture><source media="(prefers-color-scheme: dark)" srcset="./assets/readme/zh/hero-dark.gif"><img src="./assets/readme/zh/hero.gif" width="100%" alt="dsh-baton:让 Claude Code 或 Codex 把接力棒交给 DeepSeek Harness,界面实时可见,跑完那一刻就交回给你"></picture>
4
+ <picture><source media="(prefers-color-scheme: dark)" srcset="./assets/readme/zh/hero-dark.gif"><img src="./assets/readme/zh/hero.gif" width="100%" alt="dsh-baton:让 Claude Code、Codex 或 Antigravity 把接力棒交给 DeepSeek Harness,界面实时可见,跑完那一刻就交回给你"></picture>
5
5
  </p>
6
6
 
7
7
  <p align="center">
@@ -16,6 +16,7 @@
16
16
  <img src="https://img.shields.io/badge/Node.js-%E4%B8%8D%E7%94%A8%E8%A3%85-5FA04E?logo=nodedotjs&logoColor=white" alt="不用装 Node.js">
17
17
  <img src="https://img.shields.io/badge/%E4%BE%9D%E8%B5%96-%E9%9B%B6-2EA44F" alt="零依赖">
18
18
  <a href="LICENSE"><img src="https://img.shields.io/badge/%E8%AE%B8%E5%8F%AF%E8%AF%81-MIT-DFB317" alt="MIT 许可证"></a>
19
+ <a href="https://glama.ai/mcp/servers/JialaoLiu/dsh-baton"><img src="https://glama.ai/mcp/servers/JialaoLiu/dsh-baton/badges/score.svg" alt="dsh-baton MCP server on Glama"></a>
19
20
  </p>
20
21
 
21
22
  <p align="center"><a href="#快速上手"><b>快速上手</b></a> &nbsp;·&nbsp; <a href="#看它跑"><b>看它跑</b></a> &nbsp;·&nbsp; <a href="#和其他做法的区别"><b>和其他做法的区别</b></a> &nbsp;·&nbsp; <a href="#token-用量实测"><b>Token 用量</b></a> &nbsp;·&nbsp; <a href="#工作原理"><b>工作原理</b></a> &nbsp;·&nbsp; <a href="#工具"><b>工具</b></a> &nbsp;·&nbsp; <a href="#安全与限制"><b>安全</b></a></p>
@@ -75,7 +76,7 @@ dsh-baton 是一个 MCP 服务器加一个 Harness 小插件。主 Agent 用一
75
76
 
76
77
  **验证**:
77
78
 
78
- ① **新开对话**:在 Claude Code 或 Codex 里**新开**一个对话,之前开着的对话还看不到 dsh-baton。两边一样。Antigravity 只在启动时加载 MCP,插件启用后要重启它一次。Codex 调用 MCP 工具时会请你批准,批准 `dsh-baton` 的工具即可(无人值守的 `codex exec` 加上 `--approve-for-me`)。
79
+ ① **新开对话**:在 Claude Code 或 Codex 里**新开**一个对话,之前开着的对话还看不到 dsh-baton。Antigravity 只在启动时加载 MCP,插件启用后要重启它一次。Codex 调用 MCP 工具时会请你批准,批准 `dsh-baton` 的工具即可(无人值守的 `codex exec` 加上 `--approve-for-me`)。
79
80
 
80
81
  ② **检查**:让它调用 `dsh_list_workspaces`,会列出你的 Harness 工作区。
81
82
 
@@ -182,7 +183,7 @@ Codex 占 ChatGPT Plus 5 小时额度的比例,以及主 Agent 自己的花费
182
183
  </p>
183
184
 
184
185
  <p align="center">
185
- <picture><source media="(prefers-color-scheme: dark)" srcset="./assets/readme/zh/flow-dark.gif"><img src="./assets/readme/zh/flow.gif" width="100%" alt="典型流程:新建工作区、派发任务、不轮询地等待(Claude Code 结束时被唤醒一次,Codex 一次 dsh_wait 最多等 59 分钟)、在同一个对话里续接追问"></picture>
186
+ <picture><source media="(prefers-color-scheme: dark)" srcset="./assets/readme/zh/flow-dark.gif"><img src="./assets/readme/zh/flow.gif" width="100%" alt="典型流程:新建工作区、派发任务、不轮询地等待(Claude Code 结束时被唤醒一次,Codex 每小时一次 dsh_wait,任务多长都行)、在同一个对话里续接追问"></picture>
186
187
  </p>
187
188
 
188
189
  <p align="center">
@@ -209,7 +210,8 @@ Codex 占 ChatGPT Plus 5 小时额度的比例,以及主 Agent 自己的花费
209
210
  <summary>等待的细节:各客户端、多个任务、目标会话、中途改需求</summary>
210
211
 
211
212
  - **Claude Code** 在后台等待任务(`dsh_send` 返回的 `wait_command`),任务结束时只被唤醒一次。
212
- - **Codex** 在 `dsh_wait` 里等待。插件把 Codex 对 dsh-baton 的工具超时设为一小时(`tool_timeout_sec = 3600`),所以一次调用最多能等 59 分钟:一小时以内跑完的任务,不管跑多久,等待只花一次模型请求,结果作为普通的工具结果回到对话里。超过 59 分钟会返回 `timed_out`,只带状态,Codex 直接再调用一次,不会去总结进度。等待中按停止会立刻停下。Codex 不会收到 `wait_command`:它的终端无法在命令结束时唤醒它,只能轮询。没有这项设置的对话每次最多等 270 秒。实测(Codex 桌面端):28 分钟的任务只调了 1 次 `dsh_wait`;62 分钟的任务调了 2 次,第一次等满 59 分钟返回 `timed_out`,接着再等 3 分钟拿到结果;期间没有调用 `dsh_status`。
213
+ - **Antigravity** 在 macOS 和 Windows 上都这样等:在后台运行 `wait_command`,结束这一轮,任务结束时被唤醒。如果它的沙箱终端打不开 Harness 的管道,这个命令会改读 `~/.dsh-baton/host-runs` 里的运行记录文件。Antigravity 的 MCP 工具调用超过 3 分钟就会被掐断,所以在它里面 `dsh_wait` 每次最多等 170 秒。
214
+ - **Codex** 在 `dsh_wait` 里等待。插件把 Codex 对 dsh-baton 的工具超时设为一小时(`tool_timeout_sec = 3600`),所以任务多长都能等,每小时只调一次:一小时以内跑完的任务,等待只花一次模型请求,结果作为普通的工具结果回到对话里。超过 59 分钟会返回 `timed_out`,只带状态,Codex 直接再调用一次,不会去总结进度。等待中按停止会立刻停下。Codex 不会收到 `wait_command`:它的终端无法在命令结束时唤醒它,只能轮询。没有这项设置的对话每次最多等 270 秒。实测(Codex 桌面端):28 分钟的任务只调了 1 次 `dsh_wait`;62 分钟的任务调了 2 次,第一次等满 59 分钟返回 `timed_out`,接着再等 3 分钟拿到结果;期间没有调用 `dsh_status`。
213
215
  - **同时等多个任务**。一个任务拆给几个会话做时(比如接口文档、前端、后端,各在自己的 worktree 里),客户端先全部发出去,再一起等:Claude Code 给每个任务在后台各开一个 `wait_command`,Codex 调一次带 `run_ids` 的 `dsh_wait`。只要其中任何一个做完或停下来问人,这次调用就立刻返回,带上所有已经做完的(`ended`)和还在跑的(`still_running`);客户端检查这些结果、马上发返修,再带着剩下的和返修的一起接着等。实测一个分三部分的任务:一次只等一个时,最先做完的后端晚了 2 分 53 秒才被看到;用 `run_ids` 一起等时,每个结果都在做完 1 秒内拿到。
214
216
  - **带 Harness 目标的会话**。有了目标(以 `/goal` 开头的消息会设置目标),Harness 在一个回合结束后会自己开始下一轮。通过 `dsh_send` 发 `/goal 目标内容`,会用 Harness 自己的目标服务设置目标,和在 Harness 里直接输入一样,目标内容作为这次任务的消息发过去;`/goal edit 新内容` 改掉现有目标的内容。`/goal pause`、`resume`、`clear` 只能在 Harness 窗口里用,通过 dsh-baton 发会被拒绝;会话里已有未完成的目标时再发新的 `/goal` 也会被拒绝。发给这种会话的任务会一直等到目标停下,而不只是第一轮,所以一句“交给 Harness”就能拿回做完的结果;没有目标的会话照旧等待。用户要求汇报进度时(“每 10 分钟汇报一次”),客户端传 `until` 为 `turn`:距上次报告满 10 分钟(`every_minutes`)后的第一个回合结束时报告,带上这期间的每一轮。想不发消息只跟进某个会话,客户端用 `session_id` 调 `dsh_wait`(Claude Code 则在后台运行 `follow_command`)。每份报告带着自上次报告以来的每一轮(最新一轮的结尾回复(最多 1500 字),之前每一轮一行摘要和用过的工具;任何一轮的全文可以用 `dsh_read_session` 看)、文件夹里自上次报告以来改动的文件(第一份从任务开始算起)、目标状态(阶段、已开始的轮数和上限、Harness 会不会自己接着做),以及下次调用要传回的 `cursor`,所以两种方式之间切换既不会重复也不会漏掉哪一轮。两种方式在这些情况下都会立刻返回:Harness 提问(用 `dsh_answer` 加 `session_id` 回答)或等待审批;目标完成、暂停、受阻或被清除;Harness 不会自己接着做(比如 Harness 重启后,要等你按“继续”)。在 Codex 里,一次调用最多跟进 15 分钟,然后 Codex 再接着调用,所以你打的新消息最晚 15 分钟内就能被看到;这种中途返回只带目标状态和还有几轮没报告,不带各轮全文。
215
217
  - **等待中想改需求**。Codex:在输入框里用**引导**发出新要求,Codex 会立刻停止等待,用 `dsh_send`(`mode` 为 `steer`)把它插进同一个 Harness 对话,改等新的任务,Harness 在同一轮里把新要求一起做完;用**排队**发的话,要等这次任务做完才会被看到。也可以先按停止再发。Claude Code:随时发就行,它在后台等待,马上就能把新要求插队转给 Harness。插队的任务和原任务同时结束,共用一份结果;排队的任务单独返回。同一个文件夹里同时跑多个任务时,结果里会标出其他任务,不会删掉别人的文件。
@@ -251,8 +253,8 @@ Codex 占 ChatGPT Plus 5 小时额度的比例,以及主 Agent 自己的花费
251
253
  | `dsh_list_models` | 列出 Harness 能用的模型(provider、id、名称、推理强度)和它的默认模型 |
252
254
  | `dsh_read_session` | 读某个对话最近的消息和回复(含用到的工具名);已归档的对话会带 `archived: true` |
253
255
  | `dsh_send` | 发消息。带 `session_id` 续接那个对话。不带时,如果当前对话在这个文件夹里已经有一个空闲的对话,就续接它,Harness 保留之前的上下文(结果里的 `continued_session` 会说明;`new_session` 为 `true` 时新开一个);正忙的对话不会被续接,所以并行发出的几部分仍各开一个对话。其余情况新开对话,建在 `cwd` 或 `workspace_id` 指定的位置,都不带时建在当前对话所在的文件夹(`cwd` 还不是工作区时会先登记;指定的 `cwd` 在当前对话文件夹之外也可以,结果里的 `folder_note` 会提醒)。`cwd` 在当前对话文件夹里面时,不再单独建工作区,而是进当前对话文件夹的工作区:对话开在那个文件夹,消息里写明要在哪个子文件夹工作(`work_folder`),`checks` 也在子文件夹里跑。客户端给每个对话单独建的文件夹各自共用一个工作区:Codex 没选项目的对话(Codex chats)、Claude 的 scratch 文件夹(Claude scratch)、Codex 的 worktree(Codex worktrees)、同一项目的 Claude worktree(Claude worktrees)。本来就是工作区的文件夹,或者 Git worktree,仍用它自己的工作区。`checks`:运行结束后 dsh-baton 自己跑的测试命令(见[转交之后怎么验收](#转交之后怎么验收))。立即返回 `run_id`。Harness 里这条消息会标注「由 Claude / ChatGPT 从另一个聊天发送」。已归档的对话会被拒绝:先在 Harness 里取消归档,或新开对话。对话正忙时,`mode` 为 `followup` 会排在当前回合之后,`steer` 会插进正在跑的回合;不传时跟随 Harness 自己的设置(设置 → 繁忙时的发送行为:排队发送或插话发送),读不到设置时按 `followup`。返回里的 `mode_source` 说明用的是哪种。`model` 只在用户点名模型时传(如“DeepSeek-V4 Pro”“v4-pro”;`reasoning_effort` 同理):按 Harness 自己的模型列表匹配,不分大小写,忽略空格、连字符和开头的 DeepSeek,所以 Harness 以后上线的模型(如 V4.1 Pro)一出现在列表里就能用;匹配不到或匹配到多个时,发送直接失败、什么都不创建,并列出可用模型(用 `provider/model` 指定其一)。模型在消息发出前设到该对话上,Harness 的默认模型会恢复原样(Harness 会把对话里选的模型同时存成默认)。不传时,续接的对话沿用它自己的模型,新对话用插件页的转交默认模型,没设就用 Harness 默认模型。返回值的 `model` 和 `model_source`(`requested`、`handover_default`、`default` 或 `session`)写明用的是哪个;转交默认模型用不上,或 Harness 的默认模型和上一次新开转交时不一样时,`model_note` 会说明。`team`(需要 Harness 0.2.2-rc.2 及以上):`true` 在消息发出前为该对话打开智能体团队协作,`false` 关闭;Harness 版本太旧或传的是子智能体的对话时,直接拒绝、什么都不发 |
254
- | `dsh_status` | 查看运行进度:状态、最近的文字和工具调用、最终回复;回合结束但子智能体/后台任务还在跑时给出 `waiting_on`;中途有人在 Harness 界面里发消息时给出 `human_interjections`;被 Harness 重启打断的任务状态为 `interrupted`;以及这次运行发送时用的 `model`。用 `session_id` 代替 `run_id` 时:会话正在做什么、它的 Harness 目标,以及上一回合的回复 |
255
- | `dsh_wait` | 等运行结束;发消息时带了 `checks` 的,结束后会附上 `evidence`(改了哪些文件、测试结果)(或者等到它停下来问人,见 `dsh_answer`):Codex 每次最多等 3540 秒(它对 dsh-baton 的工具超时减 60 秒;没设时 270 秒),其他客户端 50 秒。没做完会带 `timed_out`,只返回状态,再调用一次即可。能在后台等待的客户端改用 `dsh_send` 返回的 `wait_command`;某个任务已经有后台 `wait_command` 在等时,`dsh_wait` 会立即返回(`waiting_in_background`),不再重复等待。`dsh_status` 只用来看一眼,不用来等待。发到带 Harness 目标的会话的任务会一直等到目标停下(要汇报进度时用 `until` 为 `turn` 和 `every_minutes`)。用 `session_id` 代替 `run_id` 时,不发任何消息,跟进这个会话的 Harness 目标(`until`、`cursor`、`every_minutes`;见“各客户端怎么等待”)。用 `run_ids` 时同时等多个任务,任何一个做完或提问就返回(`ended`、`still_running`) |
256
+ | `dsh_status` | 查看运行进度:状态、最近的文字和工具调用、最终回复;回合结束但子智能体/后台任务还在跑时给出 `waiting_on`(子智能体会一直等到结束;后台任务和提醒在回合结束后最多再等 5 分钟,之后运行算完成,并用 `left_running` 列出还在跑的任务);中途有人在 Harness 界面里发消息时给出 `human_interjections`;被 Harness 重启打断的任务状态为 `interrupted`;以及这次运行发送时用的 `model`。用 `session_id` 代替 `run_id` 时:会话正在做什么、它的 Harness 目标,以及上一回合的回复 |
257
+ | `dsh_wait` | 等运行结束;发消息时带了 `checks` 的,结束后会附上 `evidence`(改了哪些文件、测试结果)(或者等到它停下来问人,见 `dsh_answer`):Codex 每次最多等 3540 秒(它对 dsh-baton 的工具超时减 60 秒;没设时 270 秒),Antigravity 170 秒(它的工具调用超过 3 分钟就会被掐断),其他客户端 50 秒。没做完会带 `timed_out`,只返回状态,再调用一次即可。能在后台等待的客户端改用 `dsh_send` 返回的 `wait_command`;某个任务已经有后台 `wait_command` 在等时,`dsh_wait` 会立即返回(`waiting_in_background`),不再重复等待。`dsh_status` 只用来看一眼,不用来等待。发到带 Harness 目标的会话的任务会一直等到目标停下(要汇报进度时用 `until` 为 `turn` 和 `every_minutes`)。用 `session_id` 代替 `run_id` 时,不发任何消息,跟进这个会话的 Harness 目标(`until`、`cursor`、`every_minutes`;见“各客户端怎么等待”)。用 `run_ids` 时同时等多个任务,任何一个做完或提问就返回(`ended`、`still_running`) |
256
258
  | `dsh_answer` | 把你对运行中途提问的回答发回去(Harness 的 ask_user_question):每道题可以填选项编号或选项文字、自由填写,或者跳过;单选题填了文字就以文字为准。运行一提问,`dsh_wait` 和 `wait_command` 就立刻返回,带上题目(`needs_input`、`question`;Harness 模型推荐的选项在 `harness_suggested`),由主 Agent 问你并把你的回答发回去。你也可以直接在 Harness 窗口里回答,谁先答就算谁的 |
257
259
  | `dsh_session_activity` | Codex 里经 `dsh_call` 调用。对话此刻在做什么:正在跑的回合、子智能体(任意层级)、后台任务;已归档的对话会带 `archived: true` |
258
260
  | `dsh_update_queued` | Codex 里经 `dsh_call` 调用。按 `run_id` 修改还在忙碌对话队列里等待的消息:`edit` 改文字,`remove` 撤回,`steer` 立刻插进正在跑的回合。消息一旦进入对话就改不了了 |
@@ -335,7 +337,7 @@ Harness 插件连不上时:
335
337
 
336
338
  **Codex 里 dsh-baton 的 cwd**。除非那张表里设了 `cwd`,Codex 会在对话所在的文件夹里启动 MCP 服务器;那个文件夹不在了(比如项目在没接上的移动硬盘上),服务器就启动不了,这个对话里也就没有 `dsh_*` 工具。插件会在 `[mcp_servers.dsh-baton]` 里写入 `cwd`(你的主文件夹),已有的表没有这一项时也会补上;你自己设过的 `cwd` 会保留。
337
339
 
338
- **更新不用重启**。新版本装进 `~/.dsh-baton/app` 后(插件更新、`setup` 或手动复制),或者同一版本但文件有改动时,Claude Code、Codex 和 Antigravity 里已经开着的对话,下一次调用 `dsh_*` 工具时就会用上:服务器每次调用前检查这个文件夹,启动新版本,并在这次调用的结果里提示一次已经更新。正在进行的 `dsh_wait` 会先在旧版本里跑完。新版本启动失败时,旧版本继续工作,结果里会说明原因。新版本新增的工具,Claude Code 里马上就能用(服务器会通知客户端工具列表变了);Codex 一直用对话开始时的工具列表,新工具要到下一个新对话才会显示;不过旧对话里也能通过 `dsh_call` 马上用上新功能(更新提示里会写明),已有的工具也会立刻用上新代码。
340
+ **更新不用重启**。新版本装进 `~/.dsh-baton/app` 后(插件更新、`setup`,或手动复制并重写了 `package.json`),或者同一版本但文件有改动、`package.json` 也重新写过时,Claude Code、Codex 和 Antigravity 里已经开着的对话,下一次调用 `dsh_*` 工具时就会用上:服务器每次调用前检查这个文件夹,启动新版本,并在这次调用的结果里提示一次已经更新。正在进行的 `dsh_wait` 会先在旧版本里跑完。新版本启动失败时,旧版本继续工作,结果里会说明原因。新版本新增的工具,Claude Code 里马上就能用(服务器会通知客户端工具列表变了);Codex 一直用对话开始时的工具列表,新工具要到下一个新对话才会显示;不过旧对话里也能通过 `dsh_call` 马上用上新功能(更新提示里会写明),已有的工具也会立刻用上新代码。
339
341
 
340
342
  **`npx -y dsh-baton-mcp setup`** 在终端里做同样的注册:用于插件没能注册的情况,或者从 MCP 目录过来的用户。插件已经注册过时它什么都不改;插件没装的话,它会提示去添加。
341
343
 
@@ -382,7 +384,7 @@ codex mcp add dsh-baton -- "$(command -v node)" "$PWD/dsh-baton/src/server.mjs"
382
384
  </p>
383
385
 
384
386
  <p align="center">
385
- <picture><source media="(prefers-color-scheme: dark)" srcset="./assets/readme/zh/limits-dark.svg"><img src="./assets/readme/zh/limits.svg" width="100%" alt="使用须知:任务进行中在界面里发的话会作为人工插话记到任务上;任务记录在 Harness 重启后还在,被打断的标为 interrupted;Claude Code 只在运行结束时被唤醒一次,Codex 一次调用最多等 59 分钟"></picture>
387
+ <picture><source media="(prefers-color-scheme: dark)" srcset="./assets/readme/zh/limits-dark.svg"><img src="./assets/readme/zh/limits.svg" width="100%" alt="使用须知:任务进行中在界面里发的话会作为人工插话记到任务上;任务记录在 Harness 重启后还在,被打断的标为 interrupted;Claude Code 只在运行结束时被唤醒一次,Codex 每小时一次调用,任务多长都行"></picture>
386
388
  </p>
387
389
 
388
390
  任何能以你的身份运行程序的进程都能通过这个套接字驱动 Harness,这和直接运行 `dsh` 的权限一样。本项目依赖 Harness 的内部服务接口(目前支持 0.2.1 和 0.2.2),Harness 大版本更新后可能需要跟进。
package/WINDOWS.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  dsh-baton runs on Windows 10/11 with the same tools and behaviour as on macOS. This page covers what differs and how to check that everything is connected.
4
4
 
5
- Verified on Windows 11 with DeepSeek Harness 0.2.1-rc.3 (desktop app), Node.js 22.23, the Codex desktop app (codex-cli 0.166) and Claude Code 2.1.
5
+ Verified on Windows 11 with DeepSeek Harness 0.2.1-rc.3 (desktop app), Node.js 22.23, the Codex desktop app (codex-cli 0.166) and Claude Code 2.1; Antigravity with version 2.36.
6
6
 
7
7
  ## What is different on Windows
8
8
 
@@ -24,7 +24,8 @@ Exactly as in the [README](README.md#quick-start): in Harness add the plugin `ds
24
24
 
25
25
  - Switched on, the plugin copies the MCP server to `%USERPROFILE%\.dsh-baton\app` and writes `%USERPROFILE%\.claude.json` and `%USERPROFILE%\.codex\config.toml` with the absolute path of `node.exe` (from `PATH`, `%ProgramFiles%\nodejs` or nvm-windows' `NVM_SYMLINK`). Without Node.js it registers `DeepSeek Harness.exe` itself with `ELECTRON_RUN_AS_NODE=1` (Node mode, no window), so nothing else needs installing, so the desktop apps work even though their `claude.exe` / `codex.exe` are usually not on `PATH`. If it reports that it could not register, run `npx -y dsh-baton-mcp setup` in PowerShell.
26
26
  - Claude Code runs the background `wait_command` in Git Bash.
27
- - Codex waits as on macOS: the plugin writes `tool_timeout_sec = 3600` into `[mcp_servers.dsh-baton]` in `%USERPROFILE%\.codex\config.toml`, so one `dsh_wait` covers a run of up to 59 minutes. Nothing to trust in Codex: **Settings → Hooks** stays empty.
27
+ - Antigravity: when it is installed, the plugin also writes `%USERPROFILE%\.gemini\config\mcp_config.json`. Restart Antigravity once after switching the plugin on. It waits as on macOS: one background `wait_command` that wakes it when the run ends, with no turns spent meanwhile. Where its sandboxed terminal may not open Harness's named pipe, the command follows the run through its record file in `%USERPROFILE%\.dsh-baton\host-runs` instead.
28
+ - Codex waits as on macOS: the plugin writes `tool_timeout_sec = 3600` into `[mcp_servers.dsh-baton]` in `%USERPROFILE%\.codex\config.toml`, so it waits for a run of any length with one `dsh_wait` call an hour. Nothing to trust in Codex: **Settings → Hooks** stays empty.
28
29
  - With the hoisted profile layout, uninstalling a plugin can leave a `node_modules\dsh-baton-host` (or old `dsh-bridge-host`) link in `%USERPROFILE%\.dsh\profiles\desktop`; `setup --remove` deletes it once the profile no longer lists the plugin.
29
30
 
30
31
  ### If the Plugins page cannot uninstall or install it
@@ -97,7 +98,8 @@ The suite runs on Windows with named pipes. Two POSIX-only checks are skipped: f
97
98
  - **套接字改为命名管道。** Windows 上 Node 不能监听 Unix 套接字文件,所以同一路径被映射成按用户区分的命名管道 `\\.\pipe\dsh-baton-<哈希>`。插件和 MCP 两边算法一致,`DSH_BATON_SOCKET` 仍然可用,Harness 退出后管道自动消失。
98
99
  - **headless 用 Harness 自带的 CLI。** Harness ≥ 0.2.1 自带 `resources\runtime\cli\bin\dsh.cmd`;更早的版本只有打包在 `app.asar` 里的 CLI,由 Harness 自己的 exe 以 Node 模式运行。会按顺序自动查找:`DSH_BIN`、`PATH` 里的 `dsh`、默认安装位置,以及注册表里的自定义安装目录。
99
100
  - **安装和 macOS 完全相同。** 在 Harness 插件页添加 `dsh-baton-host` 并启用,详见 [README](README.zh-CN.md#快速上手)。
100
- - **Codex 的等待和 macOS 一样。** 插件在 `%USERPROFILE%\.codex\config.toml` 的 `[mcp_servers.dsh-baton]` 里写入 `tool_timeout_sec = 3600`,一次 `dsh_wait` 就能等完 59 分钟以内的任务。Codex 里不用信任任何东西,**设置 → 钩子** 一直是空的。
101
+ - **Antigravity。** 装了 Antigravity 时,插件还会写 `%USERPROFILE%\.gemini\config\mcp_config.json`,启用插件后重启 Antigravity 一次。等待方式和 macOS 一样:跑一个后台 `wait_command`,任务结束时把它叫醒,等待期间不占轮次。如果它的沙箱终端打不开 Harness 的命名管道,这个命令会改读 `%USERPROFILE%\.dsh-baton\host-runs` 里的运行记录文件。
102
+ - **Codex 的等待和 macOS 一样。** 插件在 `%USERPROFILE%\.codex\config.toml` 的 `[mcp_servers.dsh-baton]` 里写入 `tool_timeout_sec = 3600`,任务多长都能等,每小时只调一次 `dsh_wait`。Codex 里不用信任任何东西,**设置 → 钩子** 一直是空的。
101
103
  - **插件启用时自动注册 MCP。** 它把 MCP 服务器复制到 `%USERPROFILE%\.dsh-baton\app`,再直接写 Claude Code 和 Codex 的用户级配置(用 `PATH`、`%ProgramFiles%\nodejs` 或 nvm-windows 里找到的 `node.exe` 绝对路径;没装 Node.js 时,改用 `DeepSeek Harness.exe` 本身以 Node 模式运行,不弹窗口,不用另外安装任何东西),桌面版的 `claude` / `codex` 不在 `PATH` 里也没关系。之后新开对话就有 `dsh_*` 工具;Codex 每次最多等 270 秒,不用再配超时。没能注册时,在 PowerShell 里运行 `npx -y dsh-baton-mcp setup`。
102
104
  - **插件页卸不掉或装不上时**(`ERR_PNPM_UNEXPECTED_STORE`,或提示"该插件已安装"):是旧版 Harness 装 profile 时用了另一个 pnpm store。一次性修好:从菜单退出 Harness,把 `%USERPROFILE%\.dsh\profiles\desktop\node_modules` 改名备份,用 Harness 自带的 pnpm 运行 `install --frozen-lockfile`(不加 `--store-dir`;`$app` 改成你的安装目录,比如 `E:\Software\DeepSeek Harness`),再启动 Harness,插件页的卸载和添加就正常了;如果插件被关掉了,记得重新打开。
103
105
  - **headless 需要独立凭据。** 要么登录账户,要么设置 `DEEPSEEK_API_KEY`。桌面版里保存的 Key,headless CLI 读不到。
package/host/lib/index.js CHANGED
@@ -28,6 +28,10 @@ const ACTIVITY_MAX_ERRORS = 10
28
28
  // A run taken up after a plugin reload whose message Harness had not admitted yet.
29
29
  const TAKE_UP_RETRY_MS = 3000
30
30
  const takeUpAdmitMs = () => Number(process.env.DSH_BATON_TAKE_UP_ADMIT_MS) || 5 * 60_000
31
+ // How long a run whose own turn ended waits for background jobs or reminders (not sub-agents,
32
+ // which are part of the task) before it completes anyway, saying what is left (left_running).
33
+ // A search over the whole home folder held a reply back for 15 minutes (Mac, 2026-11-22).
34
+ const jobWaitMs = () => Number(process.env.DSH_BATON_JOB_WAIT_MS) || 5 * 60_000
31
35
  const MAX_REQUEST_BYTES = 4 * 1024 * 1024
32
36
  const MAX_WAIT_S = 24 * 3600
33
37
  const MAX_HUMAN_INPUTS = 10
@@ -257,6 +261,7 @@ export function apply(ctx) {
257
261
  ...(run.sender ? { sender: run.sender } : {}),
258
262
  ...(run.model ? { model: run.model } : {}),
259
263
  ...(run.waitingOn ? { waiting_on: run.waitingOn } : {}),
264
+ ...(run.leftRunning ? { left_running: run.leftRunning } : {}),
260
265
  ...(run.supersededBy ? { superseded_by: run.supersededBy } : {}),
261
266
  ...(run.humanInputs?.length ? { human_interjections: run.humanInputs } : {}),
262
267
  ...(run.approvalsAllowed?.length ? { approvals_allowed: run.approvalsAllowed } : {}),
@@ -547,7 +552,12 @@ export function apply(ctx) {
547
552
  // completed one ends it only once the session is quiet (no sub-agents or jobs
548
553
  // left), because Harness wakes the agent again when those report back.
549
554
  const reason = data.reason ?? null
550
- for (const run of receivers) { run.turnEnd = reason; persist(run) }
555
+ for (const run of receivers) {
556
+ // The reply of the run's own turn, kept apart from what later wake-up turns say.
557
+ if (!run.turnEnd && (!reason?.kind || reason.kind === 'completed')) run.turnText = run.finalText ?? null
558
+ run.turnEnd = reason
559
+ persist(run)
560
+ }
551
561
  if (reason?.kind && reason.kind !== 'completed') for (const run of receivers) settle(run, 'failed')
552
562
  else scheduleQuietCheck(session.id, 1000)
553
563
  turns.delete(session.id)
@@ -597,8 +607,16 @@ export function apply(ctx) {
597
607
  // Closed runs: the running turn belongs to a newer run, so only their
598
608
  // background work (sub-agents, jobs, reminders) keeps them open.
599
609
  const background = items.filter((g) => g.kind !== 'turn')
610
+ // Only jobs or reminders left, past the limit since the run's own turn ended: done anyway.
611
+ const outlasted = (run) => {
612
+ if (!background.length || items.some((g) => g.kind === 'turn' || g.kind === 'subagent')) { delete run.jobsSince; return false }
613
+ run.jobsSince ??= Date.now()
614
+ return Date.now() - run.jobsSince >= jobWaitMs()
615
+ }
600
616
  for (const run of receivers.filter((r) => r.outputClosed)) {
601
- if (background.length === 0) settle(run, 'completed', { waitingOn: null, error: null })
617
+ noteWaited(run, background)
618
+ if (background.length === 0) finishQuiet(run)
619
+ else if (outlasted(run)) finishQuiet(run, { leftRunning: summary(background) })
602
620
  else { run.waitingOn = summary(background); persist(run) }
603
621
  }
604
622
  // A run whose own turn has not ended (and that has not seen the agent idle) is not done yet.
@@ -615,14 +633,34 @@ export function apply(ctx) {
615
633
  return
616
634
  }
617
635
  quietSinceBySession.delete(sessionId)
618
- for (const run of open) settle(run, 'completed', { waitingOn: null, error: null })
636
+ for (const run of open) finishQuiet(run)
619
637
  return
620
638
  }
621
639
  quietSinceBySession.delete(sessionId)
622
- for (const run of open) run.waitingOn = items.length ? summary(items) : run.waitingOn
640
+ for (const run of open) noteWaited(run, items)
641
+ const late = open.filter((r) => r.turnEnd && outlasted(r))
642
+ for (const run of late) finishQuiet(run, { leftRunning: summary(background) })
643
+ for (const run of open.filter((r) => !late.includes(r))) run.waitingOn = items.length ? summary(items) : run.waitingOn
623
644
  if (receiversFor(sessionId).length) scheduleQuietCheck(sessionId, 3000)
624
645
  }
625
646
 
647
+ // The kinds of background work a run has waited for, to tell what its later turns are about.
648
+ function noteWaited(run, list) {
649
+ const kinds = list.map((g) => g.kind).filter((k) => k !== 'turn' && !(run.waitedKinds ?? []).includes(k))
650
+ if (kinds.length) run.waitedKinds = [...(run.waitedKinds ?? []), ...kinds]
651
+ }
652
+ // A run that waited for sub-agents ends with their summary turn as its reply. One that waited
653
+ // only for jobs or reminders keeps its own turn's reply, with what the later turns said after it:
654
+ // a turn woken by a job is about that job, and replacing the reply with it lost a whole
655
+ // review (Antigravity, 2026-11-22).
656
+ function finishQuiet(run, extra = {}) {
657
+ const reply = run.turnText
658
+ const later = run.finalText
659
+ const kinds = run.waitedKinds ?? []
660
+ const keep = reply && later && later !== reply && kinds.length && !kinds.includes('subagent')
661
+ settle(run, 'completed', { waitingOn: null, error: null, ...(keep ? { finalText: `${reply}\n\n${later}` } : {}), ...extra })
662
+ }
663
+
626
664
  ctx.effect(() => () => { for (const t of quietTimers.values()) clearTimeout(t) }, 'dsh-baton-host quiet timers')
627
665
 
628
666
  ctx.on('agent/status', guard('agent/status', ({ agent, status }) => {
package/host/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-baton-host",
3
- "version": "0.6.18",
3
+ "version": "0.6.20",
4
4
  "description": "Hand coding tasks from Claude Code, Codex or Antigravity to DeepSeek Harness: they run live in the Harness window and come back with the changed files and test results. 让 Claude Code、Codex 和 Antigravity 把编码任务交给 DeepSeek Harness:在 Harness 窗口里实时跑,做完带着改动文件和测试结果交回。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -24,7 +24,7 @@
24
24
  "docs"
25
25
  ],
26
26
  "dependencies": {
27
- "dsh-baton-mcp": "0.6.18"
27
+ "dsh-baton-mcp": "0.6.20"
28
28
  },
29
29
  "license": "MIT",
30
30
  "dsh": {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "dsh-baton-mcp",
3
- "version": "0.6.18",
3
+ "version": "0.6.20",
4
4
  "mcpName": "io.github.JialaoLiu/dsh-baton",
5
- "description": "Pass the baton from Claude Code, Codex or any MCP client to a local DeepSeek Harness: an MCP server that hands off tasks, continues a specific session, shows the run live in Harness and hands the result back when it is done.",
5
+ "description": "Pass the baton from Claude Code, Codex, Antigravity or any MCP client to a local DeepSeek Harness: an MCP server that hands off tasks, continues a specific session, shows the run live in Harness and hands the result back when it is done.",
6
6
  "type": "module",
7
7
  "bin": {
8
8
  "dsh-baton": "src/cli.mjs",
package/server.json CHANGED
@@ -2,17 +2,17 @@
2
2
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
3
  "name": "io.github.JialaoLiu/dsh-baton",
4
4
  "title": "dsh-baton",
5
- "description": "Hand tasks from Claude Code, Codex or any MCP client to a local DeepSeek Harness.",
5
+ "description": "Hand tasks from Claude Code, Codex, Antigravity or any MCP client to a local DeepSeek Harness.",
6
6
  "repository": {
7
7
  "url": "https://github.com/JialaoLiu/dsh-baton",
8
8
  "source": "github"
9
9
  },
10
- "version": "0.6.18",
10
+ "version": "0.6.20",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "npm",
14
14
  "identifier": "dsh-baton-mcp",
15
- "version": "0.6.18",
15
+ "version": "0.6.20",
16
16
  "transport": {
17
17
  "type": "stdio"
18
18
  }
package/src/cli.mjs CHANGED
@@ -1,11 +1,37 @@
1
1
  #!/usr/bin/env node
2
2
  // Command-line entry. `wait` is meant for an orchestrator that runs it as a
3
3
  // background shell command and is woken up when the command exits.
4
+ import fs from 'node:fs'
4
5
  import path from 'node:path'
5
6
  import * as core from './core.mjs'
6
7
  import { setup, stableNodePath } from './setup.mjs'
7
8
  import { runHook, parseHookInput } from './codex-hook.mjs'
8
9
  import { markWaiting } from './waiters.mjs'
10
+ import { batonHome } from '../host/lib/socket.js'
11
+
12
+ // Wait for a run by reading its record file (<baton home>/host-runs/<run_id>.json, written by
13
+ // the plugin within a second of each change) when this process may not talk to Harness.
14
+ // It ends when the run ends or stops for a person; dsh_wait then gives the full result at once.
15
+ async function waitOnRunFile(runId, total_s) {
16
+ const file = path.join(batonHome(), 'host-runs', `${runId}.json`)
17
+ const end = Date.now() + total_s * 1000
18
+ let rec = null
19
+ while (Date.now() < end) {
20
+ try { rec = JSON.parse(fs.readFileSync(file, 'utf8')) } catch { /* not written yet, or mid-write */ }
21
+ if (rec && !['queued', 'running'].includes(rec.state)) break
22
+ await new Promise((r) => setTimeout(r, 2000))
23
+ }
24
+ if (!rec) return { run_id: runId, state: 'unknown', hint: `No record for ${runId} in ${path.dirname(file)}. Call dsh_wait with this run_id.` }
25
+ const ended = !['queued', 'running'].includes(rec.state)
26
+ return {
27
+ run_id: runId, state: rec.state, session_id: rec.sessionId, timed_out: !ended,
28
+ ...(rec.finalText ? { final_text: rec.finalText } : {}),
29
+ ...(rec.error ? { error: rec.error } : {}),
30
+ hint: !ended ? 'Still running. Run this same wait command again in the background.'
31
+ : rec.state === 'waiting' ? 'The run stopped to ask a person. Call dsh_wait with this run_id: it returns the question at once.'
32
+ : 'The run has ended. Call dsh_wait with this run_id once: it returns at once with the full result (evidence, checks).',
33
+ }
34
+ }
9
35
 
10
36
  const USAGE = `Usage: dsh-baton <command> [args]
11
37
 
@@ -93,7 +119,19 @@ async function main() {
93
119
  markWaiting(rest[0])
94
120
  const total_s = Number(flags.timeout) || 24 * 3600
95
121
  const waitStarted = Date.now()
96
- const st = await core.api.wait({ run_id: rest[0], timeout_s: total_s })
122
+ let st
123
+ try {
124
+ st = await core.api.wait({ run_id: rest[0], timeout_s: total_s })
125
+ } catch (e) {
126
+ // A sandboxed terminal (Antigravity on Windows) may not open Harness's pipe: wait on the
127
+ // run's record file instead, which the plugin keeps up to date.
128
+ if (!['EPERM', 'EACCES'].includes(e?.code)) throw e
129
+ const r = await waitOnRunFile(rest[0], total_s)
130
+ print(r)
131
+ // 0 when a person is needed too, as on the pipe path (a non-zero exit shows as a failure).
132
+ process.exitCode = ['completed', 'waiting'].includes(r.state) ? 0 : 1
133
+ return
134
+ }
97
135
  const stop = core.stopHint(st)
98
136
  // A Harness goal goes on after the run's own round: so does this wait, until the goal
99
137
  // stops (or the next report, with --until turn), with every round since the run began.
@@ -124,6 +162,8 @@ async function main() {
124
162
  ...(st.evidence ? { evidence: st.evidence } : {}),
125
163
  // Approvals this plugin allowed during the run (the plugin page's default): the client says what was let through.
126
164
  ...(st.approvals_allowed?.length ? { approvals_allowed: st.approvals_allowed } : {}),
165
+ // Background work still running when the run completed past the host's limit: the hint names it.
166
+ ...(st.left_running?.length ? { left_running: st.left_running } : {}),
127
167
  ...(st.state === 'completed' ? { hint: core.endedHint(st) } : {}),
128
168
  // Stopped by the user, cancelled, or cut off by a Harness restart: say so, or the client
129
169
  // takes it for a failure in the work and sends it again.
@@ -137,7 +177,17 @@ async function main() {
137
177
  // Until the next report: waits in one call (no hour limit here), so a background
138
178
  // command wakes its client exactly then. --timeout makes it come back sooner.
139
179
  const every_s = everySeconds(flags.every)
140
- const st = core.followResult(await core.followThrough({ session_id: rest[0], until: flags.until ?? 'goal', cursor: flags.cursor, every_s }, { total_s: Number(flags.timeout) || 24 * 3600 }))
180
+ let st
181
+ try {
182
+ st = core.followResult(await core.followThrough({ session_id: rest[0], until: flags.until ?? 'goal', cursor: flags.cursor, every_s }, { total_s: Number(flags.timeout) || 24 * 3600 }))
183
+ } catch (e) {
184
+ // A sandboxed terminal (Antigravity on Windows) may not open Harness's pipe, and the run
185
+ // records do not carry a goal's rounds: dsh_wait, run by the MCP server outside it, can.
186
+ if (!['EPERM', 'EACCES'].includes(e?.code)) throw e
187
+ print({ session_id: rest[0], state: 'unreachable', hint: `This terminal may not open Harness's pipe (${e.code}), so it cannot follow the goal. Call dsh_wait with session_id ${rest[0]}${flags.cursor ? ` and cursor ${flags.cursor}` : ''} instead, and again while it returns timed_out.` })
188
+ process.exitCode = 1
189
+ return
190
+ }
141
191
  const again = st.cursor && ['report', 'following', 'needs_input'].includes(st.state)
142
192
  ? self(`follow ${rest[0]} --until ${st.until} --cursor ${st.cursor}${st.until === 'turn' ? ` --every ${every_s}s` : ''}`)
143
193
  : undefined
package/src/core.mjs CHANGED
@@ -168,11 +168,16 @@ export async function hostAvailable() {
168
168
  const pong = await hostCall('ping', {}, { timeoutMs: 2000 })
169
169
  hostVersion = pong?.version ?? null
170
170
  hostFeatures = Array.isArray(pong?.features) ? pong.features : []
171
+ hostRefused = null
171
172
  return true
172
- } catch {
173
+ } catch (e) {
174
+ hostRefused = ['EPERM', 'EACCES'].includes(e?.code) ? e : null
173
175
  return false
174
176
  }
175
177
  }
178
+ // The pipe is there but this process may not open it (a sandboxed terminal: Antigravity on
179
+ // Windows). Not a closed Harness, so no headless fallback; callers see the code.
180
+ let hostRefused = null
176
181
 
177
182
  export const hostVersionSeen = () => hostVersion
178
183
 
@@ -541,6 +546,7 @@ async function useHost() {
541
546
  const mode = setting('BACKEND') || 'auto'
542
547
  if (mode === 'headless') return false
543
548
  const up = await hostAvailable()
549
+ if (!up && hostRefused) throw hostRefused
544
550
  if (!up && mode === 'host') throw new Error(`dsh-baton-host is not reachable at ${hostSocket()}. Is DeepSeek Harness running with the dsh-baton-host plugin enabled?`)
545
551
  return up
546
552
  }
@@ -573,9 +579,11 @@ const APPROVALS_HINT = (list) => ` dsh-baton allowed ${list.length} approval(s)
573
579
  const WORKTREE_HINT = (trees) => (trees.every((w) => w.changes_in === 'changes')
574
580
  ? ` The session works in a Git worktree (${trees.map((w) => `${w.path}${w.branch ? `, branch ${w.branch}` : ''}`).join('; ')}): evidence.changes and the checks are from that worktree. Merging that branch is the user's call.`
575
581
  : ` The session worked in a new Git worktree (${trees.map((w) => `${w.path}${w.branch ? `, branch ${w.branch}` : ''}`).join('; ')}): its changes are in evidence.worktrees, not evidence.changes, and checks ran in the last one. Merging that branch is the user's call.${trees.some((w) => w.incomplete) ? ' git could not list every change in a worktree marked incomplete: a file missing from its list proves nothing.' : ''}`)
582
+ // A run that completed while a background job of its session still ran (past the host's limit).
583
+ const LEFT_RUNNING_HINT = (left) => ` The run completed while background work it started was still running (left_running: ${left.flatMap((g) => g.labels ?? []).slice(0, 3).join('; ')}): its output is not in final_text. Go on with the reply; only if the task needs that output, look at the session later with dsh_status session_id.`
576
584
  export function endedHint(st) {
577
585
  const checks = st?.evidence?.checks
578
- const shared = (st?.evidence?.same_folder_runs?.length ? SHARED_HINT(st.evidence.same_folder_runs) : '') + (st?.evidence?.changes?.truncated ? TRUNCATED_HINT : '') + (st?.evidence?.worktrees?.length ? WORKTREE_HINT(st.evidence.worktrees) : '') + (st?.approvals_allowed?.length ? APPROVALS_HINT(st.approvals_allowed) : '')
586
+ const shared = (st?.left_running?.length ? LEFT_RUNNING_HINT(st.left_running) : '') + (st?.evidence?.same_folder_runs?.length ? SHARED_HINT(st.evidence.same_folder_runs) : '') + (st?.evidence?.changes?.truncated ? TRUNCATED_HINT : '') + (st?.evidence?.worktrees?.length ? WORKTREE_HINT(st.evidence.worktrees) : '') + (st?.approvals_allowed?.length ? APPROVALS_HINT(st.approvals_allowed) : '')
579
587
  const hint = !checks?.length ? NO_CHECKS_HINT + shared : ENDED_HINT + (checks.some((c) => !c.passed && MISSING_TOOL.test(c.output_tail ?? '')) ? ENV_HINT : '') + shared
580
588
  return st?.goal ? `${goalHint(st.goal, st.session_id)} ${hint}` : hint
581
589
  }
package/src/evidence.mjs CHANGED
@@ -17,6 +17,14 @@ const SKIP_FILES = new Set(['.DS_Store', 'Thumbs.db'])
17
17
  const MAX_ENTRIES = 100_000
18
18
  const MAX_READ = 3000
19
19
  const MAX_TEXT = 512 * 1024
20
+ // Reading is also cut off by time: dsh_send waits for the snapshot, and a slow disk or network
21
+ // folder must not hold it up (the rest keep size and time only).
22
+ const READ_BUDGET_MS = 5000
23
+ // A file whose content is not on this disk: an iCloud Drive (or other cloud) placeholder, with a
24
+ // size but no blocks. Reading it downloads it first, seconds per file: a Desktop folder synced
25
+ // with iCloud held dsh_send for minutes (Mac, 2026-11-22) and pulled the files back down. Such a
26
+ // file is compared by size and time only. Windows reports no blocks, so it is never marked there.
27
+ const notOnDisk = (st) => process.platform !== 'win32' && st.size > 0 && st.blocks === 0
20
28
  const CHECK_TIMEOUT_MS = 120_000
21
29
  const CHECKS_TOTAL_MS = 180_000
22
30
  const TAIL_LINES = 15
@@ -112,7 +120,7 @@ function walk(dir) {
112
120
  if (!e.isFile() || SKIP_FILES.has(e.name)) continue
113
121
  try {
114
122
  const st = fs.statSync(abs)
115
- out.push({ rel: path.relative(dir, abs).split(path.sep).join('/'), abs, m: st.mtimeMs, s: st.size })
123
+ out.push({ rel: path.relative(dir, abs).split(path.sep).join('/'), abs, m: st.mtimeMs, s: st.size, ...(notOnDisk(st) ? { cloud: true } : {}) })
116
124
  } catch { /* gone or unreadable: left out */ }
117
125
  }
118
126
  }
@@ -139,7 +147,11 @@ function snapshot(dir) {
139
147
  const { list, truncated } = walk(dir)
140
148
  const files = {}
141
149
  for (const f of list) files[f.rel] = { m: f.m, s: f.s }
142
- for (const f of [...list].sort((a, b) => b.m - a.m).slice(0, MAX_READ)) Object.assign(files[f.rel], readFile(f.abs, f.s) ?? {})
150
+ const deadline = Date.now() + READ_BUDGET_MS
151
+ for (const f of [...list].filter((x) => !x.cloud).sort((a, b) => b.m - a.m).slice(0, MAX_READ)) {
152
+ if (Date.now() > deadline) break
153
+ Object.assign(files[f.rel], readFile(f.abs, f.s) ?? {})
154
+ }
143
155
  return { files, truncated }
144
156
  }
145
157
 
@@ -239,7 +251,8 @@ export function collect(home, runId) {
239
251
  // At most MAX_READ files are read here too (a run that writes thousands of files gets their
240
252
  // paths, not their line counts).
241
253
  let reads = 0
242
- const read = (f, whole = false) => (reads++ < MAX_READ ? readFile(f.abs, whole ? 0 : f.s) : null)
254
+ const readUntil = Date.now() + READ_BUDGET_MS
255
+ const read = (f, whole = false) => (!f.cloud && reads++ < MAX_READ && Date.now() <= readUntil ? readFile(f.abs, whole ? 0 : f.s) : null)
243
256
  for (const f of after.list) {
244
257
  seen.add(f.rel)
245
258
  const b = before[f.rel]
package/src/mcp.mjs CHANGED
@@ -19,20 +19,28 @@ const int = (description, d) => ({ type: 'integer', description, default: d })
19
19
  // How long one dsh_wait call waits, chosen by the server so it always ends before the
20
20
  // client gives up on the tool call: Codex stops a call after its tool_timeout_sec for
21
21
  // dsh-baton (an hour as dsh-baton registers it; 300 s when unset), so it gets that less
22
- // 60 s, or 270 s; other clients get 50 s (Claude Code waits with wait_command instead).
22
+ // 60 s, or 270 s. Antigravity ends an MCP call after 3 minutes, progress notifications or not
23
+ // (measured with agy 1.5.20 and Gemini 4 Hydrogen on 2026-12-04: 150 s returned, 900 s and
24
+ // 3600 s calls failed with "timed out after 3m0s"; the same limit is built into the
25
+ // Antigravity 2.36 app), so it gets 170 s: at 50 s a half-hour run cost Windows Antigravity
26
+ // users 40+ model turns (issues #2, #3). Other clients get 50 s (Claude Code waits with
27
+ // wait_command instead).
23
28
  // DSH_BATON_WAIT_S overrides it. A timeout_s from the model is ignored, so a model cannot
24
29
  // pick a short wait and poll.
25
30
  const MAX_WAIT_S = 24 * 3600
26
31
  const envWait = Math.floor(Number(core.setting('WAIT_S')))
27
32
  const isCodex = () => core.senderOf(clientName) === 'codex'
33
+ const isAntigravity = () => core.senderOf(clientName) === 'antigravity'
34
+ const AG_WAIT_S = 170
28
35
  // Clients that list the six rarely used tools: Claude Code loads tools on demand and
29
36
  // Antigravity keeps one file per tool, so a model searching its tools finds them. Others
30
37
  // (Codex, with its catalog limit, and any client not known) reach them through dsh_call.
31
38
  const listsHidden = () => ['claude', 'antigravity'].includes(core.senderOf(clientName))
32
39
  // Whether the client may wait with a background command that wakes it when it exits. Not
33
- // Codex (no wake-on-exit), and not Antigravity on Windows: its terminal is sandboxed there and
34
- // may not open Harness's named pipe (EPERM), while this server, started outside it, can.
35
- const backgroundWaits = () => !isCodex() && !(process.platform === 'win32' && core.senderOf(clientName) === 'antigravity')
40
+ // Codex (no wake-on-exit). Antigravity on Windows does too: its sandboxed terminal may not open
41
+ // Harness's named pipe (EPERM), but it can read the run records, and wait_command falls back
42
+ // to them (checked on Windows with Antigravity 2.37 and Gemini 4 Hydrogen, 2026-12-04).
43
+ const backgroundWaits = () => !isCodex()
36
44
  // Claude Code itself (not the Claude desktop chat, claude-ai, which has no shell).
37
45
  const isClaudeCode = () => /^claude-code/i.test(String(clientName ?? ''))
38
46
  let codexTimeout = { mtime: null, value: null }
@@ -70,6 +78,8 @@ const codexStartedAt = () => codexStarted
70
78
  // was loaded, so one open since before the value was written keeps 270 s (see
71
79
  // noteCodexToolTimeout). Without meta (a tool description), the length a new conversation gets.
72
80
  const waitSeconds = (meta) => {
81
+ // Antigravity: never past its 3-minute limit, even when DSH_BATON_WAIT_S asks for more.
82
+ if (isAntigravity()) return envWait >= 1 ? Math.min(envWait, AG_WAIT_S) : AG_WAIT_S
73
83
  if (envWait >= 1) return Math.min(envWait, MAX_WAIT_S)
74
84
  if (!isCodex()) return 50
75
85
  return codexWaitSeconds(codexToolTimeout(), meta === undefined ? undefined : codexConfigReadAt(threadOf(meta), codexStartedAt()))
@@ -389,10 +399,6 @@ const TOOLS = [
389
399
  if (isCodex()) {
390
400
  return { ...st, hint: `Run started. Call dsh_wait with this run_id; it returns when the run ends or stops to ask the user something. ${PARALLEL_HINT} ${GOAL_WAIT_HINT('until turn and every_minutes')} ${NO_POLL} ${codeModeYield()}` }
391
401
  }
392
- // Antigravity on Windows: its terminal may not open Harness's pipe, so it waits with dsh_wait.
393
- if (client === 'antigravity' && !backgroundWaits()) {
394
- return { ...st, hint: `Run started. Call dsh_wait with this run_id; it returns when the run ends or stops to ask the user something (a wait command in Antigravity's terminal cannot reach Harness on Windows). ${PARALLEL_HINT} ${GOAL_WAIT_HINT('until turn and every_minutes')} ${NO_POLL}` }
395
- }
396
402
  // Antigravity runs a terminal command in the background and wakes the model when it
397
403
  // exits, but left to judge that, some models (Sonnet 5.5, Gemini 3.8 Flash) waited with
398
404
  // dsh_wait inside the turn instead: so it is told plainly.
@@ -433,7 +439,7 @@ const TOOLS = [
433
439
  {
434
440
  name: 'dsh_wait',
435
441
  annotations: annotations('Wait for run'),
436
- description: () => `Wait for a run sent with dsh_send to end and return its state and final reply.${backgroundWaits() ? ' Prefer the background wait_command from dsh_send if your client wakes you when a background command exits: it costs no turns. For a run a background wait_command already waits for, dsh_wait returns at once without waiting: do not call it for that run.' : ''} It also returns at once when the run stops to ask a person: needs_input answer (reply with dsh_answer) or harness-ui (an approval in the Harness window). Each call waits up to ${waitSeconds()} s${isCodex() && waitSeconds() > 270 ? ' (270 s in a conversation that was already open when dsh-baton set Codex\'s tool timeout)' : ''}; if it returns timed_out: true, call dsh_wait again with the same run_id, without a progress note. Parallel runs: all ids in run_ids, never one by one; returns once any ends or asks (ended; the rest in still_running); then wait again with the rest plus your fixes. A run in a session with a Harness goal is followed on until the goal stops, with every round since the run began. With session_id instead of run_id it follows that session's Harness goal (see until) without sending anything; it also returns when Harness needs a person or will not go on by itself. Pass back the cursor each result gives.${isCodex() ? ` ${NO_POLL} ${codeModeYield()}` : ''}`,
442
+ description: () => `Wait for a run sent with dsh_send to end and return its state and final reply.${backgroundWaits() ? ' Prefer the background wait_command from dsh_send if your client wakes you when a background command exits: it costs no turns. For a run a background wait_command already waits for, dsh_wait returns at once without waiting: do not call it for that run.' : ''} It also returns at once when the run stops to ask a person: needs_input answer (reply with dsh_answer) or harness-ui (an approval in the Harness window). Each call waits up to ${waitSeconds()} s${isCodex() && waitSeconds() > 270 ? ' (270 s in a conversation that was already open when dsh-baton set Codex\'s tool timeout)' : ''}; if it returns timed_out: true, call dsh_wait again with the same run_id, without a progress note. Parallel runs: all ids in run_ids, never one by one; returns once any ends or asks (ended; the rest in still_running); then wait again with the rest plus your fixes. A run in a session with a Harness goal is followed on until the goal stops, with every round since the run began. With session_id instead of run_id it follows that session's Harness goal (see until) without sending anything; it also returns when Harness needs a person or will not go on by itself. Pass back the cursor each result gives.${isCodex() ? ` ${NO_POLL} ${codeModeYield()}` : isAntigravity() ? ` ${NO_POLL}` : ''}`,
437
443
  inputSchema: {
438
444
  type: 'object', properties: {
439
445
  run_id: str('Run id from dsh_send'),