diff --git a/docs/deepseek-harness-runtime-design.md b/docs/deepseek-harness-runtime-design.md index 5deeadb..388f15f 100644 --- a/docs/deepseek-harness-runtime-design.md +++ b/docs/deepseek-harness-runtime-design.md @@ -403,6 +403,7 @@ DeepSeek Harness 首版只使用 GoodBuddy 模型连接: - 服务地址必须是 `https://api.deepseek.com`,且不得包含用户信息。 - 模型名称和服务地址由 Main 传入受控 Host。 - API Key 继续保存在 GoodBuddy 加密设置中。 +- 启动环境提供的部署连接只由 Main 自动解析,不在 Renderer 中显示为可选来源。 不允许选择 Harness 自有的用户配置文件或自定义 Host。Runtime 始终使用随当前 GoodBuddy 版本发布的内置 Host,并通过完整内部能力握手。 diff --git a/src/renderer/src/SettingsPanel.test.tsx b/src/renderer/src/SettingsPanel.test.tsx index 04769aa..a73fc9b 100644 --- a/src/renderer/src/SettingsPanel.test.tsx +++ b/src/renderer/src/SettingsPanel.test.tsx @@ -1372,7 +1372,7 @@ describe('SettingsPanel runtime files', () => { ) }) - it('configures DeepSeek Harness only with Chat Completions or platform settings', async () => { + it('configures DeepSeek Harness with a compatible GoodBuddy connection', async () => { const harnessProfileId = '00000000-0000-4000-8000-000000000051' getRuntime.mockResolvedValueOnce({ @@ -1451,8 +1451,12 @@ describe('SettingsPanel runtime files', () => { }) ).not.toBeInTheDocument() const source = screen.getByLabelText( - 'DeepSeek Harness GoodBuddy 模型连接' + 'DeepSeek Harness DeepSeek 模型连接' ) + expect(screen.queryByRole('radio')).not.toBeInTheDocument() + expect( + screen.queryByText('使用平台 DeepSeek 环境配置') + ).not.toBeInTheDocument() expect( within(source).getByRole('option', { name: '默认模型(不兼容)' }) ).toBeDisabled() @@ -1460,22 +1464,20 @@ describe('SettingsPanel runtime files', () => { within(source).getByRole('option', { name: 'DeepSeek Chat' }) ).not.toBeDisabled() - fireEvent.click( - screen.getByRole('radio', { - name: /使用平台 DeepSeek 环境配置/ - }) - ) fireEvent.click(screen.getByRole('button', { name: '保存设置' })) await waitFor(() => expect(updateRuntime).toHaveBeenCalledWith( expect.objectContaining({ - deepseekHarnessModelSource: { kind: 'platform' } + deepseekHarnessModelSource: { + kind: 'profile', + profileId: harnessProfileId + } }) ) ) }) - it('normalizes an environment-managed DeepSeek profile to the platform source when saving', async () => { + it('keeps an environment-managed source compatible without exposing it as an option', async () => { getRuntime.mockResolvedValueOnce({ ...runtimeSettings, modelBaseUrl: 'https://api.deepseek.com', @@ -1527,11 +1529,17 @@ describe('SettingsPanel runtime files', () => { name: 'DeepSeek Harness(预览)' }) ) - fireEvent.click( - screen.getByRole('radio', { - name: /使用 GoodBuddy 模型连接/ - }) + expect(screen.queryByRole('radio')).not.toBeInTheDocument() + expect( + screen.getByText('管理员预置的 DeepSeek 连接') + ).toBeInTheDocument() + const source = screen.getByLabelText( + 'DeepSeek Harness DeepSeek 模型连接' ) + expect(source).toHaveValue('') + fireEvent.change(source, { + target: { value: runtimeSettings.modelProfiles[0]!.id } + }) fireEvent.click(screen.getByRole('button', { name: '保存设置' })) await waitFor(() => diff --git a/src/renderer/src/SettingsPanel.tsx b/src/renderer/src/SettingsPanel.tsx index b5ee000..0eef3c6 100644 --- a/src/renderer/src/SettingsPanel.tsx +++ b/src/renderer/src/SettingsPanel.tsx @@ -1981,7 +1981,7 @@ export function SettingsPanel({ detecting={detecting} modelConfiguration={ activeRuntimeModelSource.kind === 'platform' - ? t('runtime.deepseekHarness.platformSource') + ? t('runtime.deepseekHarness.managedSource') : activeRuntimeModelProfile ? t('runtime.followGoodBuddy', { name: modelProfileDisplayName( @@ -1998,100 +1998,48 @@ export function SettingsPanel({ runtime: 'DeepSeek Harness' })} /> -
- {t('runtime.sourceLegend')} - - -
- {deepseekHarnessModelSource.kind === 'profile' && ( -