Merge remote-tracking branch 'origin/master' into xtr/agent-loop-message-machine
# Conflicts: # packages/context/workspace-context/README.md # packages/llm/llm-retry/README.md # packages/session-persistence/session-checkpoint-policy/README.md # scripts/type-equiv.manifest.json
This commit is contained in:
6
packages/subagent/subagent-spawn/README.i18n.yaml
Normal file
6
packages/subagent/subagent-spawn/README.i18n.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
|
||||
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
||||
# after editing either side, bring the other along and re-record with:
|
||||
# pnpm run verify-translation-pairing --write
|
||||
README.md: 868f829edbcfe2eb4d66ccd0ff9988924c70298b
|
||||
README.zh.md: 823291baae0ca09b86565516af1843aff033f354
|
||||
@@ -1,5 +1,7 @@
|
||||
# @deepseek-ai/dsh-subagent-spawn
|
||||
|
||||
English | [中文](README.zh.md)
|
||||
|
||||
The spawn provider creates a fresh child `Agent` in the current process. The child has its own session, sees no parent conversation history, and reuses the host's agent factory and LLM/tool services.
|
||||
|
||||
## Behavior
|
||||
|
||||
56
packages/subagent/subagent-spawn/README.zh.md
Normal file
56
packages/subagent/subagent-spawn/README.zh.md
Normal file
@@ -0,0 +1,56 @@
|
||||
# @deepseek-ai/dsh-subagent-spawn
|
||||
|
||||
[English](README.md) | 中文
|
||||
|
||||
spawn 提供方会在当前进程中创建一个全新的子 `Agent`。子 agent(智能体)有自己的会话,看不到父 agent 的对话历史,并复用宿主的 agent 工厂及 LLM(大语言模型)/工具服务。
|
||||
|
||||
## 行为
|
||||
|
||||
`start(request)` 不提供初始内容,直接委托给 [`startInProcessRun`](../subagent-inprocess/README.md),并在子 agent 发布后才返回。子 agent 获得父 agent 的工作目录/会话谱系,并默认继承父 agent 模型(除非覆盖),但以空对话开始运行。
|
||||
|
||||
共享驱动器负责深度检查、persona 与工具过滤器设置、结构化输出、必需信号取消、单次执行、结果读取和完全停稳后的 dispose(资源释放)。启动失败不会留下已发布的子 agent;提供方插件在完成后卸载,也不会撤销由持有方拥有的运行。
|
||||
|
||||
## 能力
|
||||
|
||||
spawn 声明 `{ outputSchema: true, depthLimit: true, toolFilter: true, persona: true }`,因为它控制子 agent 的创建窗口,能够强制执行全部四项功能。
|
||||
|
||||
## 配置
|
||||
|
||||
| 键 | 含义 |
|
||||
|---|---|
|
||||
| `providerName` | `ctx.subagents` 上的注册表名称(默认 `spawn`)。 |
|
||||
|
||||
## 模型体验
|
||||
|
||||
### 子 agent 请求
|
||||
|
||||
#### 模型看到的内容
|
||||
|
||||
全新的子 agent 逐字接收独立任务内容,默认继承父 agent 的模型和工作区,并看到带有已配置子 agent 作用域 persona 遮蔽的全局提示词。工具过滤器会为该子 agent 移除全局协议 schema、可执行工具查找和 Code Mode SDK 绑定,但保留独立注册的指导内容。它不接收任何父 agent 对话消息;过滤控制的是可见性与组合,并非从父 agent 继承的权限授权。
|
||||
|
||||
#### Token 影响
|
||||
|
||||
子 agent 为全新的独立上下文和历史支付 token 成本;不会复制父 agent 历史 token。persona 会改变该子 agent 的重复提示词成本,过滤则会改变其 schema 或生成 SDK 的成本。
|
||||
|
||||
#### KV Cache 影响
|
||||
|
||||
与父 agent 请求缓存相互独立。子 agent 历史仅追加;persona、工具过滤、生成 SDK、提供方或模型变化会建立不同的子 agent 前缀。
|
||||
|
||||
### 父 agent 工具结果(间接)
|
||||
|
||||
#### 模型看到的内容
|
||||
|
||||
通过 `dsh-tool-subagent`,父 agent 只接收子 agent 的最终输出或结束原因错误。
|
||||
|
||||
#### Token 影响
|
||||
|
||||
父 agent 输入增加一个依赖数据的结果,并保留到上下文压缩(compaction)为止。
|
||||
|
||||
#### KV Cache 影响
|
||||
|
||||
仅追加;新增可见内容位于可复用请求前缀之后,不会使现有 KV-cache 条目失效。
|
||||
|
||||
## 已知限制与延期工作
|
||||
|
||||
- **运行不公开 `sendMessage`/`resume`**:进程内运行不具备这些可选运行时能力。
|
||||
- **全新表示不含父 agent transcript**:子 agent 会继承 cwd、谱系、模型及显式配置的 persona/工具限制,但不继承父 agent 的任何对话;需要已完成轮次上下文时,请使用 fork 提供方。
|
||||
Reference in New Issue
Block a user