@deepseek-ai/dsh-subagent-codex 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 CHANGED
@@ -9,26 +9,26 @@
9
9
  en: c3f2c833cb91228d
10
10
  zh: 3267d24936c5973f
11
11
  /deepseek-ai-dsh-subagent-codex/summary:
12
- en: 2d790b5830aecb62
13
- zh: 5c59141aec808188
12
+ en: 6eade95bb21eae52
13
+ zh: 72de7d6fcdc0c31a
14
14
  /deepseek-ai-dsh-subagent-codex/table-of-contents:
15
15
  en: d152484eb41ac6b4
16
16
  zh: 09388d293f9be9cb
17
17
  /deepseek-ai-dsh-subagent-codex/use-this-package:
18
- en: b5a419bc17f9938f
19
- zh: d3f864c694dcc3df
18
+ en: 2ac37ff256c2e329
19
+ zh: 95be2a38e7c3d094
20
20
  /deepseek-ai-dsh-subagent-codex/use-this-package/installing-the-bundle:
21
- en: fd1a741f9ef67dd5
22
- zh: 6d4b6129543eeeed
21
+ en: 7740af6d6cb86814
22
+ zh: e5eb3546e160bac8
23
23
  /deepseek-ai-dsh-subagent-codex/use-this-package/configuration:
24
- en: 1b77d332fd04117c
25
- zh: 4271e338b55c3054
24
+ en: b8163849d388478e
25
+ zh: cf74fcaeef62c7ae
26
26
  /deepseek-ai-dsh-subagent-codex/use-this-package/exposing-the-tool:
27
- en: ae49a2c17f98c205
28
- zh: 8cd118bdf4a6ac57
27
+ en: a36399c7ac98724d
28
+ zh: d43815e08689da6b
29
29
  /deepseek-ai-dsh-subagent-codex/use-this-package/what-you-get:
30
- en: d095aece07cf4e43
31
- zh: 124065171903083e
30
+ en: 4b271f17f16fb162
31
+ zh: 154c909023f1366b
32
32
  /deepseek-ai-dsh-subagent-codex/use-this-package/failure-and-recovery:
33
33
  en: 4ffe0312c5a8f722
34
34
  zh: 532a1997e9ae825b
@@ -39,14 +39,14 @@
39
39
  en: 40315dca80a4e688
40
40
  zh: 6b12db5e1037db98
41
41
  /deepseek-ai-dsh-subagent-codex/understand-the-implementation/source-map:
42
- en: ff3ba333a1cbb54e
43
- zh: 1680115a5d1814b7
42
+ en: 36647129f061610f
43
+ zh: 42947c700d1d9202
44
44
  /deepseek-ai-dsh-subagent-codex/understand-the-implementation/run-flow:
45
- en: d330494dbded9388
46
- zh: ab996ff8a2f8b2fa
45
+ en: 19b10ff145644564
46
+ zh: c015d530f1bd227e
47
47
  /deepseek-ai-dsh-subagent-codex/further-exploration:
48
- en: 33987c399020d3c4
49
- zh: e2b658259b97f6c5
48
+ en: e2e35a40060c1ba8
49
+ zh: c1676579ebac7c7f
50
50
  /deepseek-ai-dsh-subagent-codex/model-experience:
51
51
  en: 215e7ba838619b7b
52
52
  zh: a311da3843709f90
@@ -54,8 +54,8 @@
54
54
  en: 1796fa78833bfc2b
55
55
  zh: d925d4c0d6c46552
56
56
  /deepseek-ai-dsh-subagent-codex/model-experience/child-request/what-the-model-sees:
57
- en: eb7be1567ceff373
58
- zh: bec1a36af27bd3e9
57
+ en: 7dd70afca1823730
58
+ zh: 7a07bb554d82c892
59
59
  /deepseek-ai-dsh-subagent-codex/model-experience/child-request/token-effect:
60
60
  en: 7812d203a360434a
61
61
  zh: 52c8b9a0cbfe39c3
@@ -66,17 +66,17 @@
66
66
  en: 4c391bb16e3cd380
67
67
  zh: ab3847efe35fa6dc
68
68
  /deepseek-ai-dsh-subagent-codex/model-experience/parent-scheduling-and-results-indirectly/what-the-model-sees:
69
- en: 2547336cd3ac48d9
70
- zh: 871fba5c3d1e2f98
69
+ en: 18dcb74d6a52e96a
70
+ zh: 068c57f9fd959ecb
71
71
  /deepseek-ai-dsh-subagent-codex/model-experience/parent-scheduling-and-results-indirectly/token-effect:
72
- en: 0bf99fe5b871cb64
73
- zh: 6bb608e9b39ffb5b
72
+ en: 0c436fb0897a6eca
73
+ zh: 7ec0a953d0232af2
74
74
  /deepseek-ai-dsh-subagent-codex/model-experience/parent-scheduling-and-results-indirectly/kv-cache-effect:
75
- en: fdbb7dcbf8b37f2b
76
- zh: c7bcbf1e91ffe1d4
75
+ en: 19f1316ea4bb1bb9
76
+ zh: 181231ddffdc8494
77
77
  /deepseek-ai-dsh-subagent-codex/known-limitations-and-deferred-work:
78
- en: 4716f8c13e7f1f24
79
- zh: ab1e66bc56cde32c
78
+ en: 040fff3c01eae51e
79
+ zh: e37cf7cc47e9a08c
80
80
  /deepseek-ai-dsh-subagent-codex/known-limitations-and-deferred-work/dev-note:
81
- en: 7ab7eb087a0e3abb
82
- zh: 5f3d74e7ad285e36
81
+ en: cacc98025ed8913e
82
+ zh: e7673a3087ec0c62
package/README.md CHANGED
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
9
9
 
10
10
  ## Summary
11
11
 
12
- Install `@deepseek-ai/dsh-subagent-codex` into a Profile when delegated work should run in a genuine, unattended Codex session in the parent Session's workspace. Each delegation uses a fresh isolated Codex thread for one self-contained text task and returns only its final answer or a safe failure diagnostic. Native Codex configuration and authentication remain authoritative, while `permissionMode` selects the non-interactive approval and sandbox behavior. The Bundle supplies a compatible native Codex payload, but it exposes no model capability until a delegation tool is configured.
12
+ Install `@deepseek-ai/dsh-subagent-codex` into a Profile when delegated work should run in a genuine, unattended Codex session in the parent Session's workspace. Each delegation uses a fresh isolated Codex thread for one self-contained text task and returns only its final answer or a safe failure diagnostic. Native Codex configuration and authentication remain authoritative, while `permissionMode` selects the non-interactive approval and sandbox behavior. The Bundle supplies a compatible native Codex payload and adds its delegation tool as a global tool.
13
13
 
14
14
  ## Table of Contents
15
15
 
@@ -25,19 +25,15 @@ Install `@deepseek-ai/dsh-subagent-codex` into a Profile when delegated work sho
25
25
  <a id="use-this-package"></a>
26
26
  ## Use this package
27
27
 
28
- Mount this provider when a delegation should run as a real Codex session in the parent's workspace. The common path is explicit: install the Bundle into a Profile, optionally configure the provider row, and expose it to the model through a delegation tool row.
28
+ Enable **Codex subagent** in the Web or Desktop Plugins page when a task needs a fresh native Codex session in the parent workspace.
29
29
 
30
30
  ### Installing the Bundle
31
31
 
32
- Install the package into the target Profile, then restart that Profile. The installation brings the official wrapper and one compatible native platform payload into the Profile; the declared patch layer registers only the dormant provider and starts no Codex process.
32
+ The Official entry is visible offline. Enabling it installs the [target for the running DSH installation](../../boot/plugin-manager/README.md#use-this-package) through the ordinary bundle installer and selects its profile layer. The layer registers the provider and adds `subagent_codex` to every Agent as a global tool; it starts no native process until delegation. Restart when the installer reports that one is required.
33
33
 
34
- ```sh
35
- dsh plugin --profile <name> add @deepseek-ai/dsh-subagent-codex
36
- dsh plugin --profile <name> remove @deepseek-ai/dsh-subagent-codex
37
- dsh --profile <name>
38
- ```
34
+ Switching Off deselects the layer and leaves the package installed. Remove is a separate package operation. Enabling or switching Off registers or removes the global tool in the running Host, so live Agents see the change on their next request.
39
35
 
40
- Removing the package withdraws the provider and its private runtime closure on the next Profile start. Installation controls Host availability, not model permission: the model can only reach the provider through a delegation tool row you compose.
36
+ The layer inserts Host rows only, so any profile can select it, including the shipped headless, SDK, and ACP profiles. Existing provider-only consumers follow the [upgrade guide](../../../docs/upgrade-guide/v0.2.1-alpha.1/native-subagent-bundle-tools/guide.md).
41
37
 
42
38
  ### Configuration
43
39
 
@@ -57,29 +53,28 @@ Removing the package withdraws the provider and its private runtime closure on t
57
53
 
58
54
  The generated [configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-subagent-codex) is the exhaustive source for every accepted field and its JSDoc. A configured `model` passes unchanged on each ephemeral `thread/start`; omission leaves native model selection in force. The provider does not discover models, rewrite aliases, select `modelProvider` or `serviceTier`, or set a fallback. Credential-shaped ambient variables are removed before the explicit `env` overlay, so an API key intended for the child must be supplied there.
59
55
 
56
+ <a id="exposing-the-tool"></a>
60
57
  ### Exposing the tool
61
58
 
62
- Each delegation tool row names one provider and needs its own `toolName`, so the model sees static tools rather than a dynamic provider selector. Full Agent Presets carry a matching default tool row with `disabled: true`; copy a preset and remove that field to expose `subagent_codex` only to agents composed from the copy.
59
+ The bundle inserts `tool-subagent-codex` as a Host row, so `subagent_codex` is a global tool visible to every preset, including minimal. Later user patches can configure or disable that row by id. A preset that registers its own tool with the same name shadows the global tool for its Agents. To mount the provider and tool without selecting the bundle layer, insert the same rows in `cordis.patch.yml`:
63
60
 
64
61
  ```yaml
65
- - id: jobs
66
- name: '@deepseek-ai/dsh-jobs-local'
67
- - id: tool-jobs
68
- name: '@deepseek-ai/dsh-tool-jobs'
69
- - id: tool-subagent-codex
70
- name: '@deepseek-ai/dsh-tool-subagent'
71
- config:
72
- provider: codex
73
- toolName: subagent_codex
74
- backgroundMode: one-shot
75
- maxDepth: provider-managed
62
+ - insert:
63
+ - id: subagent-codex
64
+ name: '@deepseek-ai/dsh-subagent-codex'
65
+ - id: tool-subagent-codex
66
+ name: '@deepseek-ai/dsh-tool-subagent'
67
+ config:
68
+ provider: codex
69
+ toolName: subagent_codex
70
+ maxDepth: provider-managed
76
71
  ```
77
72
 
78
- The `one-shot` policy keeps omitted or `false` `run_in_background` calls in the foreground, while explicit `true` returns a parent-owned Job id for `job_output` or `job_kill`; the base host and full presets already provide the generic Job registry and controls.
73
+ The tool returns a child id after accepting the task and sends its result to the parent Agent on completion. Each external activation executes once and accepts no follow-up input or resume.
79
74
 
80
75
  ### What you get
81
76
 
82
- A foreground call gives the model the selected final Codex answer, or an error with the stop reason and optional safe diagnostic for a failed run. A background call first returns a Job id; the generic job controls later deliver a completion notice and expose the same final answer or failed status through `job_output`. Codex commentary, reasoning, tool activity, raw stderr, and workspace diffs never enter the parent session.
77
+ The completion notice contains the final Codex answer, or the stop reason and optional safe diagnostic. The parent Session also retains the external task identity and complete terminal result independently of the notice; no local child Session is created. Product reasoning, tool activity, raw stderr, and workspace diffs do not enter the parent Session.
83
78
 
84
79
  ### Failure and recovery
85
80
 
@@ -108,11 +103,11 @@ This section explains how the provider drives a real Codex app-server and where
108
103
  | [`src/index.ts`](src/index.ts) | Plugin entry: config schema, provider registration |
109
104
  | [`src/run.ts`](src/run.ts) | The run lifecycle, turn execution, result selection, and diagnostics |
110
105
  | [`src/wire.ts`](src/wire.ts) | The minimal app-server JSON-RPC wire implementation |
111
- | [`cordis.patch.yml`](cordis.patch.yml) | The Profile patch layer that registers the dormant provider |
106
+ | [`cordis.patch.yml`](cordis.patch.yml) | The Profile layer that registers the provider and contributes preset delegation tools |
112
107
 
113
108
  ### Run flow
114
109
 
115
- A start accepts only a non-empty sequence of text blocks and derives the child cwd from the parent session. It spawns the fixed command through the subprocess seam, performs the `initialize` → `initialized` handshake, maps the Profile-selected mode and optional model into official `thread/start` fields beside `{ cwd, ephemeral: true }`, and publishes the run only after Codex returns a valid ephemeral thread. The published result starts exactly one turn, accepts only notifications for that run's thread and turn, and waits for the authoritative `turn/completed` terminal. The latest `agentMessage` with `phase: "final_answer"` wins; when Codex emits no explicit final phase, the latest message with `phase: null` is the compatibility fallback. A successful turn with no nonblank answer settles as an error. Failed turns use the coarse categories `limit`, `access-policy`, `service`, `transport`, `product-error`, `invalid-result`, or `unknown`; an early app-server exit uses `process`, and applicable connection and stream failures retain a numeric `httpStatusCode`.
110
+ A start accepts only a non-empty sequence of text blocks and uses the child cwd selected by the subagent service. It spawns the fixed command through the subprocess seam, performs the `initialize` → `initialized` handshake, maps the Profile-selected mode and optional model into official `thread/start` fields beside `{ cwd, ephemeral: true }`, and publishes the run only after Codex returns a valid ephemeral thread. The published result starts exactly one turn, accepts only notifications for that run's thread and turn, and waits for the authoritative `turn/completed` terminal. The latest `agentMessage` with `phase: "final_answer"` wins; when Codex emits no explicit final phase, the latest message with `phase: null` is the compatibility fallback. A successful turn with no nonblank answer settles as an error. Failed turns use the coarse categories `limit`, `access-policy`, `service`, `transport`, `product-error`, `invalid-result`, or `unknown`; an early app-server exit uses `process`, and applicable connection and stream failures retain a numeric `httpStatusCode`.
116
111
 
117
112
  </details>
118
113
 
@@ -126,7 +121,7 @@ Read these pages when the package-level contract is not enough. They move from t
126
121
  - [Subagent subsystem](../../../docs/subsystems/subagent.md) — the service contract, provider contract, and terminal result semantics.
127
122
  - [dsh-subagent seam](../subagent/README.md) — the registry and start API this provider registers on.
128
123
  - [Claude Code subagent provider](../subagent-claude-code/README.md) — the sibling product backend over the official Agent SDK.
129
- - [Claude Code and Codex backends](../../../.agents/notes/implemented/feature/2026-08-04-claude-code-and-codex-subagent-backends.md) — the design record for the product providers.
124
+ - [historical Claude Code and Codex backends](../../../.agents/notes/archived/feature/2026-08-04-claude-code-and-codex-subagent-backends.md) — the design record for the product providers.
130
125
  - [Generated configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-subagent-codex) — every accepted config field and its source declaration.
131
126
 
132
127
  -----
@@ -138,7 +133,7 @@ Read these pages when the package-level contract is not enough. They move from t
138
133
 
139
134
  #### What the model sees
140
135
 
141
- The Codex child receives the standalone text blocks as one turn in a fresh ephemeral thread. Its workspace is the parent Session cwd; the selected Provider instance fixes any configured model, environment, non-interactive approval policy, and sandbox mode, while an omitted model and every other product setting come from native Codex configuration. The executable version comes from the Bundle's pinned platform payload.
136
+ The Codex child receives the standalone text blocks as one turn in a fresh ephemeral thread. Its workspace is the selected child working directory; the selected Provider instance fixes any configured model, environment, non-interactive approval policy, and sandbox mode, while an omitted model and every other product setting come from native Codex configuration. The executable version comes from the Bundle's pinned platform payload.
142
137
 
143
138
  #### Token effect
144
139
 
@@ -152,15 +147,15 @@ Independent of the parent request cache. Reuse depends only on Codex's own provi
152
147
 
153
148
  #### What the model sees
154
149
 
155
- Through `dsh-tool-subagent`, a foreground call gives the parent the selected final Codex answer or an error containing the stop reason and optional safe diagnostic for a non-completed result. The diagnostic can distinguish a coarse action category, protocol stage, applicable numeric HTTP status, and observed process outcome without copying product prose or stderr. A background call first returns a Job id; the generic job controls later deliver a completion notice, expose the same final answer or failed status detail through `job_output`, and let `job_kill` request cancellation. Codex commentary, reasoning, tool activity, raw stderr, workspace diffs, usage, product ids, commands, paths, and protocol payloads are not copied into the parent Session.
150
+ Through `dsh-tool-subagent`, the parent model first receives a child id, then the final Codex answer or a failure notice with its stop reason and safe diagnostic. Diagnostics contain only fixed stage, category, and observed protocol or process facts. Product reasoning, intermediate messages, tool activity, stderr, usage, product identifiers, commands, paths, and raw protocol payloads are not copied into the parent Session.
156
151
 
157
152
  #### Token effect
158
153
 
159
- Foreground input grows by the retained final answer or error. Background input also includes the start acknowledgement, completion notice, and any `job_output`, `job_kill`, or later status results; child tokens still do not enter the parent context. This provider adds no parent tool schema by itself.
154
+ Parent input grows by the start acknowledgement and completion notice, including the final answer or failure detail. Child tokens do not enter the parent context. This provider adds no parent tool schema by itself.
160
155
 
161
156
  #### KV Cache effect
162
157
 
163
- Append-only: foreground adds one result after the reusable parent prefix, while background appends the Job acknowledgement, notice, and later control or collection results. Background scheduling can add a notice-driven turn, but none of these messages rewrites the earlier prefix.
158
+ Start acknowledgements and completion notices append after the reusable parent request prefix. A notice may wake another turn without rewriting the existing prefix.
164
159
 
165
160
  ## Known Limitations and Deferred Work
166
161
 
@@ -175,7 +170,7 @@ These limits define when this provider is a poor fit or needs special operationa
175
170
  - **The native platform payload is required at delegation time** — installs that omit optional dependencies, unsupported platforms, and missing or damaged payloads fail at the first run; there is no host-CLI fallback.
176
171
  - **Compatibility is pinned by development evidence** — upgrading from the verified 0.153.4 protocol baseline requires regenerating upstream schema evidence and rerunning handshake, answer-selection, approval, cancellation, keyless real-product, and credentialed DeepSeek nonce tests.
177
172
  - **No human approval path** — known unattended approval requests are denied and unknown server requests fail closed; the three Profile modes never create a DSH interaction channel or per-call allow policy.
178
- - **Assistant payload is final text only** — a failed run may additionally expose the separate safe diagnostic; reasoning, commentary, intermediate messages, tool traffic, usage, raw stderr, and workspace diffs remain outside the parent Session, while generic Job ids, notices, and status come from the shared job runtime.
173
+ - **Assistant payload is final text only** — failed runs can also expose a separate safe diagnostic; reasoning, intermediate messages, tool traffic, usage, stderr, and workspace diffs remain outside the parent Session. Task identity and terminal results are retained in the parent log.
179
174
  - **No optional shared capabilities** — `agentOptions`, output schemas, child personas, tool filtering, and harness depth enforcement are rejected by the shared service for this provider.
180
175
  - **No wall-clock timeout or side-effect rollback** — the caller cancels long work, and files or external systems changed before cancellation are not restored.
181
176
 
@@ -191,5 +186,3 @@ This Dev Note is working context for maintainers: open questions and undecided d
191
186
  - **Version-pinned protocol** — the runtime dependency is pinned to `@openai/codex@0.153.4`; upgrading requires regenerating the upstream schema evidence and rerunning the credentialed nonce tests.
192
187
 
193
188
  </details>
194
-
195
- **Runtime invariant:** No companion is published. Lifecycle pairing belongs to the shared subagent service, and managed-range ownership belongs to the subprocess service.
package/README.zh.md CHANGED
@@ -9,7 +9,7 @@ kind: "package-bundle"
9
9
 
10
10
  ## 概述
11
11
 
12
- 当委派工作需要在父会话工作区中的真实无人值守 Codex 会话内运行时,把 `@deepseek-ai/dsh-subagent-codex` 安装进 Profile。每次委派都会为一个自包含文本任务使用全新且隔离的 Codex 线程,并且只返回其最终答案或安全失败诊断。原生 Codex 配置和身份验证继续作为权威来源,而 `permissionMode` 选择非交互式审批和沙箱行为。Bundle 会提供兼容的原生 Codex 载荷,但只有配置委派工具后才会向模型公开相应能力。
12
+ 当委派工作需要在父会话工作区中的真实无人值守 Codex 会话内运行时,把 `@deepseek-ai/dsh-subagent-codex` 安装进 Profile。每次委派都会为一个自包含文本任务使用全新且隔离的 Codex 线程,并且只返回其最终答案或安全失败诊断。原生 Codex 配置和身份验证继续作为权威来源,而 `permissionMode` 选择非交互式审批和沙箱行为。Bundle 提供兼容的原生 Codex 载荷,并以全局工具形式添加委派工具。
13
13
 
14
14
  ## 目录
15
15
 
@@ -25,19 +25,15 @@ kind: "package-bundle"
25
25
  <a id="use-this-package"></a>
26
26
  ## 使用本包
27
27
 
28
- 当委派应以父级工作区中的真实 Codex 会话运行时,挂载本提供方。常用路径是显式的:把 Bundle 安装进 Profile,可选地配置提供方行,并通过委派工具行把它暴露给模型。
28
+ 当任务需要在父工作区中运行全新的原生 Codex 会话时,在 Web 或 Desktop 插件页启用 **Codex 子智能体**。
29
29
 
30
30
  ### 安装 Bundle
31
31
 
32
- 把包安装进目标 Profile,然后重启该 Profile。安装会把官方 wrapper 与一个兼容的原生平台载荷带入 Profile;声明的 patch 层只注册休眠的提供方,不启动任何 Codex 进程。
32
+ 官方条目可离线显示。启用时,普通 bundle 安装器会安装[当前 DSH 安装对应的目标](../../boot/plugin-manager/README.zh.md#use-this-package)并选择其配置层。此层注册提供方,并为所有智能体添加全局工具 `subagent_codex`;实际委派前不会启动原生进程。安装器提示需要重启时,请重启应用。
33
33
 
34
- ```sh
35
- dsh plugin --profile <name> add @deepseek-ai/dsh-subagent-codex
36
- dsh plugin --profile <name> remove @deepseek-ai/dsh-subagent-codex
37
- dsh --profile <name>
38
- ```
34
+ 关闭只会取消选择配置层,保留已安装的包。移除是独立的包操作。启用或关闭会在运行中的 Host 注册或移除该全局工具,正在运行的智能体会在下一次请求时看到变化。
39
35
 
40
- 移除包后,下一次 Profile 启动会撤回提供方及其私有运行时闭包。安装决定 Host 可用性,而不是模型权限:模型只能通过你组合的委派工具行触达提供方。
36
+ 此层只插入 Host 条目,因此任何配置(包括随附的 headless、SDK 和 ACP)都可以选择它。原有仅提供方用法请遵循[升级指南](../../../docs/upgrade-guide/v0.2.1-alpha.1/native-subagent-bundle-tools/guide.zh.md)。
41
37
 
42
38
  ### 配置
43
39
 
@@ -57,29 +53,28 @@ dsh --profile <name>
57
53
 
58
54
  生成的[配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-subagent-codex)是每个受支持字段及其 JSDoc 的穷尽式真源。已配置的 `model` 会原样传给每个临时 `thread/start`;省略时保留原生模型选择。提供方不会发现模型、改写别名、选择 `modelProvider` 或 `serviceTier`,也不会设置 fallback。具有凭证特征的环境变量会在显式 `env` 覆盖生效前被移除,因此供子进程使用的 API 密钥必须在该配置中显式提供。
59
55
 
56
+ <a id="exposing-the-tool"></a>
60
57
  ### 暴露工具
61
58
 
62
- 每个委派工具行指名一个提供方,并需要独立的 `toolName`,因此模型看到的是静态工具,而不是动态提供方选择器。完整 Agent Preset 携带对应的默认工具行并设置 `disabled: true`;复制一个 preset 后删除该字段,即可只向由该副本组装的 agent 暴露 `subagent_codex`。
59
+ Bundle 将 `tool-subagent-codex` 作为 Host 条目插入,因此 `subagent_codex` 是所有预设(包括 minimal)都可见的全局工具。后续用户补丁可以按 id 配置或禁用该行。预设自行注册的同名工具会为其智能体遮蔽该全局工具。若要不选择 bundle 层而挂载提供方和工具,在 `cordis.patch.yml` 中插入相同的条目:
63
60
 
64
61
  ```yaml
65
- - id: jobs
66
- name: '@deepseek-ai/dsh-jobs-local'
67
- - id: tool-jobs
68
- name: '@deepseek-ai/dsh-tool-jobs'
69
- - id: tool-subagent-codex
70
- name: '@deepseek-ai/dsh-tool-subagent'
71
- config:
72
- provider: codex
73
- toolName: subagent_codex
74
- backgroundMode: one-shot
75
- maxDepth: provider-managed
62
+ - insert:
63
+ - id: subagent-codex
64
+ name: '@deepseek-ai/dsh-subagent-codex'
65
+ - id: tool-subagent-codex
66
+ name: '@deepseek-ai/dsh-tool-subagent'
67
+ config:
68
+ provider: codex
69
+ toolName: subagent_codex
70
+ maxDepth: provider-managed
76
71
  ```
77
72
 
78
- `one-shot` 策略会让省略 `run_in_background` 或传入 `false` 的调用继续在前台等待,而显式传入 `true` 会返回由父 agent 拥有的 Job id,供 `job_output` 或 `job_kill` 使用;base host(基础宿主)与完整 preset 已提供通用作业注册表和控制工具。
73
+ 工具接受任务后返回 child id;任务完成后向父 agent 发送结果通知。外部 activation 只执行一次,不支持追加输入或恢复对话。
79
74
 
80
75
  ### 你会得到什么
81
76
 
82
- 前台调用会把选定的最终 Codex 答案交给模型;运行失败时则返回带停止原因与可选安全诊断的错误。后台调用先返回 Job id;随后通用作业控制面会送达完成通知,并通过 `job_output` 公开同一最终答案或失败状态。Codex 的过程说明、推理、工具活动、原始 stderr 与工作区差异绝不会进入父级会话。
77
+ 完成通知包含 Codex 的最终答案,或停止原因与可选的安全诊断。父会话还独立保存外部任务的身份和完整终态结果;无需创建本地子 Session。产品推理、工具活动、原始 stderr 与工作区差异不会进入父会话。
83
78
 
84
79
  ### 失败与恢复
85
80
 
@@ -108,11 +103,11 @@ dsh --profile <name>
108
103
  | [`src/index.ts`](src/index.ts) | 插件入口:config schema、提供方注册 |
109
104
  | [`src/run.ts`](src/run.ts) | 运行生命周期、轮次执行、结果选择与诊断 |
110
105
  | [`src/wire.ts`](src/wire.ts) | 最小的 app-server JSON-RPC 协议实现 |
111
- | [`cordis.patch.yml`](cordis.patch.yml) | 注册休眠提供方的 Profile patch 层 |
106
+ | [`cordis.patch.yml`](cordis.patch.yml) | 注册提供方并添加预设委派工具的 Profile 配置层 |
112
107
 
113
108
  ### 运行流程
114
109
 
115
- 一次启动只接受非空的文本块序列,并根据父会话确定子级 cwd。它经子进程 seam spawn 固定命令,完成 `initialize` → `initialized` 握手,把 Profile 选择的模式与可选模型映射为官方 `thread/start` 字段并与 `{ cwd, ephemeral: true }` 一起发送,且仅在 Codex 返回有效的临时线程后发布运行。已发布的结果恰好启动一个轮次,只接受与此次运行的线程和轮次匹配的通知,并等待权威的 `turn/completed` 终态。以最后一条 `phase: "final_answer"` 的 `agentMessage` 为准;若 Codex 没有发出明确的最终阶段,则以最后一条 `phase: null` 的消息作为兼容性回退。成功完成的轮次若没有非空白答案,结果也会判为错误。失败轮次使用粗粒度类别 `limit`、`access-policy`、`service`、`transport`、`product-error`、`invalid-result` 或 `unknown`;app-server 提前退出使用 `process`,适用的连接与 stream 失败保留数值 `httpStatusCode`。
110
+ 一次启动只接受非空的文本块序列,并使用子代理服务选择的子级 cwd。它经子进程 seam spawn 固定命令,完成 `initialize` → `initialized` 握手,把 Profile 选择的模式与可选模型映射为官方 `thread/start` 字段并与 `{ cwd, ephemeral: true }` 一起发送,且仅在 Codex 返回有效的临时线程后发布运行。已发布的结果恰好启动一个轮次,只接受与此次运行的线程和轮次匹配的通知,并等待权威的 `turn/completed` 终态。以最后一条 `phase: "final_answer"` 的 `agentMessage` 为准;若 Codex 没有发出明确的最终阶段,则以最后一条 `phase: null` 的消息作为兼容性回退。成功完成的轮次若没有非空白答案,结果也会判为错误。失败轮次使用粗粒度类别 `limit`、`access-policy`、`service`、`transport`、`product-error`、`invalid-result` 或 `unknown`;app-server 提前退出使用 `process`,适用的连接与 stream 失败保留数值 `httpStatusCode`。
116
111
 
117
112
  </details>
118
113
 
@@ -126,7 +121,7 @@ dsh --profile <name>
126
121
  - [Subagent 子系统](../../../docs/subsystems/subagent.zh.md)——服务约定、提供方约定与终态结果语义。
127
122
  - [dsh-subagent seam](../subagent/README.zh.md)——本提供方注册于其上的注册表与启动 API。
128
123
  - [Claude Code subagent 提供方](../subagent-claude-code/README.zh.md)——经官方 Agent SDK 的兄弟产品后端。
129
- - [Claude Code 与 Codex 后端](../../../.agents/notes/implemented/feature/2026-08-04-claude-code-and-codex-subagent-backends.zh.md)——产品提供方的设计记录。
124
+ - [历史Claude Code 与 Codex 后端](../../../.agents/notes/archived/feature/2026-08-04-claude-code-and-codex-subagent-backends.md)——产品提供方的设计记录。
130
125
  - [生成配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-subagent-codex)——每个受支持配置字段及其源声明。
131
126
 
132
127
  -----
@@ -138,7 +133,7 @@ dsh --profile <name>
138
133
 
139
134
  #### 模型看到什么
140
135
 
141
- Codex 子级会在一个全新的临时线程中,以单个轮次接收这些独立文本块。它的工作区是父会话 cwd;所选提供方实例会固定已配置的模型、环境、非交互审批策略与沙箱模式,而省略的模型及其余产品设置来自 Codex 原生配置。可执行版本来自 Bundle 锁定的平台载荷。
136
+ Codex 子级会在一个全新的临时线程中,以单个轮次接收这些独立文本块。它的工作区是所选子级工作目录;所选提供方实例会固定已配置的模型、环境、非交互审批策略与沙箱模式,而省略的模型及其余产品设置来自 Codex 原生配置。可执行版本来自 Bundle 锁定的平台载荷。
142
137
 
143
138
  #### Token 影响
144
139
 
@@ -152,15 +147,15 @@ Codex 子级会在一个全新的临时线程中,以单个轮次接收这些
152
147
 
153
148
  #### 模型看到什么
154
149
 
155
- 通过 `dsh-tool-subagent`,前台调用会让父级模型看到选定的 Codex 最终答案;若结果未完成,错误中会包含终止原因和可选的安全诊断。该诊断可以区分粗粒度行动类别、协议阶段、适用的数值 HTTP status 和已观测的进程结果,而不复制产品正文或 stderr。后台调用会先返回 Job id;随后通用作业控制面会送达完成通知,通过 `job_output` 公开同一最终答案或失败状态详情,并允许 `job_kill` 请求取消。Codex 的过程说明、推理(reasoning)、工具活动、原始 stderr、工作区差异、用量信息、产品标识符、命令、路径和协议载荷均不会复制到父会话。
150
+ 通过 `dsh-tool-subagent`,父模型先收到 child id,随后收到 Codex 最终答案或带停止原因与安全诊断的失败通知。诊断只包含固定的阶段、类别和已观测的协议或进程事实。产品推理、中间消息、工具活动、stderr、用量、产品标识符、命令、路径与原始协议载荷不会复制到父 Session。
156
151
 
157
152
  #### Token 影响
158
153
 
159
- 前台输入会增加工具结果中保留的最终答案或错误内容。后台输入还会包含启动确认、完成通知,以及 `job_output`、`job_kill` 或后续状态结果;子任务 token 仍不会进入父级上下文。本提供方自身不添加父级工具 schema。
154
+ 父级输入会增加启动确认与完成通知,包括最终答案或失败信息。子任务 token 不进入父级上下文。本提供方自身不添加父级工具 schema。
160
155
 
161
156
  #### KV Cache 影响
162
157
 
163
- 仅追加:前台会在可复用的父请求前缀后增加一个结果,后台则会继续追加 Job 启动确认、通知以及后续控制或收集结果。后台调度可能增加一个由通知唤醒的轮次,但这些消息都不会改写更早的前缀。
158
+ 启动确认与完成通知仅追加到可复用的父请求前缀之后。通知可能唤醒新轮次,不会改写已有前缀。
164
159
 
165
160
  ## 已知限制与延期工作
166
161
 
@@ -175,7 +170,7 @@ Codex 子级会在一个全新的临时线程中,以单个轮次接收这些
175
170
  - **委派时必须存在原生平台载荷**——省略 optional dependencies 的安装、不受支持的平台以及缺失或损坏的载荷都会在第一次运行时失败;不会回退到宿主 CLI。
176
171
  - **兼容性由开发证据锁定**——若要从已验证的 0.153.4 协议基线升级,必须重新生成上游 schema 证据,并重新运行握手、答案选择、审批、取消、无密钥真实产品以及带密钥的 DeepSeek 随机数测试。
177
172
  - **没有人工审批路径**——已知的无人值守审批请求会被拒绝,未知服务器请求会以默认拒绝方式使运行失败;三种 Profile 模式都不会创建 DSH 交互通道或逐次调用 allow 策略。
178
- - **assistant 载荷仅包含最终文本**——失败运行可以额外公开独立的安全诊断;推理、过程说明、中间消息、工具通信、用量信息、原始 stderr 和工作区差异不会进入父会话,通用 Job id、通知与状态来自共享作业运行时。
173
+ - **assistant 载荷仅包含最终文本**——失败运行还可公开独立的安全诊断;推理、中间消息、工具通信、用量、stderr 与工作区差异不会进入父 Session。任务身份与终态结果保存在父日志中。
179
174
  - **没有可选的共享能力**——对于本提供方,共享服务会拒绝 `agentOptions`、输出 schema、子任务角色设定、工具筛选和 harness 深度强制约束。
180
175
  - **没有按实际经过时间触发的超时或副作用回滚**——长时间运行的工作由调用方取消,且取消前已更改的文件或外部系统不会恢复原状。
181
176
 
@@ -191,5 +186,3 @@ Codex 子级会在一个全新的临时线程中,以单个轮次接收这些
191
186
  - **版本锁定的协议**——运行时依赖锁定为 `@openai/codex@0.153.4`;升级需要重新生成上游 schema 证据并重新运行带凭证的随机数测试。
192
187
 
193
188
  </details>
194
-
195
- **运行时不变式:** 不发布伴生入口。生命周期配对属于共享 subagent service,受管范围的所有权属于 subprocess service。
package/cordis.patch.yml CHANGED
@@ -1,5 +1,9 @@
1
- # Optional Profile Bundle: register the Codex provider on the Host plane only.
2
- # Agent Presets grant the model-facing tool independently.
3
1
  - insert:
4
2
  - id: subagent-codex
5
3
  name: '@deepseek-ai/dsh-subagent-codex'
4
+ - id: tool-subagent-codex
5
+ name: '@deepseek-ai/dsh-tool-subagent'
6
+ config:
7
+ provider: codex
8
+ toolName: subagent_codex
9
+ maxDepth: provider-managed
package/icon.svg ADDED
@@ -0,0 +1 @@
1
+ <svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="14.9893" y="15.1877" width="12.2365" height="12.2365" rx="2" fill="url(#dsh_plugin_art_R0a)" fill-opacity="0.8"></rect><rect x="8.87109" y="9.0697" width="12.2365" height="12.2365" rx="2" fill="url(#dsh_plugin_art_R0b)" fill-opacity="0.8"></rect><defs><linearGradient id="dsh_plugin_art_R0a" x1="21.1075" y1="15.1877" x2="21.1075" y2="27.4243" gradientUnits="userSpaceOnUse"><stop stop-color="#45E7A4"></stop><stop offset="1" stop-color="#05909D"></stop></linearGradient><linearGradient id="dsh_plugin_art_R0b" x1="14.9894" y1="9.0697" x2="14.9894" y2="21.3063" gradientUnits="userSpaceOnUse"><stop stop-color="#69B9FF"></stop><stop offset="1" stop-color="#324DE2"></stop></linearGradient></defs></svg>
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from "node:module";
2
2
  import z from "@deepseek-ai/schemastery";
3
3
  import { MAX_TIMER_DELAY_MS } from "@deepseek-ai/dsh-timeout";
4
- import { NO_START_CAPABILITIES, assertPositiveFinite, resolveChildCwd, settleRunResult, subprocessRunHandle } from "@deepseek-ai/dsh-subagent";
4
+ import { NO_START_CAPABILITIES, assertPositiveFinite, assertUsableCwd, settleRunResult, subprocessRunHandle } from "@deepseek-ai/dsh-subagent";
5
5
  import { randomUUID } from "node:crypto";
6
6
  import { readFileSync, writeFileSync } from "node:fs";
7
7
  import { dirname, resolve } from "node:path";
@@ -204,7 +204,7 @@ var CodexAppServerWire = class {
204
204
  }
205
205
  /**
206
206
  * Create the run's private ephemeral thread and retain its identity.
207
- * @param cwd - parent Session workspace.
207
+ * @param cwd - selected child working directory.
208
208
  * @param signal - unpublished-start cancellation.
209
209
  */
210
210
  async startThread(cwd, signal) {
@@ -828,11 +828,9 @@ var CodexProvider = class {
828
828
  this.config = config;
829
829
  }
830
830
  start(request) {
831
- const parentCwd = request.parent.session.header.cwd;
832
- if (parentCwd === void 0) throw new Error("subagent-codex: no working directory for the child — delegate from a parent session that has one");
833
831
  let cwd;
834
832
  try {
835
- cwd = resolveChildCwd("subagent-codex", void 0, parentCwd);
833
+ cwd = assertUsableCwd("subagent-codex", "child cwd", request.cwd);
836
834
  } catch (error) {
837
835
  if (request.signal.aborted) throw new Error("subagent-codex: request was aborted before app-server startup");
838
836
  throw codexStartupFailure(error);
@@ -31,7 +31,7 @@ export declare function codexStartupFailure(cause: unknown): Error;
31
31
  export declare function codexAppServerArgv(): string[];
32
32
  /** Fully resolved inputs for one Codex app-server run. */
33
33
  export interface CodexRunSpec {
34
- /** Parent Session workspace, also supplied to `thread/start`. */
34
+ /** Selected child working directory, also supplied to `thread/start`. */
35
35
  readonly cwd: string;
36
36
  /** Profile-selected native model; omitted to preserve Codex settings. */
37
37
  readonly model?: string;
@@ -58,7 +58,7 @@ export declare class CodexAppServerWire {
58
58
  initialize(signal: AbortSignal): Promise<void>;
59
59
  /**
60
60
  * Create the run's private ephemeral thread and retain its identity.
61
- * @param cwd - parent Session workspace.
61
+ * @param cwd - selected child working directory.
62
62
  * @param signal - unpublished-start cancellation.
63
63
  */
64
64
  startThread(cwd: string, signal: AbortSignal): Promise<void>;
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Codex subagent",
4
+ "description": "Delegate one task to Codex using its native authentication and settings."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Codex 子智能体",
4
+ "description": "使用 Codex 原生认证和设置委派单个任务。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-subagent-codex",
3
3
  "description": "One-shot Codex subagent provider over the official app-server protocol",
4
- "version": "0.2.0-rc.2",
4
+ "version": "0.2.1-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -19,9 +19,13 @@
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",
24
+ "./cordis.patch.yml": "./cordis.patch.yml"
23
25
  },
24
26
  "files": [
27
+ "icon.svg",
28
+ "locale/*.json",
25
29
  "lib/index.js",
26
30
  "cordis.patch.yml",
27
31
  "lib/types/**/*.d.ts"
@@ -33,36 +37,37 @@
33
37
  }
34
38
  },
35
39
  "peerDependencies": {
36
- "@deepseek-ai/cordis": "~4.0.4",
37
- "@deepseek-ai/dsh-llm": "0.2.0-rc.2",
38
- "@deepseek-ai/dsh-session": "0.2.0-rc.2",
39
- "@deepseek-ai/dsh-subagent": "0.2.0-rc.2",
40
- "@deepseek-ai/dsh-subprocess": "0.2.0-rc.2",
41
- "@deepseek-ai/dsh-timeout": "0.2.0-rc.2"
40
+ "@deepseek-ai/cordis": "~4.0.5-alpha.1",
41
+ "@deepseek-ai/dsh-llm": "0.2.1-alpha.2",
42
+ "@deepseek-ai/dsh-session": "0.2.1-alpha.2",
43
+ "@deepseek-ai/dsh-subagent": "0.2.1-alpha.2",
44
+ "@deepseek-ai/dsh-subprocess": "0.2.1-alpha.2",
45
+ "@deepseek-ai/dsh-timeout": "0.2.1-alpha.2"
42
46
  },
43
47
  "dependencies": {
48
+ "@deepseek-ai/dsh-brand": "0.2.1-alpha.2",
49
+ "@deepseek-ai/dsh-sdk-protocol": "0.2.1-alpha.2",
50
+ "@deepseek-ai/schemastery": "~3.18.5-alpha.1",
44
51
  "@openai/codex": "0.153.4",
45
- "@deepseek-ai/dsh-brand": "0.2.0-rc.2",
46
- "@deepseek-ai/dsh-sdk-protocol": "0.2.0-rc.2",
47
- "@deepseek-ai/schemastery": "~3.18.4"
52
+ "@deepseek-ai/dsh-tool-subagent": "0.2.1-alpha.2"
48
53
  },
49
54
  "devDependencies": {
50
- "@deepseek-ai/cordis": "~4.0.4",
51
- "@deepseek-ai/cordis-plugin-loader": "~1.0.5",
52
- "@deepseek-ai/dsh-agent": "0.2.0-rc.2",
53
- "@deepseek-ai/dsh-loader-smoke": "0.2.0-rc.2",
54
- "@deepseek-ai/dsh-session": "0.2.0-rc.2",
55
- "@deepseek-ai/dsh-session-checkpoint-policy": "0.2.0-rc.2",
56
- "@deepseek-ai/dsh-session-persistence-jsonl": "0.2.0-rc.2",
57
- "@deepseek-ai/dsh-session-projection": "0.2.0-rc.2",
58
- "@deepseek-ai/dsh-subagent": "0.2.0-rc.2",
59
- "@deepseek-ai/dsh-subprocess": "0.2.0-rc.2",
60
- "@deepseek-ai/dsh-subprocess-local": "0.2.0-rc.2",
61
- "@deepseek-ai/dsh-timeout": "0.2.0-rc.2",
62
- "@deepseek-ai/dsh-tool-jobs": "0.2.0-rc.2",
63
- "@deepseek-ai/dsh-tools": "0.2.0-rc.2",
64
- "@deepseek-ai/dsh-app-boot": "0.2.0-rc.2",
65
- "@deepseek-ai/dsh-llm": "0.2.0-rc.2",
66
- "@deepseek-ai/dsh-tool-subagent": "0.2.0-rc.2"
67
- }
55
+ "@deepseek-ai/cordis": "~4.0.5-alpha.1",
56
+ "@deepseek-ai/cordis-plugin-loader": "~1.0.6-alpha.1",
57
+ "@deepseek-ai/dsh-agent": "0.2.1-alpha.2",
58
+ "@deepseek-ai/dsh-app-boot": "0.2.1-alpha.2",
59
+ "@deepseek-ai/dsh-llm": "0.2.1-alpha.2",
60
+ "@deepseek-ai/dsh-loader-smoke": "0.2.1-alpha.2",
61
+ "@deepseek-ai/dsh-session": "0.2.1-alpha.2",
62
+ "@deepseek-ai/dsh-session-checkpoint-policy": "0.2.1-alpha.2",
63
+ "@deepseek-ai/dsh-session-persistence-jsonl": "0.2.1-alpha.2",
64
+ "@deepseek-ai/dsh-session-projection": "0.2.1-alpha.2",
65
+ "@deepseek-ai/dsh-subagent": "0.2.1-alpha.2",
66
+ "@deepseek-ai/dsh-subprocess": "0.2.1-alpha.2",
67
+ "@deepseek-ai/dsh-subprocess-local": "0.2.1-alpha.2",
68
+ "@deepseek-ai/dsh-timeout": "0.2.1-alpha.2",
69
+ "@deepseek-ai/dsh-tool-jobs": "0.2.1-alpha.2",
70
+ "@deepseek-ai/dsh-tools": "0.2.1-alpha.2"
71
+ },
72
+ "icon": "./icon.svg"
68
73
  }