@deepseek-ai/dsh-subagent-fork-in-process 0.2.1-alpha.2 → 0.2.1-alpha.3
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 +10 -10
- package/README.md +5 -5
- package/README.zh.md +5 -5
- package/lib/index.js +3 -5
- package/locale/en.json +5 -0
- package/locale/zh.json +6 -0
- package/package.json +19 -17
package/README.i18n.yaml
CHANGED
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
en: f1f45255fd9f71c1
|
|
40
40
|
zh: 9a3f016b8fe9754a
|
|
41
41
|
/deepseek-ai-dsh-subagent-fork-in-process/understand-the-implementation/run-flow:
|
|
42
|
-
en:
|
|
43
|
-
zh:
|
|
42
|
+
en: cca92ec964b4314b
|
|
43
|
+
zh: edd8ecd4b59dbe8f
|
|
44
44
|
/deepseek-ai-dsh-subagent-fork-in-process/understand-the-implementation/lifecycle-binding:
|
|
45
45
|
en: 8dad0155ed1b32d2
|
|
46
46
|
zh: f4d82d5ede03c4d7
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
en: 91a5bd22001586e9
|
|
55
55
|
zh: 456e5bf20881a70d
|
|
56
56
|
/deepseek-ai-dsh-subagent-fork-in-process/model-experience/child-agent-history-and-envelope/what-the-model-sees:
|
|
57
|
-
en:
|
|
58
|
-
zh:
|
|
57
|
+
en: d4d51c5937bab67c
|
|
58
|
+
zh: e7c07b5a38d68d8e
|
|
59
59
|
/deepseek-ai-dsh-subagent-fork-in-process/model-experience/child-agent-history-and-envelope/token-effect:
|
|
60
|
-
en:
|
|
61
|
-
zh:
|
|
60
|
+
en: 19b588baaa87126b
|
|
61
|
+
zh: 7010e93bbe7d71ba
|
|
62
62
|
/deepseek-ai-dsh-subagent-fork-in-process/model-experience/child-agent-history-and-envelope/kv-cache-effect:
|
|
63
|
-
en:
|
|
64
|
-
zh:
|
|
63
|
+
en: 1e8f8bbab3052b39
|
|
64
|
+
zh: 1efff4da78d60ef9
|
|
65
65
|
/deepseek-ai-dsh-subagent-fork-in-process/model-experience/parent-tool-result-indirectly:
|
|
66
66
|
en: 75d061c2151624a7
|
|
67
67
|
zh: 71e58e020b60ff90
|
|
@@ -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: 193d3fea02c7ec47
|
|
79
|
+
zh: 8a616bcfb97a99c1
|
|
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
|
@@ -79,7 +79,7 @@ This backend supplies the balanced completed-turn prefix of the parent log as th
|
|
|
79
79
|
|
|
80
80
|
### Run flow
|
|
81
81
|
|
|
82
|
-
`prepareContinuable()` captures the parent’s completed-turn prefix once at creation. `startActivation()` creates the child with that seed, and the subagent service
|
|
82
|
+
`prepareContinuable()` captures the parent’s completed-turn prefix once at creation. `startActivation()` creates the child with that seed, and the subagent service composes the inherited preset and optional structured output. The provider advertises agent options, output, and depth capabilities; independent preset selection is unsupported.
|
|
83
83
|
|
|
84
84
|
### Lifecycle binding
|
|
85
85
|
|
|
@@ -109,15 +109,15 @@ Read these pages when the package-level contract is not enough; they move from t
|
|
|
109
109
|
|
|
110
110
|
#### What the model sees
|
|
111
111
|
|
|
112
|
-
The child receives the parent's balanced completed-turn prefix, then the new task content verbatim.
|
|
112
|
+
The child receives the parent's balanced completed-turn prefix, then the new task content verbatim. It joins the parent's preset revision, which supplies persona and tools. Parent agent-local restrictions are not copied. An optional structured-output request adds a child-only tool; the parent's current in-flight turn is excluded.
|
|
113
113
|
|
|
114
114
|
#### Token effect
|
|
115
115
|
|
|
116
|
-
Forking duplicates retained completed history into the child's request, which then accumulates its own tokens independently. A
|
|
116
|
+
Forking duplicates retained completed history into the child's request, which then accumulates its own tokens independently. A first-turn fork has no inherited history.
|
|
117
117
|
|
|
118
118
|
#### KV Cache effect
|
|
119
119
|
|
|
120
|
-
The child may reuse the inherited byte-identical prefix under the same provider and model.
|
|
120
|
+
The child may reuse the inherited byte-identical prefix under the same provider and model. Structured output, generated-SDK, route changes, or historical descriptor overrides on cold resume can invalidate reuse before inherited history; later child history is append-only. Continuable messaging adds no child-only system-prompt section or tool schema; the parent id and return guidance follow inherited history in the initial user task ([cache-preserving fork Agent Note](../../../.agents/notes/implemented/architecture/2026-08-10-fork-children-stay-one-shot.md)).
|
|
121
121
|
|
|
122
122
|
### Parent tool result, indirectly
|
|
123
123
|
|
|
@@ -141,7 +141,7 @@ Append-only; newly visible content follows the reusable request prefix and does
|
|
|
141
141
|
These limits define when the backend is the wrong choice; they are current package constraints.
|
|
142
142
|
|
|
143
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.
|
|
144
|
-
- **Prefix reuse depends on matching request inputs** — parent and child messaging definitions match byte for byte;
|
|
144
|
+
- **Prefix reuse depends on matching request inputs** — parent and child messaging definitions match byte for byte; structured output, generated-SDK, route changes, or restored historical overrides 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
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.
|
|
146
146
|
|
|
147
147
|
<a id="dev-note"></a>
|
package/README.zh.md
CHANGED
|
@@ -79,7 +79,7 @@ kind: "package-reference"
|
|
|
79
79
|
|
|
80
80
|
### 运行流程
|
|
81
81
|
|
|
82
|
-
`prepareContinuable()` 在创建时捕获一次父级已完成轮次前缀。`startActivation()` 以此创建子 agent
|
|
82
|
+
`prepareContinuable()` 在创建时捕获一次父级已完成轮次前缀。`startActivation()` 以此创建子 agent,由 subagent 服务组装继承的 preset 和可选的结构化输出。提供方声明 agent 选项、输出及深度能力;不支持独立选择 preset。
|
|
83
83
|
|
|
84
84
|
### 生命周期绑定
|
|
85
85
|
|
|
@@ -109,15 +109,15 @@ kind: "package-reference"
|
|
|
109
109
|
|
|
110
110
|
#### 模型看到什么
|
|
111
111
|
|
|
112
|
-
子 agent
|
|
112
|
+
子 agent 先接收由父级已配平的已完成轮次构成的前缀,再逐字接收新的任务内容。它加入父级的 preset 代际,由 preset 提供 persona 和工具。父级 agent 局部限制不会被复制。可选的结构化输出请求会添加仅属于子 agent 的工具;父级当前进行中的轮次会被排除。
|
|
113
113
|
|
|
114
114
|
#### Token 影响
|
|
115
115
|
|
|
116
|
-
fork 会把保留的已完成历史复制到子 agent 的请求中,子 agent 随后独立累积自己的 token
|
|
116
|
+
fork 会把保留的已完成历史复制到子 agent 的请求中,子 agent 随后独立累积自己的 token。首轮 fork 没有继承历史。
|
|
117
117
|
|
|
118
118
|
#### KV Cache 影响
|
|
119
119
|
|
|
120
|
-
在提供方与模型相同的前提下,子 agent
|
|
120
|
+
在提供方与模型相同的前提下,子 agent 可以复用继承的逐字节相同前缀。结构化输出、生成 SDK、路由变化,或冷恢复时的历史 descriptor 覆盖,可能在继承历史之前使复用失效;后续子 agent 历史仅追加。可继续消息不会增加子级专属的系统提示词区段或工具 schema;父级 ID 与返回指导在初始用户任务中位于继承历史之后(见[保持 fork 缓存的 Agent Note](../../../.agents/notes/implemented/architecture/2026-08-10-fork-children-stay-one-shot.zh.md))。
|
|
121
121
|
|
|
122
122
|
### 父级工具结果(间接)
|
|
123
123
|
|
|
@@ -141,7 +141,7 @@ fork 会把保留的已完成历史复制到子 agent 的请求中,子 agent
|
|
|
141
141
|
这些限制说明何时选择该后端是错误的;它们是当前包约束。
|
|
142
142
|
|
|
143
143
|
- **初始内容是一次性快照**——子 agent 只能看到 fork 时父级已完成的轮次,看不到父级此后记录的任何内容;不会实时共享上下文。
|
|
144
|
-
-
|
|
144
|
+
- **前缀复用取决于请求输入是否匹配**——父级与子级的消息定义都逐字节相同;结构化输出、生成 SDK、路由变化或恢复的历史覆盖仍可破坏相等性。理由见[保持 fork 缓存的 Agent Note](../../../.agents/notes/implemented/architecture/2026-08-10-fork-children-stay-one-shot.zh.md)。
|
|
145
145
|
- **随附 fork 工具不公开子级 LLM(大语言模型)路由选择**——它们继承父级提供方与模型,使复制的历史仍有资格复用 KV Cache。在某项改动能保留复用或公开有界重算成本前,路由选择保持禁用。
|
|
146
146
|
|
|
147
147
|
<a id="dev-note"></a>
|
package/lib/index.js
CHANGED
|
@@ -28,17 +28,15 @@ function completedTurnPrefix(parent) {
|
|
|
28
28
|
/**
|
|
29
29
|
* The fork provider. Supports `depthLimit` and `outputSchema` (via the shared
|
|
30
30
|
* in-process structured runtime), `agentOptions` (merged over the parent
|
|
31
|
-
* route)
|
|
32
|
-
* persona section).
|
|
31
|
+
* route). The child inherits its parent's preset composition.
|
|
33
32
|
*/
|
|
34
33
|
var ForkInProcessProvider = class {
|
|
35
34
|
name;
|
|
36
35
|
capabilities = {
|
|
37
36
|
agentOptions: true,
|
|
37
|
+
agentPreset: false,
|
|
38
38
|
outputSchema: true,
|
|
39
|
-
depthLimit: true
|
|
40
|
-
toolFilter: true,
|
|
41
|
-
persona: true
|
|
39
|
+
depthLimit: true
|
|
42
40
|
};
|
|
43
41
|
inheritsParentContext = true;
|
|
44
42
|
constructor(name) {
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
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.1-alpha.
|
|
4
|
+
"version": "0.2.1-alpha.3",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -19,32 +19,34 @@
|
|
|
19
19
|
"default": "./lib/index.js"
|
|
20
20
|
},
|
|
21
21
|
"./src/*": "./src/*",
|
|
22
|
-
"./package.json": "./package.json"
|
|
22
|
+
"./package.json": "./package.json",
|
|
23
|
+
"./locale/*.json": "./locale/*.json"
|
|
23
24
|
},
|
|
24
25
|
"files": [
|
|
26
|
+
"locale/*.json",
|
|
25
27
|
"lib/index.js",
|
|
26
28
|
"lib/types/**/*.d.ts"
|
|
27
29
|
],
|
|
28
30
|
"license": "MIT",
|
|
29
31
|
"peerDependencies": {
|
|
30
|
-
"@deepseek-ai/dsh-agent": "0.2.1-alpha.
|
|
31
|
-
"@deepseek-ai/dsh-session": "0.2.1-alpha.
|
|
32
|
-
"@deepseek-ai/dsh-subagent": "0.2.1-alpha.
|
|
33
|
-
"@deepseek-ai/cordis": "~4.0.5-alpha.
|
|
32
|
+
"@deepseek-ai/dsh-agent": "0.2.1-alpha.3",
|
|
33
|
+
"@deepseek-ai/dsh-session": "0.2.1-alpha.3",
|
|
34
|
+
"@deepseek-ai/dsh-subagent": "0.2.1-alpha.3",
|
|
35
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.2"
|
|
34
36
|
},
|
|
35
37
|
"dependencies": {
|
|
36
|
-
"@deepseek-ai/schemastery": "~3.18.5-alpha.
|
|
38
|
+
"@deepseek-ai/schemastery": "~3.18.5-alpha.2"
|
|
37
39
|
},
|
|
38
40
|
"devDependencies": {
|
|
39
|
-
"@deepseek-ai/cordis-plugin-loader": "~1.0.6-alpha.
|
|
40
|
-
"@deepseek-ai/dsh-agent": "0.2.1-alpha.
|
|
41
|
-
"@deepseek-ai/dsh-agent-loop": "0.2.1-alpha.
|
|
42
|
-
"@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-alpha.
|
|
43
|
-
"@deepseek-ai/dsh-llm": "0.2.1-alpha.
|
|
44
|
-
"@deepseek-ai/dsh-session": "0.2.1-alpha.
|
|
45
|
-
"@deepseek-ai/dsh-subagent": "0.2.1-alpha.
|
|
46
|
-
"@deepseek-ai/dsh-subagent-spawn-in-process": "0.2.1-alpha.
|
|
47
|
-
"@deepseek-ai/cordis": "~4.0.5-alpha.
|
|
48
|
-
"@deepseek-ai/dsh-session-projection": "0.2.1-alpha.
|
|
41
|
+
"@deepseek-ai/cordis-plugin-loader": "~1.0.6-alpha.2",
|
|
42
|
+
"@deepseek-ai/dsh-agent": "0.2.1-alpha.3",
|
|
43
|
+
"@deepseek-ai/dsh-agent-loop": "0.2.1-alpha.3",
|
|
44
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-alpha.3",
|
|
45
|
+
"@deepseek-ai/dsh-llm": "0.2.1-alpha.3",
|
|
46
|
+
"@deepseek-ai/dsh-session": "0.2.1-alpha.3",
|
|
47
|
+
"@deepseek-ai/dsh-subagent": "0.2.1-alpha.3",
|
|
48
|
+
"@deepseek-ai/dsh-subagent-spawn-in-process": "0.2.1-alpha.3",
|
|
49
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.2",
|
|
50
|
+
"@deepseek-ai/dsh-session-projection": "0.2.1-alpha.3"
|
|
49
51
|
}
|
|
50
52
|
}
|