diff --git a/.agents/notes/implemented/architecture/2026-08-10-host-plane-ownership-after-presets.i18n.yaml b/.agents/notes/implemented/architecture/2026-08-10-host-plane-ownership-after-presets.i18n.yaml index 6401383a39..efb80d0a36 100644 --- a/.agents/notes/implemented/architecture/2026-08-10-host-plane-ownership-after-presets.i18n.yaml +++ b/.agents/notes/implemented/architecture/2026-08-10-host-plane-ownership-after-presets.i18n.yaml @@ -18,5 +18,5 @@ en: ca7c9088d0793e1e zh: ea648bac9e726c64 /agent-note-what-stays-host-plane-once-presets-own-the-agent-plane/consequences: - en: 0a426923c2a1f774 - zh: 29626804b99b35ff + en: 23642f4d7c998de6 + zh: f968db2047e0f4ac diff --git a/.agents/notes/implemented/architecture/2026-08-10-host-plane-ownership-after-presets.md b/.agents/notes/implemented/architecture/2026-08-10-host-plane-ownership-after-presets.md index 620692ee9f..1ff27b6821 100644 --- a/.agents/notes/implemented/architecture/2026-08-10-host-plane-ownership-after-presets.md +++ b/.agents/notes/implemented/architecture/2026-08-10-host-plane-ownership-after-presets.md @@ -40,4 +40,4 @@ Projection key presence is not a per-session capability signal ([session project The context meter is a per-session fact independent of mount history. Presets resolve the host meter for token accounting while selecting their own compaction backend; `minimal` supports both automatic compaction and the human `/compact` command. -Production entry points must compose Agents explicitly; installing the registry alone does not bind them. An unjoined Agent receives no tools, prompt sections, or skills and reports no error. +Production entry points must compose Agents explicitly; installing the registry alone does not bind them. An unjoined Agent receives none of the tools, prompt sections, or skills that presets own, and the missing join reports no error. The CUA provider registers outside the presets: it gives an unjoined Agent `cua_run_code` with its guidance and rejects that Agent's creation while the tool's program services are unavailable ([CUA program tool for Agents without a preset](2026-11-12-cua-program-tool-without-presets.md)). diff --git a/.agents/notes/implemented/architecture/2026-08-10-host-plane-ownership-after-presets.zh.md b/.agents/notes/implemented/architecture/2026-08-10-host-plane-ownership-after-presets.zh.md index 325758c769..c2799e8981 100644 --- a/.agents/notes/implemented/architecture/2026-08-10-host-plane-ownership-after-presets.zh.md +++ b/.agents/notes/implemented/architecture/2026-08-10-host-plane-ownership-after-presets.zh.md @@ -40,4 +40,4 @@ Status: implemented context meter 是独立于挂载历史的逐会话事实。Preset 使用宿主 meter 进行 token 记账,并选择自己的压缩后端;`minimal` 同时支持自动压缩和用户 `/compact` 命令。 -生产入口必须显式组装 Agent;仅安装注册表不会自动绑定。未加入的 Agent 不会获得工具、提示词段落或 skill,也不会报告错误。 +生产入口必须显式组装 Agent;仅安装注册表不会自动绑定。未加入的 Agent 不会获得 preset 所拥有的工具、提示词段落或 skill,未加入这一点也不会报告错误。CUA 提供方在 preset 之外注册:它为未加入的 Agent 提供 `cua_run_code` 及其指引,并在该工具的程序服务不可用时拒绝创建这个 Agent([未组合 preset 的 Agent 使用 CUA 程序工具](2026-11-12-cua-program-tool-without-presets.zh.md))。 diff --git a/.agents/notes/implemented/architecture/2026-11-12-cua-program-tool-without-presets.i18n.yaml b/.agents/notes/implemented/architecture/2026-11-12-cua-program-tool-without-presets.i18n.yaml index 51a3603023..61880b4c92 100644 --- a/.agents/notes/implemented/architecture/2026-11-12-cua-program-tool-without-presets.i18n.yaml +++ b/.agents/notes/implemented/architecture/2026-11-12-cua-program-tool-without-presets.i18n.yaml @@ -9,11 +9,11 @@ en: ebd7cb462c9e5edc zh: 9e2b414a7b7bba57 /agent-note-cua-program-tool-for-agents-without-a-preset/decision: - en: 91a5a6c960e862c2 - zh: 6c851b4ccd187b80 + en: 65dbe63470c13968 + zh: b1fd3bca1b2b0716 /agent-note-cua-program-tool-for-agents-without-a-preset/alternatives-considered: - en: f547f3a1629452fc - zh: 695ce8d8bbcd47b1 + en: dbb95968d21a5497 + zh: 8f7e7690d4af8683 /agent-note-cua-program-tool-for-agents-without-a-preset/consequences: - en: 735a26681a208494 - zh: c144fdfcb821b404 + en: 065387a5d5bb45dd + zh: 5b12a55c767e2234 diff --git a/.agents/notes/implemented/architecture/2026-11-12-cua-program-tool-without-presets.md b/.agents/notes/implemented/architecture/2026-11-12-cua-program-tool-without-presets.md index 9b449088e6..fb98d71676 100644 --- a/.agents/notes/implemented/architecture/2026-11-12-cua-program-tool-without-presets.md +++ b/.agents/notes/implemented/architecture/2026-11-12-cua-program-tool-without-presets.md @@ -12,7 +12,7 @@ The SDK, headless, and ACP applications create Agents without joining an Agent p When `agentPreset` is a preset ID, only Agents on that preset receive raw `cua`. Every other Agent receives `cua_run_code`, including Agents without a composed preset and every Agent of a composition without the preset registry. The registry is an optional dependency of the provider: the provider recomputes the tool form of each live Agent when the registry loads or unloads, and without the registry no Agent counts as being on the configured preset. `agentPreset: false` still registers raw `cua` globally and creates no program runtime. -This partially supersedes [CUA programs outside the PTC preset](2026-11-09-cua-program-tool.md), which gave Agents without a composed preset neither tool. That note still owns the program tool's runtime, its initialization, and the choice of one tool form per Agent. +This partially supersedes [CUA programs outside the PTC preset](2026-11-09-cua-program-tool.md), which gave Agents without a composed preset neither tool. That note still owns the program tool's runtime, its initialization, and the choice of one tool form per Agent. It also changes one consequence recorded in [What stays host-plane once presets own the agent plane](2026-08-10-host-plane-ownership-after-presets.md), where an Agent that joined no preset received no tool. That note still owns the rule that entry points join Agents explicitly and that no check rejects an Agent for joining no preset. ## Alternatives considered @@ -24,6 +24,8 @@ This partially supersedes [CUA programs outside the PTC preset](2026-11-09-cua-p **Selecting the form from the tool executor** requires the executor interface to identify program executors, which it does not. +**Creating the Agent without the tool and logging a warning while the program services are unavailable** hides the failure on the Hosts this decision serves: an SDK or headless caller would receive a completed run without Computer Use and no error. The provider instead keeps the rule it applies to Agents on other presets: creation waits for the dedicated runtime and rejects while that runtime or the `workingDirectory` service is unavailable, for example after invalid runtime settings or in a composition without `workingDirectory`. This differs from the check that [What stays host-plane once presets own the agent plane](2026-08-10-host-plane-ownership-after-presets.md) rejected. That check would have rejected every Agent that joins no preset, which is how the SDK server, the ACP bridge, and the headless bundle create all of their Agents. The provider rejects only while it cannot supply the tool its configuration selects, and `agentPreset: false` removes the dependency on the program runtime. + ## Consequences -Hosts without presets obtain `cua_run_code` from the default configuration; Web and Desktop sessions always join a preset and are unaffected. On a Host without presets, Agent creation waits for the dedicated program runtime and rejects while its services are unavailable. A PTC executor mounted on such a Host exposes `tools.cua_run_code` inside `run_code` unless the provider sets `agentPreset: false`. The [upgrade guide](../../../../docs/upgrade-guide/v0.2.2-rc.2/cua-agents-without-preset/guide.md) lists the migration. Unit tests cover compositions with and without the registry and the registry's loading and unloading; a recorded SDK Session covers the assembled request and program execution. +Hosts without presets obtain `cua_run_code` from the default configuration; Web and Desktop sessions always join a preset and are unaffected. On a Host without presets, Agent creation waits for the dedicated program runtime and rejects while its services are unavailable. A PTC executor mounted on such a Host exposes `tools.cua_run_code` inside `run_code` unless the provider sets `agentPreset: false`. The [upgrade guide](../../../../docs/upgrade-guide/v0.2.2-rc.2/cua-agents-without-preset/guide.md) lists the migration. Unit tests cover compositions with and without the registry and the registry's loading and unloading; recorded SDK and headless Sessions cover the assembled request and program execution, the headless one through the PTC tool executor. diff --git a/.agents/notes/implemented/architecture/2026-11-12-cua-program-tool-without-presets.zh.md b/.agents/notes/implemented/architecture/2026-11-12-cua-program-tool-without-presets.zh.md index ae63463639..2b30469b99 100644 --- a/.agents/notes/implemented/architecture/2026-11-12-cua-program-tool-without-presets.zh.md +++ b/.agents/notes/implemented/architecture/2026-11-12-cua-program-tool-without-presets.zh.md @@ -12,7 +12,7 @@ SDK、headless 和 ACP 应用创建 Agent 时不组合 Agent preset,它们的 `agentPreset` 为 preset ID 时,只有使用该 preset 的 Agent 获得原始 `cua`。其他 Agent 都获得 `cua_run_code`,包括未组合 preset 的 Agent,以及没有 preset 注册表的组合中的全部 Agent。注册表是提供方的可选依赖:注册表加载或卸载时,提供方重新计算每个存活 Agent 的工具形态;没有注册表时,任何 Agent 都不算使用所配置的 preset。`agentPreset: false` 仍全局注册原始 `cua`,并且不创建程序运行时。 -这部分取代 [PTC preset 之外的 CUA 程序](2026-11-09-cua-program-tool.zh.md)中未组合 preset 的 Agent 不获得任何工具的决定。原记录继续负责程序工具的运行时、初始化,以及每个 Agent 只使用一种工具形态的选择。 +这部分取代 [PTC preset 之外的 CUA 程序](2026-11-09-cua-program-tool.zh.md)中未组合 preset 的 Agent 不获得任何工具的决定。原记录继续负责程序工具的运行时、初始化,以及每个 Agent 只使用一种工具形态的选择。本决策还改变了[Host 平面说明](2026-08-10-host-plane-ownership-after-presets.zh.md)记录的一项后果:此前未加入 preset 的 Agent 不获得任何工具。该记录继续负责入口显式让 Agent 加入,以及没有检查会因为 Agent 未加入 preset 而拒绝它这两条规则。 ## 考虑过的替代方案 @@ -24,6 +24,8 @@ SDK、headless 和 ACP 应用创建 Agent 时不组合 Agent preset,它们的 **按工具执行器选择形态**需要执行器接口标识程序执行器,而该接口没有这项信息。 +**程序服务不可用时照常创建 Agent、不注册该工具并记录警告**会在本决策所服务的 Host 上掩盖失败:SDK 或 headless 的调用方会得到一次没有 Computer Use 的完整运行,并且收不到任何错误。提供方因此沿用它对使用其他 preset 的 Agent 采用的规则:创建时等待专用运行时,在该运行时或 `workingDirectory` 服务不可用时拒绝创建,例如运行时设置无效,或组合中没有 `workingDirectory`。这与[Host 平面说明](2026-08-10-host-plane-ownership-after-presets.zh.md)否决的检查不同。那项检查会拒绝所有未加入 preset 的 Agent,而 SDK server、ACP 桥和 headless bundle 创建的 Agent 全部如此。提供方只在无法提供其配置所选的工具时拒绝创建,并且 `agentPreset: false` 可以去掉对程序运行时的依赖。 + ## 后果 -不组合 preset 的 Host 使用默认配置即可获得 `cua_run_code`;Web 和 Desktop 会话都会组合 preset,不受影响。在不组合 preset 的 Host 上,创建 Agent 时会等待专用程序运行时,其所需服务不可用时创建失败。这类 Host 挂载 PTC 执行器时,`run_code` 内会出现 `tools.cua_run_code`,除非提供方设置 `agentPreset: false`。迁移步骤见[升级指南](../../../../docs/upgrade-guide/v0.2.2-rc.2/cua-agents-without-preset/guide.zh.md)。单元测试覆盖有注册表和没有注册表的组合,以及注册表的加载与卸载;一条已记录的 SDK 会话覆盖组装后的请求和程序执行。 +不组合 preset 的 Host 使用默认配置即可获得 `cua_run_code`;Web 和 Desktop 会话都会组合 preset,不受影响。在不组合 preset 的 Host 上,创建 Agent 时会等待专用程序运行时,其所需服务不可用时创建失败。这类 Host 挂载 PTC 执行器时,`run_code` 内会出现 `tools.cua_run_code`,除非提供方设置 `agentPreset: false`。迁移步骤见[升级指南](../../../../docs/upgrade-guide/v0.2.2-rc.2/cua-agents-without-preset/guide.zh.md)。单元测试覆盖有注册表和没有注册表的组合,以及注册表的加载与卸载;已记录的 SDK 会话和 headless 会话覆盖组装后的请求和程序执行,其中 headless 会话经由 PTC 工具执行器。 diff --git a/packages/experimental/cua-macos/README.i18n.yaml b/packages/experimental/cua-macos/README.i18n.yaml index a64352451b..7e6f21a682 100644 --- a/packages/experimental/cua-macos/README.i18n.yaml +++ b/packages/experimental/cua-macos/README.i18n.yaml @@ -15,8 +15,8 @@ en: 1777e7bf6785f986 zh: e3daac1074ebb74d /deepseek-ai-dsh-cua-macos/use-this-package: - en: 32f8b1c44ab67f58 - zh: b248a7a56644ee3a + en: 356a7552bd976243 + zh: e7e3b5ed6698ce2e /deepseek-ai-dsh-cua-macos/use-this-package/connect-an-external-execution-environment: en: 1ffa65f36ea7ba08 zh: 138d5be800554ed0 diff --git a/packages/experimental/cua-macos/README.md b/packages/experimental/cua-macos/README.md index c90ed6b02c..6b61abb84d 100644 --- a/packages/experimental/cua-macos/README.md +++ b/packages/experimental/cua-macos/README.md @@ -57,7 +57,7 @@ Source builds default to `sourceSigning: ad-hoc`, without creating certificates | Field | Default | Meaning | | --- | --- | --- | -| `agentPreset` | `ptc` | Give this preset raw `cua` and every other Agent, with or without a preset, `cua_run_code`; `false` registers raw `cua` globally. | +| `agentPreset` | `ptc` | Give this preset raw `cua` and every other Agent, with or without a preset, `cua_run_code` while its [program services](../cua/README.md#use-this-package) are available; `false` registers raw `cua` globally. | | `standaloneRunCode.runtime` / `standaloneRunCode.executor` | shared Node / PTC limits | Resource, launch, and nested-call settings for the dedicated CUA runtime; see [CUA](../cua/README.md). | | `screenshotTarget` | unset | Fixed `{ longEdge, maxBytes }` request-image target for screenshots. Unset resolves the target from the Agent's model route and refuses capture when that route declares no image input. | | `allowedApps` | `[]` | Legacy path/signature grants, imported once for removal; they do not authorize new bundle-ID identities. | diff --git a/packages/experimental/cua-macos/README.zh.md b/packages/experimental/cua-macos/README.zh.md index b3e83a1bf0..87c426bfba 100644 --- a/packages/experimental/cua-macos/README.zh.md +++ b/packages/experimental/cua-macos/README.zh.md @@ -57,7 +57,7 @@ pnpm dsh headless --patch packages/experimental/cua-macos/examples/macos.cordis. | 字段 | 默认值 | 含义 | | --- | --- | --- | -| `agentPreset` | `ptc` | 为该 preset 提供原始 `cua`,为其他 Agent(无论是否组合 preset)提供 `cua_run_code`;`false` 表示全局注册原始 `cua`。 | +| `agentPreset` | `ptc` | 为该 preset 提供原始 `cua`,并在[程序工具所需服务](../cua/README.zh.md#use-this-package)可用时为其他 Agent(无论是否组合 preset)提供 `cua_run_code`;`false` 表示全局注册原始 `cua`。 | | `standaloneRunCode.runtime` / `standaloneRunCode.executor` | 共享 Node / PTC 上限 | 专用 CUA 运行时的资源、启动和嵌套调用设置;参见 [CUA](../cua/README.zh.md)。 | | `screenshotTarget` | 未设置 | 截图使用的固定 `{ longEdge, maxBytes }` 请求图片目标。未设置时按 Agent 的模型路由解析,该路由未声明图片输入时拒绝截图。 | | `allowedApps` | `[]` | 旧路径和签名许可,只导入 profile 存储一次供撤销,不授予新 Bundle ID 身份访问权限。 | diff --git a/packages/experimental/cua/src/index.ts b/packages/experimental/cua/src/index.ts index ba4cc3fd19..a2a068f170 100644 --- a/packages/experimental/cua/src/index.ts +++ b/packages/experimental/cua/src/index.ts @@ -39,7 +39,10 @@ export type { CuaPrograms } from './tool-registration.ts' export interface CuaConfig { /** Ask once per live Session before an explicitly requested system-pointer move. */ requireSystemPointerApproval: boolean - /** Preset receiving raw cua; every other Agent, with or without a preset, receives cua_run_code. False registers raw cua globally. */ + /** + * Preset receiving raw cua; every other Agent, with or without a preset, receives cua_run_code while its + * program services are available. False registers raw cua globally. + */ agentPreset: string | false /** Dedicated persistent program limits, independent of the profile's PTC runtime. */ standaloneRunCode: CuaStandaloneRunCodeConfig