@deepseek-ai/dsh-subagent-fork-in-process 0.1.5-rc.2 → 0.1.6-alpha.1
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 +1 -1
- package/README.zh.md +8 -8
- package/package.json +15 -15
package/README.i18n.yaml
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/subagent/subagent-fork-in-process/README.md
|
|
5
5
|
README.md: 0c8ff5372717b26a4e5ee556655094a74c9d6dda
|
|
6
|
-
README.zh.md:
|
|
6
|
+
README.zh.md: c1098825dc0d27f854e7c4d283670d84a507999d
|
package/README.zh.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "面向用户与维护者的进程内 fork subagent 后端说明,用于选择、配置或排查以父级已完成轮次作初始内容的子 agent
|
|
2
|
+
description: "面向用户与维护者的进程内 fork subagent 后端说明,用于选择、配置或排查以父级已完成轮次作初始内容的子 agent(智能体)。"
|
|
3
3
|
kind: "package-reference"
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ kind: "package-reference"
|
|
|
9
9
|
|
|
10
10
|
## 概述
|
|
11
11
|
|
|
12
|
-
`dsh-subagent-fork-in-process` 是一个进程内 subagent 后端:它以父级已完成的对话轮次作为每个子 agent
|
|
12
|
+
`dsh-subagent-fork-in-process` 是一个进程内 subagent 后端:它以父级已完成的对话轮次作为每个子 agent 的初始内容——子 agent 能看到所有已完成轮次,但看不到进行中的轮次,因此后续工作可以在对话基础上继续,而无需重复提供对话内容。委派工具以 `fork` 提供方名称找到它,其行为与 spawn 后端一致,唯一差异是会话初始内容。当子任务延续当前对话时选择它;当子 agent 必须独立运行时选择 spawn。初始内容是 fork 时的一次性快照:此后父级记录的任何内容都不会到达子 agent。
|
|
13
13
|
|
|
14
14
|
## 目录
|
|
15
15
|
|
|
@@ -69,7 +69,7 @@ kind: "package-reference"
|
|
|
69
69
|
|
|
70
70
|
### 设计理念
|
|
71
71
|
|
|
72
|
-
与 spawn 的差异只有一处,且以数据表达:后端计算父级日志的已配平已完成轮次前缀,并把它作为子 agent
|
|
72
|
+
与 spawn 的差异只有一处,且以数据表达:后端计算父级日志的已配平已完成轮次前缀,并把它作为子 agent 的会话初始内容交给共享进程内驱动器。由于实际序号等于数组下标,前缀始终是自序号零开始的合法初始内容;驱动器记录其长度,使结果读取器不会把作为初始内容的父级消息误认为子 agent 输出。
|
|
73
73
|
|
|
74
74
|
### 源码地图
|
|
75
75
|
|
|
@@ -80,11 +80,11 @@ kind: "package-reference"
|
|
|
80
80
|
|
|
81
81
|
### 运行流程
|
|
82
82
|
|
|
83
|
-
`start` 时,从父级事件日志中截取截至最后一个 `turn/end` 的前缀;共享驱动器随后以该初始内容创建子 agent,应用相同的 persona、工具过滤器与结构化输出设置,驱动一项任务,读取子 agent
|
|
83
|
+
`start` 时,从父级事件日志中截取截至最后一个 `turn/end` 的前缀;共享驱动器随后以该初始内容创建子 agent,应用相同的 persona、工具过滤器与结构化输出设置,驱动一项任务,读取子 agent 自身的最终输出,并执行 dispose(资源释放)以等待所有工作完全停稳。该提供方声明 `agentOptions`,以及与 spawn 相同的输出、深度、过滤与 persona 能力。`prepareContinuable` 在创建时只捕获一次前缀,因为该前缀会成为子 agent 自身持久保存的 transcript(文本记录)的一部分。
|
|
84
84
|
|
|
85
85
|
### 生命周期绑定
|
|
86
86
|
|
|
87
|
-
base
|
|
87
|
+
base 组合包与 ACP(Agent Client Protocol)/headless 示例在委派工具上把本提供方绑定为 `backgroundMode: one-shot`,CLI(命令行界面)预设则选择 `continuable`。两者都保留继承的请求前缀:父级与子级获得定义和顺序相同的消息工具,可继续子级的父级 ID 与返回指导位于继承历史之后的初始用户任务中(见[保持 fork 缓存的 Agent Note](../../../.agents/notes/implemented/architecture/2026-08-10-fork-children-stay-one-shot.zh.md))。
|
|
88
88
|
|
|
89
89
|
</details>
|
|
90
90
|
|
|
@@ -119,7 +119,7 @@ fork 会把保留的已完成历史复制到子 agent 的请求中,子 agent
|
|
|
119
119
|
|
|
120
120
|
#### KV Cache 影响
|
|
121
121
|
|
|
122
|
-
在提供方与模型相同的前提下,子 agent 可以复用继承的逐字节相同前缀。persona、工具过滤、生成 SDK 或路由变化可能在继承历史之前使复用失效;后续子 agent
|
|
122
|
+
在提供方与模型相同的前提下,子 agent 可以复用继承的逐字节相同前缀。persona、工具过滤、生成 SDK 或路由变化可能在继承历史之前使复用失效;后续子 agent 历史仅追加。可继续消息不会增加子级专属的系统提示词区段或工具 schema;父级 ID 与返回指导在初始用户任务中位于继承历史之后(见[保持 fork 缓存的 Agent Note](../../../.agents/notes/implemented/architecture/2026-08-10-fork-children-stay-one-shot.zh.md))。
|
|
123
123
|
|
|
124
124
|
### 父级工具结果(间接)
|
|
125
125
|
|
|
@@ -143,8 +143,8 @@ fork 会把保留的已完成历史复制到子 agent 的请求中,子 agent
|
|
|
143
143
|
这些限制说明何时选择该后端是错误的;它们是当前包约束。
|
|
144
144
|
|
|
145
145
|
- **初始内容是一次性快照**——子 agent 只能看到 fork 时父级已完成的轮次,看不到父级此后记录的任何内容;不会实时共享上下文。
|
|
146
|
-
- **fork 生命周期策略因组合而异**——base
|
|
147
|
-
- **随附 fork 工具不公开子级 LLM
|
|
146
|
+
- **fork 生命周期策略因组合而异**——base 组合包与 ACP/headless 示例使用一次性 fork,CLI 预设使用可继续 fork。两者都因父级与子级的消息定义逐字节相同而让继承前缀保持可复用;显式 persona、工具过滤、生成 SDK 或路由变化仍可破坏相等性。理由见[保持 fork 缓存的 Agent Note](../../../.agents/notes/implemented/architecture/2026-08-10-fork-children-stay-one-shot.zh.md)。
|
|
147
|
+
- **随附 fork 工具不公开子级 LLM(大语言模型)路由选择**——它们继承父级提供方与模型,使复制的历史仍有资格复用 KV Cache。在某项改动能保留复用或公开有界重算成本前,路由选择保持禁用;[模型选择路由 Agent Note](../../../.agents/notes/implemented/feature/2026-08-18-model-selected-subagent-routes.zh.md)说明这项限制。
|
|
148
148
|
|
|
149
149
|
<a id="dev-note"></a>
|
|
150
150
|
### 开发备注
|
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.1.
|
|
4
|
+
"version": "0.1.6-alpha.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -27,27 +27,27 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@deepseek-ai/dsh-session": "^0.1.
|
|
31
|
-
"@deepseek-ai/dsh-subagent": "^0.1.
|
|
32
|
-
"@deepseek-ai/dsh-subagent-in-process-driver": "^0.1.
|
|
30
|
+
"@deepseek-ai/dsh-session": "^0.1.6-alpha.1",
|
|
31
|
+
"@deepseek-ai/dsh-subagent": "^0.1.6-alpha.1",
|
|
32
|
+
"@deepseek-ai/dsh-subagent-in-process-driver": "^0.1.6-alpha.1",
|
|
33
33
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
34
|
-
"@deepseek-ai/dsh-agent": "^0.1.
|
|
34
|
+
"@deepseek-ai/dsh-agent": "^0.1.6-alpha.1"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@deepseek-ai/schemastery": "^3.18.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
41
|
-
"@deepseek-ai/dsh-agent": "^0.1.
|
|
42
|
-
"@deepseek-ai/dsh-
|
|
43
|
-
"@deepseek-ai/dsh-agent-loop-testkit": "^0.1.
|
|
44
|
-
"@deepseek-ai/dsh-
|
|
45
|
-
"@deepseek-ai/dsh-
|
|
46
|
-
"@deepseek-ai/dsh-
|
|
47
|
-
"@deepseek-ai/dsh-subagent": "^0.1.
|
|
48
|
-
"@deepseek-ai/dsh-subagent-in-process-driver": "^0.1.
|
|
49
|
-
"@deepseek-ai/dsh-subagent-spawn-in-process": "^0.1.
|
|
41
|
+
"@deepseek-ai/dsh-agent": "^0.1.6-alpha.1",
|
|
42
|
+
"@deepseek-ai/dsh-invariants": "^0.1.6-alpha.1",
|
|
43
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "^0.1.6-alpha.1",
|
|
44
|
+
"@deepseek-ai/dsh-agent-loop": "^0.1.6-alpha.1",
|
|
45
|
+
"@deepseek-ai/dsh-session": "^0.1.6-alpha.1",
|
|
46
|
+
"@deepseek-ai/dsh-llm": "^0.1.6-alpha.1",
|
|
47
|
+
"@deepseek-ai/dsh-subagent": "^0.1.6-alpha.1",
|
|
48
|
+
"@deepseek-ai/dsh-subagent-in-process-driver": "^0.1.6-alpha.1",
|
|
49
|
+
"@deepseek-ai/dsh-subagent-spawn-in-process": "^0.1.6-alpha.1",
|
|
50
50
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
51
|
-
"@deepseek-ai/dsh-session-projection": "^0.1.
|
|
51
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.1"
|
|
52
52
|
}
|
|
53
53
|
}
|