Merge pull request #5141 from deepseek-harness/turtle/settings-subagent-label-ffe748ff3c38

fix(client): use 子智能体 on the Chinese Subagent settings page
This commit is contained in:
Turtle authored and GitHub committed 2026-09-24 18:12:29 +08:00
commit 488409e306
15 files changed
+53 -53

No files matched your search

@@ -24,8 +24,8 @@
- button "查看 Agent 循环": Agent 循环
- text: 控制 Agent 派发工具调用的方式。
- listitem:
- button "查看 Subagent": Subagent
- text: 设置 Subagent 的递归层级、数量和模型。
- button "查看 子智能体": 子智能体
- text: 设置子智能体的递归层级、数量和模型。
- listitem:
- button "查看 网页搜索": 网页搜索
- text: 设置 DeepSeek 的搜索提供方。
@@ -1,6 +1,6 @@
- button "返回插件列表": 插件列表
- heading "Subagent" [level=3]
- paragraph: 设置 Subagent 的递归层级、数量和模型。
- heading "子智能体" [level=3]
- paragraph: 设置子智能体的递归层级、数量和模型。
- region "运行限制":
- heading "运行限制" [level=3]
- text: 最大递归深度
@@ -10,16 +10,16 @@
- textbox "最大递归深度":
- /placeholder: ""
- text: "2"
- text: Subagent 并行数量上限
- button "Subagent 并行数量上限说明"
- text: 子智能体并行数量上限
- button "子智能体并行数量上限说明"
- text: 已覆盖
- button "恢复默认"
- textbox "Subagent 并行数量上限":
- textbox "子智能体并行数量上限":
- /placeholder: ""
- text: "12"
- region "模型选择":
- heading "模型选择" [level=3]
- text: 允许 Agent 为 Subagent 选择模型
- switch "允许 Agent 为 Subagent 选择模型"
- paragraph: 关闭后,Subagent 使用配置的默认模型或继承父 Agent 的模型;已选模型会保留。
- text: 允许 Agent 为子智能体选择模型
- switch "允许 Agent 为子智能体选择模型"
- paragraph: 关闭后,子智能体使用配置的默认模型或继承父 Agent 的模型;已选模型会保留。
- button "保存" [disabled]
@@ -24,8 +24,8 @@
- button "查看 Agent 循环": Agent 循环
- text: 控制 Agent 派发工具调用的方式。
- listitem:
- button "查看 Subagent": Subagent
- text: 设置 Subagent 的递归层级、数量和模型。
- button "查看 子智能体": 子智能体
- text: 设置子智能体的递归层级、数量和模型。
- listitem:
- button "查看 网页搜索": 网页搜索
- text: 设置 DeepSeek 的搜索提供方。
@@ -24,8 +24,8 @@
- button "查看 Agent 循环": Agent 循环
- text: 控制 Agent 派发工具调用的方式。
- listitem:
- button "查看 Subagent": Subagent
- text: 设置 Subagent 的递归层级、数量和模型。
- button "查看 子智能体": 子智能体
- text: 设置子智能体的递归层级、数量和模型。
- listitem:
- button "查看 网页搜索": 网页搜索
- text: 设置 DeepSeek 的搜索提供方。
+15 -15
View File
@@ -94,7 +94,7 @@ describe('web e2e: plugin configuration pages', () => {
const official = panel.locator('[data-plugin-group="official"]')
expect(await official.locator('[data-plugin-package]').count()).toBe(OPTIONAL_BUNDLES.length)
expect(await official.locator('[data-plugin-item]').count()).toBe(4)
for (const title of ['终端', 'Agent 循环', 'Subagent', '网页搜索']) {
for (const title of ['终端', 'Agent 循环', '子智能体', '网页搜索']) {
expect(await official.getByRole('button', { name: `查看 ${title}`, exact: true }).count()).toBe(1)
}
// A card carries the one-liner; the fields wait for the page.
@@ -108,9 +108,9 @@ describe('web e2e: plugin configuration pages', () => {
it('saves subagent limits and resets them to the deployment defaults', async () => {
const panel = await openPlugins()
await openPage(panel, 'Subagent')
await openPage(panel, '子智能体')
const depth = panel.getByLabel('最大递归深度', { exact: true })
const capacity = panel.getByLabel('Subagent 并行数量上限', { exact: true })
const capacity = panel.getByLabel('子智能体并行数量上限', { exact: true })
expect(await depth.inputValue()).toBe('1')
expect(await capacity.inputValue()).toBe('8')
await depth.fill('2')
@@ -120,7 +120,7 @@ describe('web e2e: plugin configuration pages', () => {
await expect.poll(settingsDocument).toContain('maxActiveSubagents: 12')
await expect.poll(settingsDocument).toContain('maxDepth: 2')
await openPlugins()
await openPage(panel, 'Subagent')
await openPage(panel, '子智能体')
const snapshot = await captureStableAria(page, '[data-plugin-panel]', scaffold.workspaceCwd)
await compareOrRefreshGolden(join(SNAPSHOT_DIR, 'subagent.expected.md'), snapshot, MODE)
const controlHeight = await depth.evaluate(element => element.getBoundingClientRect().height)
@@ -133,7 +133,7 @@ describe('web e2e: plugin configuration pages', () => {
await panel.getByRole('button', { name: '保存', exact: true }).click()
await expect.poll(() => panel.getByRole('button', { name: '保存', exact: true }).isDisabled()).toBe(true)
await openPlugins()
await openPage(panel, 'Subagent')
await openPage(panel, '子智能体')
expect(await depth.inputValue()).toBe('1')
expect(await capacity.inputValue()).toBe('8')
await panel.getByRole('button', { name: '返回插件列表', exact: true }).click()
@@ -141,7 +141,7 @@ describe('web e2e: plugin configuration pages', () => {
it('opens field explanations with the keyboard and retains unsaved edits', async () => {
const panel = await openPlugins()
await openPage(panel, 'Subagent')
await openPage(panel, '子智能体')
const depth = panel.getByLabel('最大递归深度', { exact: true })
await depth.fill('2')
const depthHelp = panel.getByRole('button', { name: '最大递归深度说明', exact: true })
@@ -149,27 +149,27 @@ describe('web e2e: plugin configuration pages', () => {
await depthHelp.press('Enter')
const depthRules = panel.getByRole('region', { name: '最大递归深度说明', exact: true })
await depthRules.waitFor()
expect(await depthRules.getByText('限制 Agent 创建 Subagent 的递归层级。', { exact: true }).count()).toBe(1)
expect(await depthRules.getByText('限制 Agent 创建子智能体的递归层级。', { exact: true }).count()).toBe(1)
const depthTable = depthRules.getByRole('table', { name: '最大递归深度说明', exact: true })
expect(await depthTable.getByRole('row', { name: '0 禁用 Subagent', exact: true }).count()).toBe(1)
expect(await depthTable.getByRole('row', { name: '1 仅允许主 Agent 创建 Subagent', exact: true }).count()).toBe(1)
expect(await depthTable.getByRole('row', { name: '0 禁用子智能体', exact: true }).count()).toBe(1)
expect(await depthTable.getByRole('row', { name: '1 仅允许主 Agent 创建子智能体', exact: true }).count()).toBe(1)
expect(await depthRules.getByText('如果某个工具单独设置了最大递归深度,以该工具的设置为准。', { exact: true }).count()).toBe(1)
await depthHelp.press('Enter')
expect(await depthRules.count()).toBe(0)
expect(await depth.inputValue()).toBe('2')
await panel.getByRole('button', { name: 'Subagent 并行数量上限说明', exact: true }).click()
const capacityRules = panel.getByRole('region', { name: 'Subagent 并行数量上限说明', exact: true })
expect(await capacityRules.getByText('同一主 Agent 下,所有递归层级同时存活的 Subagent 总数,主 Agent 不计入。达到上限时,新的启动请求会被拒绝。', { exact: true }).count()).toBe(1)
await panel.getByRole('button', { name: '子智能体并行数量上限说明', exact: true }).click()
const capacityRules = panel.getByRole('region', { name: '子智能体并行数量上限说明', exact: true })
expect(await capacityRules.getByText('同一主 Agent 下,所有递归层级同时存活的子智能体总数,主 Agent 不计入。达到上限时,新的启动请求会被拒绝。', { exact: true }).count()).toBe(1)
await panel.getByRole('button', { name: '返回插件列表', exact: true }).click()
await openPage(panel, 'Subagent')
await openPage(panel, '子智能体')
expect(await depth.inputValue()).toBe('1')
})
it('saves limits and the model allowlist together from the shared card', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-plugin-config-subagent-model-selection'))
const panel = await openPlugins()
await openPage(panel, 'Subagent')
const toggle = panel.getByRole('switch', { name: '允许 Agent 为 Subagent 选择模型' })
await openPage(panel, '子智能体')
const toggle = panel.getByRole('switch', { name: '允许 Agent 为子智能体选择模型' })
await panel.getByLabel('最大递归深度', { exact: true }).fill('2')
await toggle.click()
+1 -1
View File
@@ -16,7 +16,7 @@
zh: a8a3dceee2c9e943
/client-web-gui-browser-half/packages:
en: 2a964f7daf3586d5
zh: 726fe18e86157978
zh: 2ca0adf9479a1ac5
/client-web-gui-browser-half/related-documentation:
en: 598d07b07449128f
zh: e8c40708ac0e603e
+1 -1
View File
@@ -77,7 +77,7 @@ kind: "package-group"
| [`ui-settings-models/`](ui-settings-models/README.zh.md) | 提供模型提供方配置与 DeepSeek 引导 | — |
| [`ui-settings-shell/`](ui-settings-shell/README.zh.md) | 在插件页提供终端设置页 | — |
| [`ui-settings-agent-loop/`](ui-settings-agent-loop/README.zh.md) | 在插件页提供 Agent 循环设置页 | — |
| [`ui-settings-subagent/`](ui-settings-subagent/README.zh.md) | 在插件页提供 Subagent 设置页 | — |
| [`ui-settings-subagent/`](ui-settings-subagent/README.zh.md) | 在插件页提供子智能体设置页 | — |
| [`ui-settings-web-search/`](ui-settings-web-search/README.zh.md) | 在插件页提供网页搜索设置页 | — |
| [`ui-plugin-manager/`](ui-plugin-manager/README.zh.md) | 贡献侧栏的“插件”面板:安装、启用、停用、重试与组合已安装的包 | — |
| [`ui-settings-plugin-inventory/`](ui-settings-plugin-inventory/README.zh.md) | 向「插件」设置贡献只读的 Host Loader 清单标签页 | — |
@@ -28,7 +28,7 @@
zh: a9429f047a12bb4c
/deepseek-ai-dsh-client-ui-plugin-manager/use-this-package/configuration-pages:
en: c32019330fd9586d
zh: 98f146f33f2638ed
zh: dd22110abd10159c
/deepseek-ai-dsh-client-ui-plugin-manager/use-this-package/detail-page-extension-points:
en: 87f6d96467dc2383
zh: e0fb91aa4c4d5a12
@@ -51,7 +51,7 @@ Host 将网络失败或超时归因于 GitHub 地址,且提供 npmmirror 时
### 配置页
自带配置的插件把配置渲染在本页而不是设置里,通过本页声明的三个 slot:`plugins.item`(list)用于官方插件,按其 `label` 列在官方分组里;`plugins.bundle.config`(以组合包的包名为键)用于组合包自己的配置,显示在组合包页面的描述与行之间;`plugins.row.config`(以 `<包名>#<行 id>` 为键)用于某一行的配置,这一行由此多出一个**配置**控件,打开该行自己的页面。页面用 `view: 'page'` 渲染带自己保存控件的表单。官方插件卡片还在标题下渲染 `view: 'summary'`;行详情页只在缺少包描述时使用该视图。只有保存才写入:页面负责画标题、图标与面包屑,条目的表单在离开页面时丢弃暂存的修改。安装随附的四个宿主平面配置页——shell 执行器、agent loop、Subagent、DeepSeek 搜索提供方——各来自一个伴生包:[ui-settings-shell](../ui-settings-shell/README.zh.md)、[ui-settings-agent-loop](../ui-settings-agent-loop/README.zh.md)、[ui-settings-subagent](../ui-settings-subagent/README.zh.md) 与 [ui-settings-web-search](../ui-settings-web-search/README.zh.md),在 Host 服务其命名空间期间注册。组合包的浏览器半侧用同样的方式注册:
自带配置的插件把配置渲染在本页而不是设置里,通过本页声明的三个 slot:`plugins.item`(list)用于官方插件,按其 `label` 列在官方分组里;`plugins.bundle.config`(以组合包的包名为键)用于组合包自己的配置,显示在组合包页面的描述与行之间;`plugins.row.config`(以 `<包名>#<行 id>` 为键)用于某一行的配置,这一行由此多出一个**配置**控件,打开该行自己的页面。页面用 `view: 'page'` 渲染带自己保存控件的表单。官方插件卡片还在标题下渲染 `view: 'summary'`;行详情页只在缺少包描述时使用该视图。只有保存才写入:页面负责画标题、图标与面包屑,条目的表单在离开页面时丢弃暂存的修改。安装随附的四个宿主平面配置页——shell 执行器、agent loop、子智能体、DeepSeek 搜索提供方——各来自一个伴生包:[ui-settings-shell](../ui-settings-shell/README.zh.md)、[ui-settings-agent-loop](../ui-settings-agent-loop/README.zh.md)、[ui-settings-subagent](../ui-settings-subagent/README.zh.md) 与 [ui-settings-web-search](../ui-settings-web-search/README.zh.md),在 Host 服务其命名空间期间注册。组合包的浏览器半侧用同样的方式注册:
```tsx ignore-check
ctx.slots.inject('plugins.row.config', () => ctx.slots.register({
@@ -4,19 +4,19 @@
# pnpm run verify-translation-pairing --write packages/client/ui-settings-subagent/README.md
/:
en: 91ac9c71d17a231a
zh: 0e18ebe47ff01aed
zh: c0f89c3d36b51581
/deepseek-ai-dsh-client-ui-settings-subagent:
en: d1fc570c45a5f42e
zh: 01eabcac395bca62
/deepseek-ai-dsh-client-ui-settings-subagent/summary:
en: 4b6bf8db1752b902
zh: 5bdba2bfe06234b4
zh: b8ac25ba6bdb96fb
/deepseek-ai-dsh-client-ui-settings-subagent/table-of-contents:
en: d152484eb41ac6b4
zh: 09388d293f9be9cb
/deepseek-ai-dsh-client-ui-settings-subagent/use-this-package:
en: 09ac65efa3352ef4
zh: 3eda3d453764fdff
zh: 0a6f9e74e304ef1f
/deepseek-ai-dsh-client-ui-settings-subagent/understand-the-implementation:
en: 5124ebc1880ba9fa
zh: 89c2eb2d483962a7
@@ -1,5 +1,5 @@
---
description: "dsh Web 客户端插件页上的 Subagent 设置页:subagent 命名空间的委派深度与并行容量,以及 subagent-model-selection 里 Agent 可选的模型,同一页一次保存。"
description: "dsh Web 客户端插件页上的子智能体设置页:subagent 命名空间的委派深度与并行容量,以及 subagent-model-selection 里 Agent 可选的模型,同一页一次保存。"
kind: "package-reference"
---
@@ -9,7 +9,7 @@ kind: "package-reference"
## 概述
在侧栏打开**插件**,在官方分组里选择 **Subagent**,即可设置委派可以多深、多宽,以及 Agent 可以为 Subagent 选择哪些模型。页面把 Host 的两个命名空间 `subagent` 与 `subagent-model-selection` 收在一次保存之下;Host 服务其中任一命名空间时页面就存在,并只显示被服务的部分。
在侧栏打开**插件**,在官方分组里选择**子智能体**,即可设置委派可以多深、多宽,以及 Agent 可以为子智能体选择哪些模型。页面把 Host 的两个命名空间 `subagent` 与 `subagent-model-selection` 收在一次保存之下;Host 服务其中任一命名空间时页面就存在,并只显示被服务的部分。
## 目录
@@ -25,7 +25,7 @@ kind: "package-reference"
<a id="use-this-package"></a>
## 使用本包
**运行限制**把**最大递归深度**和 **Subagent 并行数量上限**并排放置,窄屏时上下堆叠;每个标签旁的信息按钮展开它的规则——深度是一张两行示例表,容量是计数口径——填了不在范围内的整数会阻止保存并在字段下说明。深度让位于工具自己的上限;容量统计同一主 Agent 下所有层级存活的 Subagent,主 Agent 不计入。
**运行限制**把**最大递归深度**和**子智能体并行数量上限**并排放置,窄屏时上下堆叠;每个标签旁的信息按钮展开它的规则——深度是一张两行示例表,容量是计数口径——填了不在范围内的整数会阻止保存并在字段下说明。深度让位于工具自己的上限;容量统计同一主 Agent 下所有层级存活的子智能体,主 Agent 不计入。
**模型选择**把权限开关和精确的适配器路由一起暂存。开启时至少要选一条路由;关闭会保留已选路由以备后用。Host 已存储但没有适配器公布的路由留在**已保存但当前不可用**分组里并且仍可移除;加载失败的提供方会被报告而不隐藏其他提供方,加载失败时提供**重试**。
@@ -69,23 +69,23 @@ export const zh: Record<SubagentSettingsLocaleKey, string> = {
save: '保存',
saving: '保存中…',
saveFailed: '本部署没有接受这些值,已保留供你修改。',
subagentTitle: 'Subagent',
subagentDescription: '设置 Subagent 的递归层级、数量和模型。',
subagentTitle: '子智能体',
subagentDescription: '设置子智能体的递归层级、数量和模型。',
subagentLimitsTitle: '运行限制',
subagentMaxDepth: '最大递归深度',
subagentDepthHelpLabel: '最大递归深度说明',
subagentDepthHelp: '限制 Agent 创建 Subagent 的递归层级。',
subagentDepthZero: '禁用 Subagent',
subagentDepthOne: '仅允许主 Agent 创建 Subagent',
subagentDepthHelp: '限制 Agent 创建子智能体的递归层级。',
subagentDepthZero: '禁用子智能体',
subagentDepthOne: '仅允许主 Agent 创建子智能体',
subagentDepthOverride: '如果某个工具单独设置了最大递归深度,以该工具的设置为准。',
subagentMaxActive: 'Subagent 并行数量上限',
subagentCapacityHelpLabel: 'Subagent 并行数量上限说明',
subagentCapacityHelp: '同一主 Agent 下,所有递归层级同时存活的 Subagent 总数,主 Agent 不计入。达到上限时,新的启动请求会被拒绝。',
subagentMaxActive: '子智能体并行数量上限',
subagentCapacityHelpLabel: '子智能体并行数量上限说明',
subagentCapacityHelp: '同一主 Agent 下,所有递归层级同时存活的子智能体总数,主 Agent 不计入。达到上限时,新的启动请求会被拒绝。',
subagentDepthInvalid: '请输入不小于 0 的整数。',
subagentCapacityInvalid: '请输入不小于 1 的整数。',
subagentModelSelectionTitle: '模型选择',
subagentModelSelectionToggle: '允许 Agent 为 Subagent 选择模型',
subagentModelSelectionChoose: '开启后,Agent 可以从下方授权模型中,为每个 Subagent 选择提供方、模型和推理强度。仅影响新会话。',
subagentModelSelectionToggle: '允许 Agent 为子智能体选择模型',
subagentModelSelectionChoose: '开启后,Agent 可以从下方授权模型中,为每个子智能体选择提供方、模型和推理强度。仅影响新会话。',
subagentModelSelectionAllowed: 'Agent 可选择的模型',
subagentModelSelectionLoading: '正在加载模型…',
subagentModelSelectionLoadFailed: '无法加载模型。',
@@ -96,7 +96,7 @@ export const zh: Record<SubagentSettingsLocaleKey, string> = {
subagentModelSelectionEmpty: '当前没有模型提供方公布模型。',
subagentModelSelectionRequired: '保存前请至少选择一个模型。',
subagentModelSelectionConflict: '设置已在其他位置更新。请放弃修改后重试。',
subagentModelSelectionOff: '关闭后,Subagent 使用配置的默认模型或继承父 Agent 的模型;已选模型会保留。',
subagentModelSelectionOff: '关闭后,子智能体使用配置的默认模型或继承父 Agent 的模型;已选模型会保留。',
}
/**
@@ -62,7 +62,7 @@ describe('ui-settings-subagent apply', () => {
await vi.waitFor(() => { expect(slots.entries('plugins.item')).toHaveLength(1) })
const entry = slots.entries('plugins.item')[0]!
expect(entry.options).toMatchObject({ id: 'subagent', order: 30 })
expect(resolveSlotLabel(entry.options.label)).toBe('Subagent')
expect(resolveSlotLabel(entry.options.label)).toBe('子智能体')
expect(entry.locale).toBe(NS)
const face = (entry.inject as () => Pick<SubagentCardFace, 'hooks'>)()
expect(Object.keys(face.hooks).sort()).toEqual(['subagentLimitsCard', 'subagentModelSelectionCard'])
+1 -1
View File
@@ -22,7 +22,7 @@
zh: 8c3a793cc29fcc1b
/deepseek-ai-dsh-subagent/use-this-package/delegation-settings:
en: 86c982223fab1a3a
zh: d2136069185736e7
zh: 3d220d8ed84eab9a
/deepseek-ai-dsh-subagent/use-this-package/continuable-capacity:
en: 8346a0de39204c1c
zh: 9dd1d926790e5e8c
+1 -1
View File
@@ -44,7 +44,7 @@ kind: "package-reference"
### 委派设置
**插件 → Subagent** 页面的限制部分编辑 Host 的 `subagent` 设置分节。用户值覆盖本插件的组合配置;恢复默认会删除用户覆盖。`maxDepth` 默认为 `1`,在委派工具自身未配置深度时提供默认值。工具显式指定的深度(包括 `provider-managed`)优先。深度 `0` 禁止继承此设置的工具委派;深度 `1` 只允许直接子代理。修改在下一次委派时生效。直接调用服务的调用方仍自行提供可选的请求深度。
**插件 → 子智能体**页面的限制部分编辑 Host 的 `subagent` 设置分节。用户值覆盖本插件的组合配置;恢复默认会删除用户覆盖。`maxDepth` 默认为 `1`,在委派工具自身未配置深度时提供默认值。工具显式指定的深度(包括 `provider-managed`)优先。深度 `0` 禁止继承此设置的工具委派;深度 `1` 只允许直接子代理。修改在下一次委派时生效。直接调用服务的调用方仍自行提供可选的请求深度。
### 可续接子代理容量