fix(web): move subagent model switch to Plugins

This commit is contained in:
Dudu-0223
2026-08-27 12:00:01 +08:00
parent f1344a4077
commit f887a8f907
37 changed files with 474 additions and 318 deletions
@@ -19,10 +19,6 @@
- text: 关闭
- heading "模型" [level=2]
- paragraph: 填入各提供方的 API 密钥即可使用其模型。
- region "Subagent 自选模型":
- heading "Subagent 自选模型" [level=3]
- paragraph: 允许新会话为 subagent 选择提供方、模型和推理强度。运行中的会话不会改变。
- switch "允许 subagent 自选模型"
- status: 已保存 minimax-cn。
- list:
- listitem:
@@ -19,10 +19,6 @@
- text: 关闭
- heading "模型" [level=2]
- paragraph: 填入各提供方的 API 密钥即可使用其模型。
- region "Subagent 自选模型":
- heading "Subagent 自选模型" [level=3]
- paragraph: 允许新会话为 subagent 选择提供方、模型和推理强度。运行中的会话不会改变。
- switch "允许 subagent 自选模型"
- list:
- listitem:
- text: minimax-cn
@@ -19,10 +19,6 @@
- text: 关闭
- heading "模型" [level=2]
- paragraph: 填入各提供方的 API 密钥即可使用其模型。
- region "Subagent 自选模型":
- heading "Subagent 自选模型" [level=3]
- paragraph: 允许新会话为 subagent 选择提供方、模型和推理强度。运行中的会话不会改变。
- switch "允许 subagent 自选模型"
- list:
- listitem:
- text: minimax-cn
@@ -19,10 +19,6 @@
- text: 关闭
- heading "模型" [level=2]
- paragraph: 填入各提供方的 API 密钥即可使用其模型。
- region "Subagent 自选模型":
- heading "Subagent 自选模型" [level=3]
- paragraph: 允许新会话为 subagent 选择提供方、模型和推理强度。运行中的会话不会改变。
- switch "允许 subagent 自选模型"
- list
- text: 提供方
- combobox "提供方":
@@ -19,10 +19,6 @@
- text: 关闭
- heading "模型" [level=2]
- paragraph: 填入各提供方的 API 密钥即可使用其模型。
- region "Subagent 自选模型":
- heading "Subagent 自选模型" [level=3]
- paragraph: 允许新会话为 subagent 选择提供方、模型和推理强度。运行中的会话不会改变。
- switch "允许 subagent 自选模型"
- list:
- listitem:
- text: DeepSeek
@@ -19,10 +19,6 @@
- text: 关闭
- heading "模型" [level=2]
- paragraph: 填入各提供方的 API 密钥即可使用其模型。
- region "Subagent 自选模型":
- heading "Subagent 自选模型" [level=3]
- paragraph: 允许新会话为 subagent 选择提供方、模型和推理强度。运行中的会话不会改变。
- switch "允许 subagent 自选模型"
- list:
- listitem:
- text: DeepSeek
@@ -24,6 +24,10 @@
- tab "插件列表"
- tabpanel "插件配置":
- list:
- listitem "Subagent 自选模型":
- heading "Subagent 自选模型" [level=3]
- paragraph: 允许新会话为 subagent 选择提供方、模型和推理强度。运行中的会话不会改变。
- switch "允许 subagent 自选模型"
- listitem:
- 'button "展开设置: 终端"':
- text: 终端 限制 agent 运行的每一条命令。
+19 -2
View File
@@ -75,8 +75,10 @@ describe('web e2e: plugin configuration section', () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-plugin-config-cards'))
const dialog = await openPlugins()
// Every card the shipped web composition exposes: the shell executor, the
// agent loop, and the DeepSeek search provider.
// Every card the shipped web composition exposes: subagent selection, the
// shell executor, the agent loop, and the DeepSeek search provider.
await dialog.getByText('Subagent 自选模型', { exact: true }).waitFor({ timeout: 10_000 })
expect(await dialog.getByRole('switch', { name: '允许 subagent 自选模型' }).getAttribute('aria-checked')).toBe('false')
await dialog.getByText('终端', { exact: true }).waitFor({ timeout: 10_000 })
expect(await dialog.getByText('Agent 循环', { exact: true }).count()).toBe(1)
expect(await dialog.getByText('网页搜索', { exact: true }).count()).toBe(1)
@@ -88,6 +90,21 @@ describe('web e2e: plugin configuration section', () => {
expect(tripwire.pageErrors).toEqual([])
}, 60_000)
it('immediately persists the subagent model-selection preference', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-plugin-config-subagent-model-selection'))
const dialog = await openPlugins()
const toggle = dialog.getByRole('switch', { name: '允许 subagent 自选模型' })
await toggle.click()
await expect.poll(() => toggle.getAttribute('aria-checked'), { timeout: 5_000 }).toBe('true')
await expect.poll(async () => (await settingsDocument()).includes('subagent-model-selection:'), { timeout: 10_000 })
.toBe(true)
expect(await settingsDocument()).toContain('enabled: true')
expect(await dialog.getByRole('status').textContent()).toBe('已保存,新会话将使用此设置。')
expect(tripwire.pageErrors).toEqual([])
}, 60_000)
it('stages an edit and writes it only when saved', async () => {
onTestFailed(() => saveFailureShot(page, 'web-e2e-plugin-config-write'))
const dialog = await openPlugins()