@deepseek-ai/dsh-subagent-fork-in-process 0.2.0-rc.2 → 0.2.1-alpha.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.i18n.yaml +16 -16
- package/README.md +9 -11
- package/README.zh.md +9 -11
- package/lib/index.js +0 -5
- package/package.json +16 -19
package/README.i18n.yaml
CHANGED
|
@@ -27,26 +27,26 @@
|
|
|
27
27
|
en: d6058c358890c64c
|
|
28
28
|
zh: 93f8cc2b60975d42
|
|
29
29
|
/deepseek-ai-dsh-subagent-fork-in-process/use-this-package/what-a-fork-delegation-does:
|
|
30
|
-
en:
|
|
31
|
-
zh:
|
|
30
|
+
en: 461063deda821a1b
|
|
31
|
+
zh: 18d2d41d64884f22
|
|
32
32
|
/deepseek-ai-dsh-subagent-fork-in-process/understand-the-implementation:
|
|
33
33
|
en: 6a0fe4b9cc780aaa
|
|
34
34
|
zh: 50cd69ceb8296827
|
|
35
35
|
/deepseek-ai-dsh-subagent-fork-in-process/understand-the-implementation/design-concept:
|
|
36
|
-
en:
|
|
37
|
-
zh:
|
|
36
|
+
en: 49c8725fee5330ed
|
|
37
|
+
zh: 9050680f2011820a
|
|
38
38
|
/deepseek-ai-dsh-subagent-fork-in-process/understand-the-implementation/source-map:
|
|
39
|
-
en:
|
|
40
|
-
zh:
|
|
39
|
+
en: f1f45255fd9f71c1
|
|
40
|
+
zh: 9a3f016b8fe9754a
|
|
41
41
|
/deepseek-ai-dsh-subagent-fork-in-process/understand-the-implementation/run-flow:
|
|
42
|
-
en:
|
|
43
|
-
zh:
|
|
42
|
+
en: ef063b5c5542e129
|
|
43
|
+
zh: ba564c6b92453b44
|
|
44
44
|
/deepseek-ai-dsh-subagent-fork-in-process/understand-the-implementation/lifecycle-binding:
|
|
45
|
-
en:
|
|
46
|
-
zh:
|
|
45
|
+
en: 8dad0155ed1b32d2
|
|
46
|
+
zh: f4d82d5ede03c4d7
|
|
47
47
|
/deepseek-ai-dsh-subagent-fork-in-process/further-exploration:
|
|
48
|
-
en:
|
|
49
|
-
zh:
|
|
48
|
+
en: 29ea6e0669b665a8
|
|
49
|
+
zh: 46d435e79d356898
|
|
50
50
|
/deepseek-ai-dsh-subagent-fork-in-process/model-experience:
|
|
51
51
|
en: 215e7ba838619b7b
|
|
52
52
|
zh: a311da3843709f90
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
en: 75d061c2151624a7
|
|
67
67
|
zh: 71e58e020b60ff90
|
|
68
68
|
/deepseek-ai-dsh-subagent-fork-in-process/model-experience/parent-tool-result-indirectly/what-the-model-sees:
|
|
69
|
-
en:
|
|
70
|
-
zh:
|
|
69
|
+
en: 54d10ba4da6cdece
|
|
70
|
+
zh: bb9cb4d685098483
|
|
71
71
|
/deepseek-ai-dsh-subagent-fork-in-process/model-experience/parent-tool-result-indirectly/token-effect:
|
|
72
72
|
en: 8c81bab3c5d6a38a
|
|
73
73
|
zh: 44c798432a4bfdfb
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
en: f5d5f97a153f7c70
|
|
76
76
|
zh: 3d6bc05b9eadfbc2
|
|
77
77
|
/deepseek-ai-dsh-subagent-fork-in-process/known-limitations-and-deferred-work:
|
|
78
|
-
en:
|
|
79
|
-
zh:
|
|
78
|
+
en: 6b8bc8825865e662
|
|
79
|
+
zh: 02e075e302d02fb6
|
|
80
80
|
/deepseek-ai-dsh-subagent-fork-in-process/known-limitations-and-deferred-work/dev-note:
|
|
81
81
|
en: e67f633dc6fe7773
|
|
82
82
|
zh: 3bb0c20c93f16f98
|
package/README.md
CHANGED
|
@@ -55,7 +55,7 @@ The generated [configuration catalog](../../../docs/config-catalog.md#deepseek-a
|
|
|
55
55
|
|
|
56
56
|
### What a fork delegation does
|
|
57
57
|
|
|
58
|
-
One tool call
|
|
58
|
+
One tool call creates a background child and returns its session id immediately. The child works in its own session; the parent receives its final answer in a completion notice. The child can also send messages through `send_message`. A rejected start leaves no published child. Programmatic callers such as workflows can await the activation result directly.
|
|
59
59
|
|
|
60
60
|
-----
|
|
61
61
|
|
|
@@ -69,22 +69,21 @@ This section explains the design decisions behind the backend and where the beha
|
|
|
69
69
|
|
|
70
70
|
### Design concept
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
This backend supplies the balanced completed-turn prefix of the parent log as the child session seed. The subagent service records the inherited range so results contain only the child’s own output.
|
|
73
73
|
|
|
74
74
|
### Source map
|
|
75
75
|
|
|
76
76
|
| File | Role |
|
|
77
77
|
|---|---|
|
|
78
78
|
| [`src/index.ts`](src/index.ts) | Provider registration: prefix computation, `Config` schema, capability declaration |
|
|
79
|
-
| — | No runtime invariant companion is published; this package exposes no independent event sequence or mutable data relation beyond contracts enforced at its owning seam. |
|
|
80
79
|
|
|
81
80
|
### Run flow
|
|
82
81
|
|
|
83
|
-
|
|
82
|
+
`prepareContinuable()` captures the parent’s completed-turn prefix once at creation. `startActivation()` creates the child with that seed, and the subagent service applies persona, tool filtering, and structured output for this activation. The provider advertises the same agent options, output, depth, filter, and persona capabilities as spawn.
|
|
84
83
|
|
|
85
84
|
### Lifecycle binding
|
|
86
85
|
|
|
87
|
-
The
|
|
86
|
+
The delegation tool creates a background activation and returns a stable child session id. Parent and child share the same messaging tool definitions and ordering; the parent id and return guidance follow inherited history in the initial task. Workflows await results with caller delivery and send no completion notice to the parent.
|
|
88
87
|
|
|
89
88
|
</details>
|
|
90
89
|
|
|
@@ -93,14 +92,13 @@ The base bundle and ACP/headless examples bind this provider to `backgroundMode:
|
|
|
93
92
|
<a id="further-exploration"></a>
|
|
94
93
|
## Further Exploration
|
|
95
94
|
|
|
96
|
-
Read these pages when the package-level contract is not enough; they move from the shared subagent model to the sibling backends and the design evidence for the
|
|
95
|
+
Read these pages when the package-level contract is not enough; they move from the shared subagent model to the sibling backends and the design evidence for preserving the inherited request prefix.
|
|
97
96
|
|
|
98
97
|
- [Subagent subsystem](../../../docs/subsystems/subagent.md) — start requests, results, provider contract, and in-process depth and seed.
|
|
99
|
-
- [dsh-subagent-in-process-driver](../subagent-in-process-driver/README.md) — the shared run driver this backend calls.
|
|
100
98
|
- [dsh-subagent-spawn-in-process](../subagent-spawn-in-process/README.md) — the fresh-child sibling backend.
|
|
101
99
|
- [dsh-tool-subagent](../tool-subagent/README.md) — the model-facing delegation tool that reaches this provider.
|
|
102
100
|
- [Generated configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-subagent-fork-in-process) — every accepted config field and its source declaration.
|
|
103
|
-
- [
|
|
101
|
+
- [Forked children preserve the parent request prefix](../../../.agents/notes/implemented/architecture/2026-08-10-fork-children-stay-one-shot.md) — why continuable fork preserves the inherited request prefix.
|
|
104
102
|
|
|
105
103
|
-----
|
|
106
104
|
|
|
@@ -125,7 +123,7 @@ The child may reuse the inherited byte-identical prefix under the same provider
|
|
|
125
123
|
|
|
126
124
|
#### What the model sees
|
|
127
125
|
|
|
128
|
-
|
|
126
|
+
Through `dsh-tool-subagent`, the parent first receives the child session id, then a completion notice with its final answer. Child-authored messages arrive through `send_message`; the inherited prefix and internal work remain in the child session.
|
|
129
127
|
|
|
130
128
|
#### Token effect
|
|
131
129
|
|
|
@@ -143,8 +141,8 @@ Append-only; newly visible content follows the reusable request prefix and does
|
|
|
143
141
|
These limits define when the backend is the wrong choice; they are current package constraints.
|
|
144
142
|
|
|
145
143
|
- **The seed is a one-time snapshot** — the child sees the parent's completed turns as of the fork and nothing the parent logs afterwards; there is no live context sharing.
|
|
146
|
-
- **
|
|
147
|
-
- **Shipped fork tools do not expose child LLM route selection** — they inherit the parent's provider and model so the copied history remains eligible for KV Cache reuse. Route selection stays disabled until a change can preserve reuse or expose a bounded recomputation cost
|
|
144
|
+
- **Prefix reuse depends on matching request inputs** — parent and child messaging definitions match byte for byte; explicit persona, tool filtering, generated-SDK, or route changes can still break equality. Rationale: the [cache-preserving fork Agent Note](../../../.agents/notes/implemented/architecture/2026-08-10-fork-children-stay-one-shot.md).
|
|
145
|
+
- **Shipped fork tools do not expose child LLM route selection** — they inherit the parent's provider and model so the copied history remains eligible for KV Cache reuse. Route selection stays disabled until a change can preserve reuse or expose a bounded recomputation cost.
|
|
148
146
|
|
|
149
147
|
<a id="dev-note"></a>
|
|
150
148
|
### Dev Note
|
package/README.zh.md
CHANGED
|
@@ -55,7 +55,7 @@ kind: "package-reference"
|
|
|
55
55
|
|
|
56
56
|
### 一次 fork 委派会做什么
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
一次工具调用创建后台子 agent 并立即返回子会话 ID。子级在自己的会话中工作,父级通过完成通知收到其最终答案。子级也可以通过 `send_message` 发送消息。被拒绝的启动不会留下已发布的子 agent;工作流等程序调用方可以直接等待 activation 的结果。
|
|
59
59
|
|
|
60
60
|
-----
|
|
61
61
|
|
|
@@ -69,22 +69,21 @@ kind: "package-reference"
|
|
|
69
69
|
|
|
70
70
|
### 设计理念
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
本后端把父级日志中已配平的已完成轮次前缀作为子会话初始内容。subagent 服务记录继承范围,因此结果只包含子级自己的输出。
|
|
73
73
|
|
|
74
74
|
### 源码地图
|
|
75
75
|
|
|
76
76
|
| 文件 | 职责 |
|
|
77
77
|
|---|---|
|
|
78
78
|
| [`src/index.ts`](src/index.ts) | 提供方注册:前缀计算、`Config` schema、能力声明 |
|
|
79
|
-
| — | 不发布运行时不变式伴生入口;本包没有独立事件序列或可变数据关系,相关约定在所属 seam 强制执行。 |
|
|
80
79
|
|
|
81
80
|
### 运行流程
|
|
82
81
|
|
|
83
|
-
`
|
|
82
|
+
`prepareContinuable()` 在创建时捕获一次父级已完成轮次前缀。`startActivation()` 以此创建子 agent,并由 subagent 服务应用 persona、工具过滤与本次 activation 的结构化输出设置。提供方声明与 spawn 相同的 `agentOptions`、输出、深度、过滤及 persona 能力。
|
|
84
83
|
|
|
85
84
|
### 生命周期绑定
|
|
86
85
|
|
|
87
|
-
|
|
86
|
+
委派工具以后台 activation 创建子级,并返回稳定的子会话 ID。父级与子级共享相同的消息工具定义及顺序;父级 ID 与返回指导位于继承历史之后的初始任务中。工作流以调用方收集模式等待结果,不向父级发送完成通知。
|
|
88
87
|
|
|
89
88
|
</details>
|
|
90
89
|
|
|
@@ -93,14 +92,13 @@ base 组合包与 ACP(Agent Client Protocol)/headless 示例在委派工具
|
|
|
93
92
|
<a id="further-exploration"></a>
|
|
94
93
|
## 进一步探索
|
|
95
94
|
|
|
96
|
-
当包级约定不够用时阅读以下页面;它们从共享 subagent
|
|
95
|
+
当包级约定不够用时阅读以下页面;它们从共享 subagent 模型进入兄弟后端,以及保留继承请求前缀的设计证据。
|
|
97
96
|
|
|
98
97
|
- [Subagent 子系统](../../../docs/subsystems/subagent.zh.md)——启动请求、结果、提供方约定与进程内深度和初始内容。
|
|
99
|
-
- [dsh-subagent-in-process-driver](../subagent-in-process-driver/README.zh.md)——本后端调用的共享运行驱动器。
|
|
100
98
|
- [dsh-subagent-spawn-in-process](../subagent-spawn-in-process/README.zh.md)——全新子级的兄弟后端。
|
|
101
99
|
- [dsh-tool-subagent](../tool-subagent/README.zh.md)——指向该提供方的面向模型委派工具。
|
|
102
100
|
- [生成配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-subagent-fork-in-process)——每个受支持配置字段及其源声明。
|
|
103
|
-
- [
|
|
101
|
+
- [Fork child 保留 parent 请求前缀](../../../.agents/notes/implemented/architecture/2026-08-10-fork-children-stay-one-shot.zh.md)——可继续 fork 为何保留继承的请求前缀。
|
|
104
102
|
|
|
105
103
|
-----
|
|
106
104
|
|
|
@@ -125,7 +123,7 @@ fork 会把保留的已完成历史复制到子 agent 的请求中,子 agent
|
|
|
125
123
|
|
|
126
124
|
#### 模型看到什么
|
|
127
125
|
|
|
128
|
-
|
|
126
|
+
父级通过 `dsh-tool-subagent` 先收到子会话 ID,随后收到包含最终答案的完成通知。子级自行编写的消息通过 `send_message` 到达;继承的前缀与内部工作保留在子会话中。
|
|
129
127
|
|
|
130
128
|
#### Token 影响
|
|
131
129
|
|
|
@@ -143,8 +141,8 @@ fork 会把保留的已完成历史复制到子 agent 的请求中,子 agent
|
|
|
143
141
|
这些限制说明何时选择该后端是错误的;它们是当前包约束。
|
|
144
142
|
|
|
145
143
|
- **初始内容是一次性快照**——子 agent 只能看到 fork 时父级已完成的轮次,看不到父级此后记录的任何内容;不会实时共享上下文。
|
|
146
|
-
-
|
|
147
|
-
- **随附 fork 工具不公开子级 LLM(大语言模型)路由选择**——它们继承父级提供方与模型,使复制的历史仍有资格复用 KV Cache
|
|
144
|
+
- **前缀复用取决于请求输入是否匹配**——父级与子级的消息定义都逐字节相同;显式 persona、工具过滤、生成 SDK 或路由变化仍可破坏相等性。理由见[保持 fork 缓存的 Agent Note](../../../.agents/notes/implemented/architecture/2026-08-10-fork-children-stay-one-shot.zh.md)。
|
|
145
|
+
- **随附 fork 工具不公开子级 LLM(大语言模型)路由选择**——它们继承父级提供方与模型,使复制的历史仍有资格复用 KV Cache。在某项改动能保留复用或公开有界重算成本前,路由选择保持禁用。
|
|
148
146
|
|
|
149
147
|
<a id="dev-note"></a>
|
|
150
148
|
### 开发备注
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import z from "@deepseek-ai/schemastery";
|
|
2
|
-
import { startInProcessRun } from "@deepseek-ai/dsh-subagent-in-process-driver";
|
|
3
2
|
//#region lib/types/index.js
|
|
4
3
|
/**
|
|
5
4
|
* The in-process FORK subagent backend: registers a {@link SubagentProvider} on
|
|
@@ -45,10 +44,6 @@ var ForkInProcessProvider = class {
|
|
|
45
44
|
constructor(name) {
|
|
46
45
|
this.name = name;
|
|
47
46
|
}
|
|
48
|
-
start(request) {
|
|
49
|
-
const seed = completedTurnPrefix(request.parent);
|
|
50
|
-
return startInProcessRun(request, { ...seed.length > 0 ? { seed } : {} });
|
|
51
|
-
}
|
|
52
47
|
prepareContinuable(request) {
|
|
53
48
|
const seed = completedTurnPrefix(request.parent);
|
|
54
49
|
return Promise.resolve(seed.length > 0 ? { seed } : {});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-subagent-fork-in-process",
|
|
3
3
|
"description": "In-process fork subagent backend: runs a child agent seeded with a prefix of the parent's log",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.1-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -27,27 +27,24 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@deepseek-ai/dsh-agent": "0.2.
|
|
31
|
-
"@deepseek-ai/dsh-session": "0.2.
|
|
32
|
-
"@deepseek-ai/dsh-subagent": "0.2.
|
|
33
|
-
"@deepseek-ai/
|
|
34
|
-
"@deepseek-ai/cordis": "~4.0.4"
|
|
30
|
+
"@deepseek-ai/dsh-agent": "0.2.1-alpha.2",
|
|
31
|
+
"@deepseek-ai/dsh-session": "0.2.1-alpha.2",
|
|
32
|
+
"@deepseek-ai/dsh-subagent": "0.2.1-alpha.2",
|
|
33
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.1"
|
|
35
34
|
},
|
|
36
35
|
"dependencies": {
|
|
37
|
-
"@deepseek-ai/schemastery": "~3.18.
|
|
36
|
+
"@deepseek-ai/schemastery": "~3.18.5-alpha.1"
|
|
38
37
|
},
|
|
39
38
|
"devDependencies": {
|
|
40
|
-
"@deepseek-ai/
|
|
41
|
-
"@deepseek-ai/dsh-agent
|
|
42
|
-
"@deepseek-ai/dsh-
|
|
43
|
-
"@deepseek-ai/
|
|
44
|
-
"@deepseek-ai/dsh-
|
|
45
|
-
"@deepseek-ai/dsh-session": "0.2.
|
|
46
|
-
"@deepseek-ai/dsh-
|
|
47
|
-
"@deepseek-ai/dsh-subagent-in-process
|
|
48
|
-
"@deepseek-ai/
|
|
49
|
-
"@deepseek-ai/dsh-
|
|
50
|
-
"@deepseek-ai/cordis": "~4.0.4",
|
|
51
|
-
"@deepseek-ai/dsh-session-projection": "0.2.0-rc.2"
|
|
39
|
+
"@deepseek-ai/cordis-plugin-loader": "~1.0.6-alpha.1",
|
|
40
|
+
"@deepseek-ai/dsh-agent": "0.2.1-alpha.2",
|
|
41
|
+
"@deepseek-ai/dsh-agent-loop": "0.2.1-alpha.2",
|
|
42
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-alpha.2",
|
|
43
|
+
"@deepseek-ai/dsh-llm": "0.2.1-alpha.2",
|
|
44
|
+
"@deepseek-ai/dsh-session": "0.2.1-alpha.2",
|
|
45
|
+
"@deepseek-ai/dsh-subagent": "0.2.1-alpha.2",
|
|
46
|
+
"@deepseek-ai/dsh-subagent-spawn-in-process": "0.2.1-alpha.2",
|
|
47
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.1",
|
|
48
|
+
"@deepseek-ai/dsh-session-projection": "0.2.1-alpha.2"
|
|
52
49
|
}
|
|
53
50
|
}
|