@deepseek-ai/dsh-subagent 0.2.3-alpha.1 → 0.2.3-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 +15 -12
- package/README.md +19 -5
- package/README.zh.md +19 -5
- package/lib/index.js +480 -162
- package/lib/typert.host.js +90 -5
- package/lib/typert.remote-client.d.ts +4 -1
- package/lib/typert.remote-client.d.ts.map +1 -1
- package/lib/typert.remote-client.js +57 -2
- package/lib/types/activation.d.ts +31 -4
- package/lib/types/activation.d.ts.map +1 -1
- package/lib/types/activation.js +35 -6
- package/lib/types/activation.js.map +1 -1
- package/lib/types/assistant-output.d.ts +4 -2
- package/lib/types/assistant-output.d.ts.map +1 -1
- package/lib/types/assistant-output.js +8 -8
- package/lib/types/assistant-output.js.map +1 -1
- package/lib/types/child-agent.d.ts +3 -4
- package/lib/types/child-agent.d.ts.map +1 -1
- package/lib/types/child-agent.js +4 -12
- package/lib/types/child-agent.js.map +1 -1
- package/lib/types/control-types.d.ts +26 -2
- package/lib/types/control-types.d.ts.map +1 -1
- package/lib/types/control.d.ts +16 -2
- package/lib/types/control.d.ts.map +1 -1
- package/lib/types/control.js +49 -2
- package/lib/types/control.js.map +1 -1
- package/lib/types/descriptor.d.ts +19 -15
- package/lib/types/descriptor.d.ts.map +1 -1
- package/lib/types/descriptor.js +10 -21
- package/lib/types/descriptor.js.map +1 -1
- package/lib/types/error.d.ts +4 -0
- package/lib/types/error.d.ts.map +1 -1
- package/lib/types/error.js.map +1 -1
- package/lib/types/index.d.ts +30 -2
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +58 -2
- package/lib/types/index.js.map +1 -1
- package/lib/types/lifecycle.d.ts +4 -4
- package/lib/types/lifecycle.d.ts.map +1 -1
- package/lib/types/lifecycle.js +4 -5
- package/lib/types/lifecycle.js.map +1 -1
- package/lib/types/manager.d.ts +38 -3
- package/lib/types/manager.d.ts.map +1 -1
- package/lib/types/manager.js +247 -38
- package/lib/types/manager.js.map +1 -1
- package/lib/types/model-selection.d.ts +22 -0
- package/lib/types/model-selection.d.ts.map +1 -0
- package/lib/types/model-selection.js +39 -0
- package/lib/types/model-selection.js.map +1 -0
- package/lib/types/types.d.ts +3 -3
- package/package.json +54 -54
- package/src/activation.ts +48 -9
- package/src/assistant-output.ts +9 -8
- package/src/child-agent.ts +4 -11
- package/src/control-types.ts +22 -2
- package/src/control.ts +67 -2
- package/src/descriptor.ts +20 -27
- package/src/error.ts +4 -0
- package/src/index.ts +67 -4
- package/src/lifecycle.ts +5 -6
- package/src/manager.ts +238 -34
- package/src/model-selection.ts +52 -0
- package/src/types.ts +3 -3
package/README.i18n.yaml
CHANGED
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
en: 86c982223fab1a3a
|
|
25
25
|
zh: 3d220d8ed84eab9a
|
|
26
26
|
/deepseek-ai-dsh-subagent/use-this-package/activation-capacity:
|
|
27
|
-
en:
|
|
28
|
-
zh:
|
|
27
|
+
en: c332bb705379a510
|
|
28
|
+
zh: 59a12fd0afc74f83
|
|
29
29
|
/deepseek-ai-dsh-subagent/use-this-package/local-and-external-children:
|
|
30
30
|
en: d6eef66bc1d293fe
|
|
31
31
|
zh: e4754d38212c0b2e
|
|
@@ -33,8 +33,11 @@
|
|
|
33
33
|
en: e46a141f9126c45f
|
|
34
34
|
zh: 15f6011c36baa20c
|
|
35
35
|
/deepseek-ai-dsh-subagent/use-this-package/child-presets:
|
|
36
|
-
en:
|
|
37
|
-
zh:
|
|
36
|
+
en: 3486c481e0a21ad6
|
|
37
|
+
zh: e41ad433198c8e90
|
|
38
|
+
/deepseek-ai-dsh-subagent/use-this-package/child-model-choices:
|
|
39
|
+
en: f4dd97ce98cba523
|
|
40
|
+
zh: 21040f0c0777b605
|
|
38
41
|
/deepseek-ai-dsh-subagent/use-this-package/messaging-interrupting-and-discovering:
|
|
39
42
|
en: bf3175c2218a16dd
|
|
40
43
|
zh: 4be9271efe71ddb7
|
|
@@ -48,8 +51,8 @@
|
|
|
48
51
|
en: e6f77fc75a73b0ab
|
|
49
52
|
zh: 7133698a3923e192
|
|
50
53
|
/deepseek-ai-dsh-subagent/understand-the-implementation/source-map:
|
|
51
|
-
en:
|
|
52
|
-
zh:
|
|
54
|
+
en: 17289276ca562fc5
|
|
55
|
+
zh: 510ca9109ec8b95d
|
|
53
56
|
/deepseek-ai-dsh-subagent/understand-the-implementation/provider-preparation-and-structured-output:
|
|
54
57
|
en: 824914462110bcf1
|
|
55
58
|
zh: ae5ce35d09801728
|
|
@@ -57,11 +60,11 @@
|
|
|
57
60
|
en: ba22f6dd5f15f405
|
|
58
61
|
zh: a469c6a4e49adea9
|
|
59
62
|
/deepseek-ai-dsh-subagent/understand-the-implementation/restoring-child-composition:
|
|
60
|
-
en:
|
|
61
|
-
zh:
|
|
63
|
+
en: a8ae8fec313bbf63
|
|
64
|
+
zh: b2711228c67b2885
|
|
62
65
|
/deepseek-ai-dsh-subagent/understand-the-implementation/ownership-and-invariants:
|
|
63
|
-
en:
|
|
64
|
-
zh:
|
|
66
|
+
en: 46ecefd726b0c2f1
|
|
67
|
+
zh: 15c3ee54f2e49add
|
|
65
68
|
/deepseek-ai-dsh-subagent/further-exploration:
|
|
66
69
|
en: 5b0f408dd901d90a
|
|
67
70
|
zh: e11866d5fd878327
|
|
@@ -123,8 +126,8 @@
|
|
|
123
126
|
en: 59e848fca82a46fb
|
|
124
127
|
zh: fcd6a8a2bb58609f
|
|
125
128
|
/deepseek-ai-dsh-subagent/known-limitations-and-deferred-work:
|
|
126
|
-
en:
|
|
127
|
-
zh:
|
|
129
|
+
en: f529f4af8b7ecffd
|
|
130
|
+
zh: a92c6e7215280529
|
|
128
131
|
/deepseek-ai-dsh-subagent/known-limitations-and-deferred-work/dev-note:
|
|
129
132
|
en: 25cc0909348666bb
|
|
130
133
|
zh: 95517f12de100049
|
package/README.md
CHANGED
|
@@ -50,7 +50,7 @@ The limits section on the **Plugins → Subagent** page edits the Host’s `suba
|
|
|
50
50
|
|
|
51
51
|
### Activation capacity
|
|
52
52
|
|
|
53
|
-
Set `maxActiveSubagents` on the host plugin to limit live and materializing children in each subagent tree. It defaults to `8` and accepts positive safe integers. A top-level parent starts a pool shared by its local and external descendants; the root parent consumes no slot. Creation and cold resume reserve before yielding, and disposal returns the slot only after cleanup. Instances with pending inbox work and stopping activations remain counted. Sending to a resident child reuses its slot. Delegation depth is a separate policy.
|
|
53
|
+
Set `maxActiveSubagents` on the host plugin to limit live and materializing children in each subagent tree. It defaults to `8` and accepts positive safe integers. A top-level parent starts a pool shared by its local and external descendants; the root parent consumes no slot. Creation and cold resume reserve before yielding, and disposal returns the slot only after cleanup. A model-selection maintenance restoration reserves none. Instances with pending inbox work and stopping activations remain counted. Sending to a resident child reuses its slot. Delegation depth is a separate policy.
|
|
54
54
|
|
|
55
55
|
Consumers read the current limit through `ctx.subagents.maxActiveSubagents`; admission samples the same value before every new or cold-resumed Activation. Raising it admits more children in existing trees; lowering it leaves resident children running and refuses further admissions until usage is below the limit.
|
|
56
56
|
|
|
@@ -73,7 +73,18 @@ The root is always `lead`. A descendant's full name is the slash-separated path
|
|
|
73
73
|
|
|
74
74
|
### Child presets
|
|
75
75
|
|
|
76
|
-
In-process spawn accepts an independent `agentPreset`; fork and external backends reject this option. Without a selection, a local child joins the parent's current preset revision. An explicit id mounts the currently available revision, even when that id matches the parent's. Configure model choices through [`dsh-tool-subagent`](../tool-subagent/README.md#selecting-a-child-preset) and persona and tools in the [preset composition](../../preset/agent-preset-registry/README.md).
|
|
76
|
+
In-process spawn accepts an independent `agentPreset`; fork and external backends reject this option. Without a selection, a local child joins the parent's current preset revision. An explicit id mounts the currently available revision, even when that id matches the parent's. Configure model choices through [`dsh-tool-subagent`](../tool-subagent/README.md#selecting-a-child-preset) and persona and tools in the [preset composition](../../preset/agent-preset-registry/README.md).
|
|
77
|
+
|
|
78
|
+
<a id="child-model-choices"></a>
|
|
79
|
+
### Child model choices
|
|
80
|
+
|
|
81
|
+
A local child captures its creator's `agent.model.current()` choice once, then applies configured and requested overrides. Changing provider or model without naming an effort uses the selected model's default effort. Creation requires a complete provider/model choice. The manager captures it before asynchronous preparation and validates explicit model overrides before invoking the backend; a rejected override keeps its `LlmError` name, code, and message. Later creator selections do not change the child.
|
|
82
|
+
|
|
83
|
+
Before publication or initial input, the manager appends the descriptor and the child's own `model/selection` after any inherited fork history. The initial choice is recorded even when it equals the creator's choice. Subsequent choices use the child's `agent.model`; the descriptor records no model fields. An already prepared step retains its model, while later steps and cold resume use the child's recorded choice.
|
|
84
|
+
|
|
85
|
+
`selectModel(childId, selection, authority, signal)` validates and records a complete choice for a continuable child. Agent callers need the exact live ancestor authority used for interruption. The remote `selectModelByUser` operation instead requires authorization on the target Session and, like Session model selection, accepts only a model its provider lists in the current catalog. Both require its live tree root, leave user defaults unchanged, and serialize selection with image capability checks through inbox admission. External executions do not support later selection; creation-time `agentOptions` support does not imply this capability. A rejected choice keeps its `LlmError`; `selectModelByUser` reports it as `subagent/model-unavailable` with the LLM message, and reports an unlisted model with the same code.
|
|
86
|
+
|
|
87
|
+
Selecting a cold child's model restores the child for maintenance under its live root, records the choice through the restored Agent, and releases it before returning. The restoration takes no capacity slot, publishes no `subagent/start` or `subagent/end`, sends no completion notice, and refuses manager-routed input. Input sent directly to its Agent while the choice is recorded starts no turn and is canceled with it. If an `agent/created` listener wakes the restored Agent before the choice is recorded, the selection fails with `CONTINUATION_UNAVAILABLE` and the release cancels the started turn. A child with pending input is refused with `CONTINUATION_UNAVAILABLE`, leaving that input to its next execution. A complete new choice also repairs a supported child log with no saved model. Each restoration records the ordinary `session/end-seed` resume marker before the choice. Later continuation restores the saved choice. Success follows the Session durability barrier. Cancellation, stale authority, invalid choices, and unavailable persistence reject the operation. `PERSISTENCE_UNCONFIRMED` (`subagent/model-selection-unconfirmed` remotely) means the choice may have changed without confirmed persistence; reload the child state before retrying.
|
|
77
88
|
|
|
78
89
|
### Messaging, interrupting, and discovering
|
|
79
90
|
|
|
@@ -113,6 +124,7 @@ This section explains how the service is built and where the observable behavior
|
|
|
113
124
|
| [`src/descriptor.ts`](src/descriptor.ts) | Versioned `subagent/descriptor` session-event vocabulary |
|
|
114
125
|
| [`src/catalog.ts`](src/catalog.ts) | Parent-owned `subagent/catalog` event and chunked host projection |
|
|
115
126
|
| [`src/child-agent.ts`](src/child-agent.ts) | Child composition, delegated policy, depth helpers |
|
|
127
|
+
| [`src/model-selection.ts`](src/model-selection.ts) | Initial choice requirements and compatible restoration from the child model projection |
|
|
116
128
|
| [`src/list-children.ts`](src/list-children.ts) | Direct and recursive parent-catalog reads |
|
|
117
129
|
| [`src/control.ts`](src/control.ts) | Browser control request validation and stable failure codes |
|
|
118
130
|
| [`src/control-types.ts`](src/control-types.ts) | Client-safe catalog row, control requests, receipts, and failures |
|
|
@@ -139,14 +151,16 @@ Successful local creation appends a `subagent/catalog` fact to the parent Sessio
|
|
|
139
151
|
|
|
140
152
|
Cold resume mounts the target's saved preset from its `agentPreset` projection or creation header without reading its creator's current composition. A missing or broken saved preset rejects restoration. The original subagent provider need not remain registered.
|
|
141
153
|
|
|
142
|
-
Targets without a saved preset use
|
|
154
|
+
Targets without a saved preset use host composition. Historical descriptors that saved a persona or tool restriction reapply it after preset composition. Persisted permission policies replay from the target's own log. Restoration uses the currently registered preset definition, without preserving an earlier revision across restarts.
|
|
155
|
+
|
|
156
|
+
The restored Agent reads its model from the child's `modelSelection` projection: a pending choice takes precedence over the latest request, and adapter-defaulted effort remains implicit. A historical descriptor that saved an initial route supplies it only when the projection has no model. The fold includes inherited fork history, so an older fork can resume with an inherited parent choice rather than its descriptor model. New children record their own initial choice after inherited history. A child with neither a recorded choice nor a complete saved route is rejected before activation; selecting its model makes it resumable. Restoration never consults the current creator or root model.
|
|
143
157
|
|
|
144
158
|
### Ownership and invariants
|
|
145
159
|
|
|
146
160
|
- **The manager owns accepted work** — unpublished failures roll back; published handles cancel and release only their exact activation. Every instance belongs to the subagent tree root; creation parent ids remain unchanged.
|
|
147
161
|
- **Registration is effect-scoped** — removing a provider blocks new starts but never revokes accepted runs.
|
|
148
162
|
- **Agent-message authority follows the tree** — the exact live sender and target must belong to one root. Cold delivery verifies the target descriptor and creation catalogs before restoring only the target. Final inbox admission rechecks the sender and subagent tree root; failed restoration releases the new instance.
|
|
149
|
-
- **The descriptor is log-only** — a session event absent from model history and retained across compaction; the writer records
|
|
163
|
+
- **The descriptor is log-only** — a session event absent from model history and retained across compaction; the writer records identity and the delegation backend, and model choices belong to the child’s own `model/selection` events. Historical composition fields and one-shot descriptors remain readable.
|
|
150
164
|
- **This runtime answers archive admission for children** ([seam](../../workspace/workspace/README.md)) — activity queries, parent-cause cancellation, and pre-step rejection use managed creation ancestors even after an intermediate creator goes offline. Agents without a published Activation use live header ancestry; ordinary forks remain independent. Labels use the current identity projection's latest descriptor only when it belongs to the child's own log; missing, invalid, inherited, or unlabelled identities report only the id. Reporting requires no Session query service and starts after identity projection registration. Each cancellation failure is contained. The Agent registry owns the parent’s turn, job providers own jobs, and the API Session Controller checks archived Sessions and available header ancestry.
|
|
151
165
|
|
|
152
166
|
</details>
|
|
@@ -252,7 +266,7 @@ These limits define when the seam is a poor fit or needs special operational car
|
|
|
252
266
|
- **External children execute once** — ACP, DSH SDK, Codex, and Claude Code have no local child Session and accept no follow-up input. Their parent-owned records remain discoverable after disposal.
|
|
253
267
|
- **Messaging stays within one tree** — targets must be the root or continuable members. Only the restored target consumes activation capacity. Browser prompts retain their separate human Queue-or-Steer control path.
|
|
254
268
|
- **Wake gap during cancellation convergence** — a follow-up accepted after an interrupt signal but before the Agent becomes idle stays queued until another waking send.
|
|
255
|
-
- **
|
|
269
|
+
- **Parked input retains an Activation** — queued input, including input returned after a failed or stopped pre-step, keeps an idle child and its live ancestors resident until a waking delivery claims it, a queue mutation removes it, or manager teardown discards it. Host completion joins active work, pending child creation, and resource cleanup. A subtree containing only idle parked inboxes can remain resident after host completion.
|
|
256
270
|
- **Process-local residency** — the Activation inbox and ownership graph do not coordinate two harness processes; concurrent access to one persistence store needs a durable mailbox and cross-process lease protocol.
|
|
257
271
|
- **No replay of accepted-but-unlogged messages** — a crash can lose an accepted prompt that never reached the child's session log; the lost message is not replayed automatically.
|
|
258
272
|
- **Lifecycle events are observe-only** — a run-affecting `subagent/end` continuation or decision API waits for a concrete consumer.
|
package/README.zh.md
CHANGED
|
@@ -50,7 +50,7 @@ kind: "package-reference"
|
|
|
50
50
|
|
|
51
51
|
### Activation 容量
|
|
52
52
|
|
|
53
|
-
在 Host 插件上设置 `maxActiveSubagents`,限制每棵 subagent 树中在线和正在创建的子级数量。默认值为 `8
|
|
53
|
+
在 Host 插件上设置 `maxActiveSubagents`,限制每棵 subagent 树中在线和正在创建的子级数量。默认值为 `8`,接受正安全整数。顶层父级建立由本地和外部后代共享的池,根父级不占名额。新建和冷恢复在让出执行前预留名额,资源释放完成后才归还。为选模型进行的维护恢复不预留名额。有待处理收件箱内容以及正在停止的 activation 仍计入容量;向驻留子级发送消息复用其名额。委派深度是独立策略。
|
|
54
54
|
|
|
55
55
|
调用方通过 `ctx.subagents.maxActiveSubagents` 读取当前上限;每次新建或冷恢复 Activation 前,准入也读取同一个值。调高后已有树可接纳更多子代理;调低后驻留子代理继续运行,使用量降至上限以下前拒绝新接纳。
|
|
56
56
|
|
|
@@ -73,7 +73,18 @@ kind: "package-reference"
|
|
|
73
73
|
|
|
74
74
|
### 子级 preset
|
|
75
75
|
|
|
76
|
-
进程内 spawn 接受独立的 `agentPreset`;fork 与外部后端拒绝此选项。省略选择时,本地子级加入父方当前的 preset 代际。显式 id 挂载当前可用代际,即使该 id 与父方相同。通过 [`dsh-tool-subagent`](../tool-subagent/README.zh.md#selecting-a-child-preset) 配置模型可选项,并在 [preset 组装](../../preset/agent-preset-registry/README.zh.md)中配置 persona
|
|
76
|
+
进程内 spawn 接受独立的 `agentPreset`;fork 与外部后端拒绝此选项。省略选择时,本地子级加入父方当前的 preset 代际。显式 id 挂载当前可用代际,即使该 id 与父方相同。通过 [`dsh-tool-subagent`](../tool-subagent/README.zh.md#selecting-a-child-preset) 配置模型可选项,并在 [preset 组装](../../preset/agent-preset-registry/README.zh.md)中配置 persona 与工具。
|
|
77
|
+
|
|
78
|
+
<a id="child-model-choices"></a>
|
|
79
|
+
### 子级模型选择
|
|
80
|
+
|
|
81
|
+
本地子级只捕获一次创建者的 `agent.model.current()` 选择,再应用配置和请求中的覆盖值。更改 provider 或 model 但未指定强度时,使用所选模型的默认强度。创建需要完整的 provider/model 选择。管理器在异步准备前捕获该选择,并在调用后端前校验显式模型覆盖;被拒绝的覆盖保留 `LlmError` 的名称、代码与消息。创建者后续切换不改变子级。
|
|
82
|
+
|
|
83
|
+
在发布或接受初始输入前,管理器在任何继承的 fork 历史之后追加 descriptor 和子级自身的 `model/selection`。即使初始选择与创建者相同,也会记录。后续选择使用子级的 `agent.model`;descriptor 不记录模型字段。已经准备的步骤保持原模型,后续步骤和冷恢复使用子级已记录的选择。
|
|
84
|
+
|
|
85
|
+
`selectModel(childId, selection, authority, signal)` 校验并为可继续子级记录完整选择。Agent 调用方需要与中断相同的确切在线祖先权限;远程 `selectModelByUser` 操作则要求目标 Session 上的授权,并且与 Session 选模一样,只接受提供方在当前目录中列出的模型。两者都要求树根在线、不改变用户默认值,并让选模与从图片能力检查到收件箱准入的过程串行执行。外部执行不支持后续选择;创建时支持 `agentOptions` 不代表具有此能力。被拒绝的选择保留 `LlmError`;`selectModelByUser` 以 `subagent/model-unavailable` 返回,并保留 LLM 消息;未列出的模型也以同一代码返回。
|
|
86
|
+
|
|
87
|
+
为冷子级选模型时,在其在线树根下以维护方式恢复子级,通过恢复出的 Agent 记录选择,并在返回前释放它。这次恢复不占容量,不发布 `subagent/start` 或 `subagent/end`,不发送完成通知,并拒绝经由 manager 投递的输入。记录选择期间直接发给该 Agent 的输入不会开始轮次,并随它一起被取消。如果 `agent/created` 监听器在记录选择之前唤醒了恢复出的 Agent,选择以 `CONTINUATION_UNAVAILABLE` 失败,释放会取消已开始的轮次。有待处理输入的子级会以 `CONTINUATION_UNAVAILABLE` 拒绝,这些输入留给下一次执行。完整的新选择也可以补足受支持子级日志中缺失的模型。每次恢复都会在选择之前记录普通的 `session/end-seed` 恢复标记。后续继续执行恢复已保存的选择。Session 持久化屏障完成后才返回成功。取消、失效权限、无效选择或不可用的持久化服务都会使操作失败。`PERSISTENCE_UNCONFIRMED`(远程为 `subagent/model-selection-unconfirmed`)表示选择可能已改变,但无法确认持久化;重试前应重新加载子级状态。
|
|
77
88
|
|
|
78
89
|
### 消息、中断与发现
|
|
79
90
|
|
|
@@ -113,6 +124,7 @@ kind: "package-reference"
|
|
|
113
124
|
| [`src/descriptor.ts`](src/descriptor.ts) | 版本化的 `subagent/descriptor` 会话事件词汇 |
|
|
114
125
|
| [`src/catalog.ts`](src/catalog.ts) | parent 自有的 `subagent/catalog` 事件与分块 host projection |
|
|
115
126
|
| [`src/child-agent.ts`](src/child-agent.ts) | 子级组装、委派策略、深度辅助函数 |
|
|
127
|
+
| [`src/model-selection.ts`](src/model-selection.ts) | 初始选择要求,以及从子级模型投影兼容恢复 |
|
|
116
128
|
| [`src/list-children.ts`](src/list-children.ts) | 直接与递归的 parent 目录读取 |
|
|
117
129
|
| [`src/control.ts`](src/control.ts) | 浏览器控制请求校验与稳定失败分码 |
|
|
118
130
|
| [`src/control-types.ts`](src/control-types.ts) | client-safe 的目录行、控制面请求、回执与失败 |
|
|
@@ -139,14 +151,16 @@ kind: "package-reference"
|
|
|
139
151
|
|
|
140
152
|
冷恢复从目标的 `agentPreset` 投影或创建 header 读取已保存的 preset 并挂载,不读取创建者当前组装。已保存的 preset 缺失或损坏时拒绝恢复。原始 subagent 提供方不必仍然注册。
|
|
141
153
|
|
|
142
|
-
没有保存 preset
|
|
154
|
+
没有保存 preset 的目标使用宿主组装。保存了 persona 或工具限制的历史 descriptor 在 preset 组装后重新应用它们。持久权限策略从目标自身日志回放。恢复使用当前注册的 preset 定义,不跨重启保留旧代际。
|
|
155
|
+
|
|
156
|
+
恢复的 Agent 从子级的 `modelSelection` 投影读取模型:待生效的选择优先于最近请求,适配器补充的默认强度保持隐式。保存了初始路由的历史 descriptor 仅在投影没有模型时提供该路由。折叠包含继承的 fork 历史,因此旧 fork 可能使用继承的父级选择恢复,而非 descriptor 中的模型。新子级在继承历史后记录自身初始选择。既没有已记录选择、也没有完整已保存路由的子级在激活前被拒绝恢复;为其选择模型后即可恢复。恢复不读取创建者或树根的当前模型。
|
|
143
157
|
|
|
144
158
|
### 所有权与不变式
|
|
145
159
|
|
|
146
160
|
- **管理器拥有已接受工作**——未发布的失败会回滚;已发布句柄仅取消并释放确切 activation。所有实例归 subagent 树根管理;创建父级 id 保持不变。
|
|
147
161
|
- **注册受 effect 作用域约束**——移除提供方会阻止新启动,但绝不撤销已接受的运行。
|
|
148
162
|
- **Agent 消息权限由树决定**——确切在线发送者和目标必须属于同一个根。冷投递验证目标描述符和创建目录后仅恢复目标。最终收件箱准入重新检查发送者与 subagent 树根;恢复失败释放新建实例。
|
|
149
|
-
- **描述符仅进日志**——它是会话事件,不进入模型历史,并跨压缩(compaction
|
|
163
|
+
- **描述符仅进日志**——它是会话事件,不进入模型历史,并跨压缩(compaction)保留;写入器记录身份与委派后端,模型选择属于子级自身的 `model/selection` 事件。历史组装字段与 one-shot 描述符仍可读取。
|
|
150
164
|
- **本 runtime 为子代理回答归档准入**([接缝](../../workspace/workspace/README.zh.md))——活动查询、以父级原因取消和步骤执行前的拒绝都使用托管实例的创建祖先,即使中间创建者已离线。尚无已发布 Activation 的 Agent 使用在线 header 血缘;普通 fork 保持独立。名称取自当前身份投影中的最新 descriptor,且该 descriptor 必须属于孩子自身的日志;身份缺失、无效、来自继承或没有名称时只报告 id。报告不依赖 Session query 服务,并在身份投影注册完成后启用。每次取消的失败都单独收敛。Agent 注册表拥有父级回合,job 提供方拥有任务,API Session Controller 检查已归档 Session 和可用的 header 血缘。
|
|
151
165
|
|
|
152
166
|
</details>
|
|
@@ -252,7 +266,7 @@ You are a delegated subagent: your permission scope was fixed when you were star
|
|
|
252
266
|
- **外部子级执行一次**——ACP、DSH SDK、Codex 与 Claude Code 没有本地子 Session,也不接受后续输入。释放后仍可发现父级拥有的执行记录。
|
|
253
267
|
- **消息限定在一棵树内**——目标必须是根或可继续成员。仅恢复的目标占用激活容量。浏览器提示词保留独立的人类 Queue 或 Steer 控制路径。
|
|
254
268
|
- **取消收敛期间存在唤醒缺口**——中断信号发出后、Agent 进入 idle 前被接受的后续消息会保持排队,直到另一条唤醒发送到达。
|
|
255
|
-
-
|
|
269
|
+
- **停放的输入会保留 Activation**——排队输入(包括 pre-step 失败或停止后放回的输入)会让空闲子级及其在线祖先继续驻留,直到唤醒投递领取输入、队列变更移除输入,或管理器拆除时丢弃输入。宿主完成检查等待活动工作、待创建子级与资源清理。只有空闲停放队列的子树可以在宿主完成后继续驻留。
|
|
256
270
|
- **驻留仅限进程内**——Activation inbox 与所有权图不会在两个 harness 进程之间协调;对单个持久化存储的并发访问需要持久化邮箱与跨进程租约协议。
|
|
257
271
|
- **不回放已接受但未记录的消息**——崩溃可能丢失从未写入子会话日志、已被接受的提示词;丢失的消息不会自动回放。
|
|
258
272
|
- **生命周期事件只供观察**——影响运行的 `subagent/end` 延续或决策接口仍需等待具体消费方。
|