提交 DSH 任务
dsh_runSubmits a complete, verifiable work unit to the local DSH backend for asynchronous planning, file edits, and testing, returning a task ID for status polling and result retrieval.
Instructions
把一个可验收的完整工作单元(功能点/bug/测试修复批次/跨文件重构)交给本机 DSH 异步执行,立即返回 task_id。DSH 自己规划并执行多步工具调用(读代码、改文件、跑测试),一次任务应覆盖「实现 + 自测 + 证据」;不要提交单步/逐文件微任务。之后用 dsh_status 长轮询(wait_s 60–120)到终态,dsh_result 取结果;中断用 dsh_cancel。cwd 传当前项目绝对路径。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"task": "<task>"
},
"name": "dsh_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | 任务执行目录(绝对路径);缺省依次用 DSH_MCP_DEFAULT_CWD、worker 进程 cwd | |
| task | Yes | 完整工作单元描述,建议包含:目标、[已定决策]、[待你判断]、范围(可改/不可改、入口文件)、验收命令与期望、证据要求(变更文件+测试结果+风险);给目标与约束,不要写逐步操作清单 | |
| wait_s | No | 可选:提交后在本次调用里等待最多 N 秒(建议 60–120),减少 dsh_status 往返;任务未结束时返回中间状态 | |
| timeout_s | No | 任务超时秒数,默认 900;大任务可设 1800–3600 | |
| session_id | No | 续聊已有 DSH 会话时传入;同一 session 的任务串行执行 | |
| permission_mode | No | 权限模式,默认 auto(worker 按 cwd 能力自动选 workspace-write / danger-full-access) |