dsh-parallel-tools-prompt 0.2.1-rc.6 → 0.2.2
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 +35 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +9 -7
- package/lib/index.js.map +1 -1
- package/lib/prompt.d.ts +3 -3
- package/lib/prompt.d.ts.map +1 -1
- package/lib/prompt.js +1 -1
- package/lib/prompt.js.map +1 -1
- package/package.json +20 -20
- package/skills/batch-tool-calls/SKILL.md +8 -8
package/README.md
CHANGED
|
@@ -16,9 +16,40 @@
|
|
|
16
16
|
- DAG 仅是内部调度模型,不要求画图、逐轮列计划或添加调度专用轮次;正常的计划、todo 和审批流程仍须遵守。只有一个就绪调用时就单次执行,不凑调用;读后写、共享状态冲突以及由前序结果决定是否/如何执行的操作仍保持顺序。
|
|
17
17
|
- 同轮多个工具调用不代表真正同时执行;执行并发仍由DSH调度器决定。
|
|
18
18
|
|
|
19
|
+
## 提示词设计逻辑
|
|
20
|
+
|
|
21
|
+
### 当前规则:先发现动作,再判断依赖并合批
|
|
22
|
+
|
|
23
|
+
当前两个注入通道共用 [prompt.ts](<src/prompt.ts>) 中的稳定规则,分发的 skill 描述与其完全一致。工具调用前先简短检查:还有哪些有用工作不必等待这些结果、现在就能做?再用 DAG 判断先后关系;它是内部模型,不要求模型输出一张图,也不会创建新的执行器:
|
|
24
|
+
|
|
25
|
+
- **节点**是完成当前子目标有用的工具调用;**边**是必需的前序结果(required results)、执行条件(conditions)、审批(approvals)与共享状态顺序(state ordering),包括先读后改。只有真实前置要求才构成等待理由。
|
|
26
|
+
- **就绪**意味着前置条件已满足、输入参数已知。将当前已知、已就绪、互不依赖且有用的调用在工具与输出限制内同轮发出;拿到结果后重新判断。仅有一个就绪调用时,单调用完全正确,不为凑批量而发明工作。
|
|
27
|
+
- **收集证据与汇总判断分开**:例如独立读取规则、包元数据与 Git 状态,可以一起做;最终发布决策需要三者,不等于这三项读取彼此依赖。相反,`test → failure → fix → retest` 中修复依赖失败信息、复测依赖修复,是合理串行,不应为了提高批量率打断这条调试链。
|
|
28
|
+
- **合批与执行并发分开**:同一响应携带多个调用,目标是减少本可避免的模型往返;工具是否真正同时运行仍取决于 runtime/宿主调度、安全限制与资源情况。合批不保证延迟、tokens 或费用下降。
|
|
29
|
+
- **后台重叠与同轮合批也分开**:后台任务运行期间,不依赖其结果、不会干扰其共享状态的独立工作可以继续。即使前后每轮都只有一个工具调用,实际工作仍可能重叠;应遵守宿主的任务跟踪、结果收集与禁止重复执行规则,而不是重复启动正在运行的工作。
|
|
30
|
+
|
|
31
|
+
`source.kind: parallel-tools-scheduling` 只是 CONTEXT 消息的来源标识和去重依据,不是并发开关。**成功注入 ≠ 模型遵循 ≠ 实际收益**:看到这条消息只能验证接入路径,不能据此判断模型已合批、runtime 已并发,或任务更快更省。
|
|
32
|
+
|
|
33
|
+
### 排查时区分三类情况
|
|
34
|
+
|
|
35
|
+
1. **已就绪但未合批**:模型已知道多个有用且独立的调用,输入也已知,却分到后续响应执行;这是调度提示可以针对的遗漏机会。
|
|
36
|
+
2. **尚未发现其他工作**:当时还没有识别出其他有用动作,不能仅凭事后看到多个调用就断言违反合批规则;需要区分动作发现不足与已知动作的调度不足。
|
|
37
|
+
3. **存在真实依赖**:下一步的参数、是否执行、审批或共享状态顺序取决于前一步;等待是正确行为。不能把所有单调用响应都归为失败。
|
|
38
|
+
|
|
39
|
+
人工观察中,手动以 user 身份重复提醒后,局部调试阶段仍持续单调用。这只是个案:任务依赖、可用动作、模型与上下文都可能影响结果,不能据此证明提示整体无效,也不能断定每次单调用都有必要;应结合原始消息与当时的依赖关系检查,而不是仅凭截图外推收益。
|
|
40
|
+
|
|
41
|
+
### 本次改进(当前源码已启用,效果未证实)
|
|
42
|
+
|
|
43
|
+
本次尚未发布的 `0.2.1-rc.7` 不再仅含文档变更:已将候选措辞落实到两个运行提示通道共用的规则及 skill 描述/正文,**没有改变注入频率、默认开关、生命周期或宿主调度行为**。这是当前源码的默认规则文本,不表示已发布到 npm、已更新运行中的宿主,或已证实有效;加载与历史去重边界仍按上文行为执行。
|
|
44
|
+
|
|
45
|
+
- **动作先行,再检查 DAG**:以 “Before calling tools, briefly check what other useful work can run now without these results.” 开头,先寻找不需要等待当前结果的有用工作,再按结果、条件、审批与状态依赖筛选。它针对可能的动作发现不足,不能承诺找到更多机会。
|
|
46
|
+
- **明确后台非干扰边界**:后台运行时继续不依赖其结果、不干扰其状态的独立工作;遵守宿主任务跟踪与结果收集规则,不忙轮询、不重复运行中或已完成的调用/委派,依赖结果的步骤仍等待。
|
|
47
|
+
- **精简而非叠加长规则**:两个通道与 skill 描述共用完全相同的核心文本(描述不超过 1024 字符),正文展开例子;正面允许真实依赖链与单调用,保留审批、先读后改、共享状态和不凑工作等边界。
|
|
48
|
+
- **不靠加压制造指标**:不增加提醒注入频率,不设最低工具数量,不打印 DAG,不添加调度专用轮次,不通过 shell 包装或 delegation 模拟合批;正常 plan/todo/approval 流程仍保留。收益仍须受控比较验证,实际并发由 runtime 决定。
|
|
49
|
+
|
|
19
50
|
## 版本、依赖与发布
|
|
20
51
|
|
|
21
|
-
插件版本 `0.2.1-rc.
|
|
52
|
+
插件版本 `0.2.1-rc.7` 跟随 DSH 的 `0.2.1` 版本线,RC 序号独立递增,不等于宿主 RC 序号。最低宿主要求 `>=0.2.1-rc.3`,Node.js `>=24.9.0`。开发锁文件以 RC.5 为基线;RC.3 的相关接口已做源码比对,完整插件测试本次运行在 RC.5 依赖上,不冒充两套运行验收。
|
|
22
53
|
|
|
23
54
|
宿主库以 peerDependencies 声明,同时列入 devDependencies 供构建测试:Cordis `4.0.5`、Schemastery `3.18.5`、DSH agent/llm/preset-registry/session-projection/system-prompt 使用 `^0.2.1-rc.3`。不将宿主服务打包为普通运行依赖,避免重复服务身份。semver caret 不跨 `0.3`,也不自动接纳不同版本号的预发布版本。
|
|
24
55
|
|
|
@@ -75,7 +106,9 @@ LLMCompiler收益来自框架与调度;bash-agent历史DAG合并收益是离
|
|
|
75
106
|
|
|
76
107
|
## 评估建议
|
|
77
108
|
|
|
78
|
-
|
|
109
|
+
评估不能只看多调用响应比例或工具调用总数。先按当时可见的信息审查**漏掉的已知、独立、有用且已就绪的机会**,区分尚未发现的动作与真实依赖,并记录是否重复执行已完成或运行中的工作;再比较任务质量/正确率、模型响应与尝试轮次、重试/失败、端到端延迟及输入/输出 tokens(区分已知与未知、缓存与非缓存用量)。后台任务与独立工作的重叠需单独观察,不能用同轮多调用比例替代。
|
|
110
|
+
|
|
111
|
+
固定任务、模型、reasoning、权限、工作目录与工具,做受控配对比较;报告分布、中位数、IQR,单独标记首次提示变化的缓存成本。必须在质量不退化、不增加无用或重复调用的前提下解释轮次与耗时变化;上述是评估方案,不是本版本已经取得收益的声明。
|
|
79
112
|
|
|
80
113
|
离线分析仅对显式指定的日志文件运行,不默认扫描个人会话目录,不输出内容或路径:
|
|
81
114
|
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAKnD,OAAO,CAAC,MAAM,0BAA0B,CAAC;AAKzC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE/G,eAAO,MAAM,IAAI,0BAA0B,CAAC;AAC5C,eAAO,MAAM,MAAM,UAA6C,CAAC;AAEjE,qGAAqG;AACrG,eAAO,MAAM,mBAAmB,8BAA8B,CAAC;AAE/D,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,gBAAgB;QACxB,CAAC,mBAAmB,CAAC,EAAE;YAAE,IAAI,EAAE,OAAO,mBAAmB,CAAC;YAAC,IAAI,EAAE,QAAQ,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC;KAC9F;CACF;AASD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;aAkBjB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AAqD/C,8EAA8E;AAC9E,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAwDxD"}
|
package/lib/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { CONTEXT_REMINDER, PARALLEL_TOOLS_PROMPT, SECTION_NAME, SECTION_ORDER }
|
|
|
4
4
|
import { installPromptDebug } from './debug.js';
|
|
5
5
|
export { BATCH_RULE, CONTEXT_REMINDER, PARALLEL_TOOLS_PROMPT, SECTION_NAME, SECTION_ORDER } from './prompt.js';
|
|
6
6
|
export const name = 'parallel-tools-prompt';
|
|
7
|
-
export const inject = ['agents', 'systemPrompt', '
|
|
7
|
+
export const inject = ['agents', 'systemPrompt', 'agentPresets'];
|
|
8
8
|
/** Source kind of the reminder message; the host renders unknown context kinds as CONTEXT blocks. */
|
|
9
9
|
export const CONTEXT_SOURCE_KIND = 'parallel-tools-scheduling';
|
|
10
10
|
/** True when the session transcript already carries our sourced reminder. */
|
|
@@ -37,15 +37,17 @@ function attach(ctx, agent, config, presetIds, registrations, active) {
|
|
|
37
37
|
if (registrations.has(agent))
|
|
38
38
|
return;
|
|
39
39
|
const { header } = agent.session;
|
|
40
|
-
// Durable child metadata survives resume;
|
|
41
|
-
//
|
|
40
|
+
// Durable child metadata survives resume; every delegated child carries
|
|
41
|
+
// origin/delegationDepth, so this also covers runtime ownership. parentSession
|
|
42
|
+
// is fork lineage, NOT a parent Agent.
|
|
42
43
|
if (header.origin === 'subagent' || (header.delegationDepth ?? 0) > 0)
|
|
43
44
|
return;
|
|
44
|
-
|
|
45
|
+
// Live check only: list() still drops agents whose registration detached.
|
|
46
|
+
if (!ctx.agents.list().includes(agent))
|
|
45
47
|
return;
|
|
46
|
-
const preset = ctx.
|
|
48
|
+
const preset = ctx.agentPresets.presetForSession(agent.session)
|
|
47
49
|
?? header.agentPreset;
|
|
48
|
-
if (preset
|
|
50
|
+
if (preset == null || !presetIds.has(preset))
|
|
49
51
|
return;
|
|
50
52
|
const registration = {};
|
|
51
53
|
// Returning the disposer is essential: ctx.effect does not implicitly adopt
|
|
@@ -125,7 +127,7 @@ export function apply(ctx, config) {
|
|
|
125
127
|
// Runs once at apply/reload time: re-attach to agents that survived the
|
|
126
128
|
// previous instance's disposal. The no-op disposer satisfies the effect
|
|
127
129
|
// contract; per-agent cleanup is owned by each registration instead.
|
|
128
|
-
for (const agent of ctx.agents.
|
|
130
|
+
for (const agent of ctx.agents.list())
|
|
129
131
|
attach(ctx, agent, config, presetIds, registrations, active);
|
|
130
132
|
return () => { };
|
|
131
133
|
});
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,CAAC,MAAM,0BAA0B,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE/G,MAAM,CAAC,MAAM,IAAI,GAAG,uBAAuB,CAAC;AAC5C,MAAM,CAAC,MAAM,MAAM,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E,QAAQ,EAAE,OAAO,EAAE,wCAAwC,EAAE;qBACzG,CAAC,CAAC;aACJ,CAAC;QACJ,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IACxB,CAAC;IAED,GAAG,CAAC,EAAE,CAAC,eAAe,EAAE,CAAC,EAAE,KAAK,EAAE,EAAa,EAAE;QAC/C,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,8EAA8E;IAC9E,8EAA8E;IAC9E,2EAA2E;IAC3E,6DAA6D;IAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE;QACd,wEAAwE;QACxE,wEAAwE;QACxE,qEAAqE;QACrE,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE;YAAE,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;QACpG,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/lib/prompt.d.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
export declare const SECTION_NAME = "parallel-tools:guidance";
|
|
3
3
|
export declare const SECTION_ORDER = 1050;
|
|
4
4
|
/** Shared by both injection channels and the distributed skill description. */
|
|
5
|
-
export declare const BATCH_RULE = "
|
|
5
|
+
export declare const BATCH_RULE = "Before calling tools, briefly check what other useful work can run now without these results. Use an internal dependency DAG for the current subgoal: batch all ready, independent tool calls together in one response, within tool/output limits, with known inputs and prerequisites met. Gather independent evidence together even if later combined. Wait for results that decide whether or how to act, approvals, or shared-state ordering (including read-before-edit). While background work runs, continue work independent of its results and non-interfering with its state. After results, reassess; never repeat running/completed work. Real dependency chains and single calls are valid; never invent work. Use tools as intended, not shell wrappers or delegation to simulate batching. No printed DAG or extra scheduling turns; preserve required plan, todo, and approval workflows. Aim to reduce model round trips; actual concurrency depends on runtime.";
|
|
6
6
|
/** The "Tool-call scheduling:" prefix is the verification marker searched for in system/message. */
|
|
7
|
-
export declare const PARALLEL_TOOLS_PROMPT = "Tool-call scheduling:
|
|
7
|
+
export declare const PARALLEL_TOOLS_PROMPT = "Tool-call scheduling: Before calling tools, briefly check what other useful work can run now without these results. Use an internal dependency DAG for the current subgoal: batch all ready, independent tool calls together in one response, within tool/output limits, with known inputs and prerequisites met. Gather independent evidence together even if later combined. Wait for results that decide whether or how to act, approvals, or shared-state ordering (including read-before-edit). While background work runs, continue work independent of its results and non-interfering with its state. After results, reassess; never repeat running/completed work. Real dependency chains and single calls are valid; never invent work. Use tools as intended, not shell wrappers or delegation to simulate batching. No printed DAG or extra scheduling turns; preserve required plan, todo, and approval workflows. Aim to reduce model round trips; actual concurrency depends on runtime.";
|
|
8
8
|
/** Same rule in the history-backed context channel, without a second policy to maintain. */
|
|
9
|
-
export declare const CONTEXT_REMINDER = "
|
|
9
|
+
export declare const CONTEXT_REMINDER = "Before calling tools, briefly check what other useful work can run now without these results. Use an internal dependency DAG for the current subgoal: batch all ready, independent tool calls together in one response, within tool/output limits, with known inputs and prerequisites met. Gather independent evidence together even if later combined. Wait for results that decide whether or how to act, approvals, or shared-state ordering (including read-before-edit). While background work runs, continue work independent of its results and non-interfering with its state. After results, reassess; never repeat running/completed work. Real dependency chains and single calls are valid; never invent work. Use tools as intended, not shell wrappers or delegation to simulate batching. No printed DAG or extra scheduling turns; preserve required plan, todo, and approval workflows. Aim to reduce model round trips; actual concurrency depends on runtime.";
|
|
10
10
|
//# sourceMappingURL=prompt.d.ts.map
|
package/lib/prompt.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,eAAO,MAAM,YAAY,4BAA4B,CAAC;AACtD,eAAO,MAAM,aAAa,OAAO,CAAC;AAElC,+EAA+E;AAC/E,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,eAAO,MAAM,YAAY,4BAA4B,CAAC;AACtD,eAAO,MAAM,aAAa,OAAO,CAAC;AAElC,+EAA+E;AAC/E,eAAO,MAAM,UAAU,s7BAAs7B,CAAC;AAE98B,oGAAoG;AACpG,eAAO,MAAM,qBAAqB,48BAAwC,CAAC;AAE3E,4FAA4F;AAC5F,eAAO,MAAM,gBAAgB,s7BAAa,CAAC"}
|
package/lib/prompt.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export const SECTION_NAME = 'parallel-tools:guidance';
|
|
3
3
|
export const SECTION_ORDER = 1050;
|
|
4
4
|
/** Shared by both injection channels and the distributed skill description. */
|
|
5
|
-
export const BATCH_RULE = `
|
|
5
|
+
export const BATCH_RULE = `Before calling tools, briefly check what other useful work can run now without these results. Use an internal dependency DAG for the current subgoal: batch all ready, independent tool calls together in one response, within tool/output limits, with known inputs and prerequisites met. Gather independent evidence together even if later combined. Wait for results that decide whether or how to act, approvals, or shared-state ordering (including read-before-edit). While background work runs, continue work independent of its results and non-interfering with its state. After results, reassess; never repeat running/completed work. Real dependency chains and single calls are valid; never invent work. Use tools as intended, not shell wrappers or delegation to simulate batching. No printed DAG or extra scheduling turns; preserve required plan, todo, and approval workflows. Aim to reduce model round trips; actual concurrency depends on runtime.`;
|
|
6
6
|
/** The "Tool-call scheduling:" prefix is the verification marker searched for in system/message. */
|
|
7
7
|
export const PARALLEL_TOOLS_PROMPT = `Tool-call scheduling: ${BATCH_RULE}`;
|
|
8
8
|
/** Same rule in the history-backed context channel, without a second policy to maintain. */
|
package/lib/prompt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,MAAM,CAAC,MAAM,YAAY,GAAG,yBAAyB,CAAC;AACtD,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAElC,+EAA+E;AAC/E,MAAM,CAAC,MAAM,UAAU,GAAG
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,MAAM,CAAC,MAAM,YAAY,GAAG,yBAAyB,CAAC;AACtD,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAElC,+EAA+E;AAC/E,MAAM,CAAC,MAAM,UAAU,GAAG,m7BAAm7B,CAAC;AAE98B,oGAAoG;AACpG,MAAM,CAAC,MAAM,qBAAqB,GAAG,yBAAyB,UAAU,EAAE,CAAC;AAE3E,4FAA4F;AAC5F,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-parallel-tools-prompt",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Plan ready tool-call batches to reduce model round trips in DeepSeek Harness",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"files": ["lib", "locale", "cordis.patch.yml", "README.md", "LICENSE", "skills", "scripts/analyze-session.mjs"],
|
|
28
28
|
"engines": {
|
|
29
29
|
"node": ">=24.9.0",
|
|
30
|
-
"dsh": ">=0.2.
|
|
30
|
+
"dsh": ">=0.2.3-alpha.2"
|
|
31
31
|
},
|
|
32
32
|
"dsh": {
|
|
33
33
|
"bundle": {
|
|
@@ -49,26 +49,26 @@
|
|
|
49
49
|
"prepack": "npm run build"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@deepseek-ai/cordis": "4.0.
|
|
53
|
-
"@deepseek-ai/schemastery": "3.
|
|
54
|
-
"@deepseek-ai/dsh-agent": "
|
|
55
|
-
"@deepseek-ai/dsh-llm": "
|
|
56
|
-
"@deepseek-ai/dsh-agent-preset-registry": "
|
|
57
|
-
"@deepseek-ai/dsh-session-projection": "
|
|
58
|
-
"@deepseek-ai/dsh-system-prompt": "
|
|
52
|
+
"@deepseek-ai/cordis": "4.2.0-alpha.1",
|
|
53
|
+
"@deepseek-ai/schemastery": "3.20.0-alpha.1",
|
|
54
|
+
"@deepseek-ai/dsh-agent": "0.2.3-alpha.2",
|
|
55
|
+
"@deepseek-ai/dsh-llm": "0.2.3-alpha.2",
|
|
56
|
+
"@deepseek-ai/dsh-agent-preset-registry": "0.2.3-alpha.2",
|
|
57
|
+
"@deepseek-ai/dsh-session-projection": "0.2.3-alpha.2",
|
|
58
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.3-alpha.2"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@deepseek-ai/cordis": "4.0.
|
|
62
|
-
"@deepseek-ai/schemastery": "3.
|
|
63
|
-
"@deepseek-ai/dsh-agent": "
|
|
64
|
-
"@deepseek-ai/dsh-llm": "
|
|
65
|
-
"@deepseek-ai/dsh-agent-preset-registry": "
|
|
66
|
-
"@deepseek-ai/dsh-session-projection": "
|
|
67
|
-
"@deepseek-ai/dsh-system-prompt": "
|
|
68
|
-
"@deepseek-ai/dsh-session": "
|
|
69
|
-
"@deepseek-ai/dsh-scope": "
|
|
70
|
-
"@deepseek-ai/cordis-plugin-include": "1.0.
|
|
71
|
-
"@deepseek-ai/cordis-plugin-loader": "1.0.
|
|
61
|
+
"@deepseek-ai/cordis": "4.2.0-alpha.1",
|
|
62
|
+
"@deepseek-ai/schemastery": "3.20.0-alpha.1",
|
|
63
|
+
"@deepseek-ai/dsh-agent": "0.2.3-alpha.2",
|
|
64
|
+
"@deepseek-ai/dsh-llm": "0.2.3-alpha.2",
|
|
65
|
+
"@deepseek-ai/dsh-agent-preset-registry": "0.2.3-alpha.2",
|
|
66
|
+
"@deepseek-ai/dsh-session-projection": "0.2.3-alpha.2",
|
|
67
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.3-alpha.2",
|
|
68
|
+
"@deepseek-ai/dsh-session": "0.2.3-alpha.2",
|
|
69
|
+
"@deepseek-ai/dsh-scope": "0.2.3-alpha.2",
|
|
70
|
+
"@deepseek-ai/cordis-plugin-include": "1.2.0-alpha.1",
|
|
71
|
+
"@deepseek-ai/cordis-plugin-loader": "1.2.0-alpha.1",
|
|
72
72
|
"@types/node": "^24.0.0",
|
|
73
73
|
"@types/js-yaml": "^4.0.9",
|
|
74
74
|
"esbuild": "^0.28.2",
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: batch-tool-calls
|
|
3
|
-
description: "
|
|
3
|
+
description: "Before calling tools, briefly check what other useful work can run now without these results. Use an internal dependency DAG for the current subgoal: batch all ready, independent tool calls together in one response, within tool/output limits, with known inputs and prerequisites met. Gather independent evidence together even if later combined. Wait for results that decide whether or how to act, approvals, or shared-state ordering (including read-before-edit). While background work runs, continue work independent of its results and non-interfering with its state. After results, reassess; never repeat running/completed work. Real dependency chains and single calls are valid; never invent work. Use tools as intended, not shell wrappers or delegation to simulate batching. No printed DAG or extra scheduling turns; preserve required plan, todo, and approval workflows. Aim to reduce model round trips; actual concurrency depends on runtime."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Batch ready tool calls
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Before calling tools, briefly check what other useful work can run now without these results. Then use an internal dependency DAG for the current subgoal: calls are nodes; required results, conditions, approvals, and shared-state ordering are edges.
|
|
9
9
|
|
|
10
|
-
1.
|
|
11
|
-
2.
|
|
12
|
-
3.
|
|
13
|
-
4. Do not
|
|
10
|
+
1. Batch all useful, ready, independent calls in one response when inputs are known and prerequisites are met, within tool/output limits. Collect independent evidence together even if a later decision needs it all.
|
|
11
|
+
2. Wait when a result determines whether or how to act, approval is pending, or shared-state ordering requires it (including read-before-edit). Real dependency chains and single calls are valid; never invent work to fill a batch.
|
|
12
|
+
3. While background work runs, continue useful work that neither needs its results nor interferes with its state. Follow the host's job tracking and result collection rules; do not busy-poll or duplicate running/completed calls or delegations. After results arrive, reassess what is ready.
|
|
13
|
+
4. Use tools as intended, not shell wrappers or delegation solely to simulate batching. Do not print a DAG or add scheduling-only turns; required plan, todo, and approval workflows still apply.
|
|
14
14
|
|
|
15
|
-
For example, read independent files A and B together, then make the decision that needs both. If a search must discover B's path, search first rather than guessing it.
|
|
15
|
+
For example, read independent files A and B together, then make the decision that needs both. If a search must discover B's path, search first rather than guessing it. A test failure must be read before choosing a fix, and the fix must finish before retesting: `test → failure → fix → retest` is a valid serial chain. While tests run in the background, inspect unrelated documentation if useful, but do not edit files those tests depend on or launch the same tests again.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
The aim is fewer avoidable model round trips, not a minimum batch size. Actual concurrency depends on the runtime/host scheduler; batching does not override it or guarantee lower latency, tokens, or cost.
|