fix: align DeepSeek Harness model selection

DeepSeek Harness previously required a separate Runtime model selection when no administrator-provided connection was available, even if the user had already selected a compatible GoodBuddy model. It now prefers the administrator connection, then follows the compatible default model or first compatible connection across conversations, projects, and messaging channels.

Release note: 修复 DeepSeek Harness 未自动使用已选兼容模型的问题;没有管理员预置连接时,现在会跟随当前默认或首个兼容模型,无需再到 Harness 页面重复指定。
This commit is contained in:
mesalogo
2026-09-02 16:45:42 +08:00
parent 42cbfa43f1
commit 5fac1d3c41
6 changed files with 123 additions and 14 deletions
+72
View File
@@ -408,6 +408,78 @@ describe('RuntimeSettingsStore', () => {
})
})
it('uses a compatible GoodBuddy model for Harness when no platform model is configured', async () => {
const profileId = '00000000-0000-4000-8000-000000000044'
const { store } = await createStore()
await store.update(
settings({
modelProfiles: [
{
id: profileId,
name: 'OpenAI-compatible gateway',
baseUrl: 'https://gateway.example/openai/v1',
modelName: 'qwen-plus',
protocol: 'openai-chat-completions',
authentication: 'api-key',
imageGenerationQuality: 'auto',
apiKey: { action: 'replace', value: 'deepseek-secret' }
}
],
defaultModelProfileId: profileId
})
)
await expect(store.getPublicSettings()).resolves.toMatchObject({
deepseekHarnessModelSource: { kind: 'profile', profileId },
configured: {
deepseekHarnessModelSource: { kind: 'platform' }
}
})
await expect(store.getResolvedSettings()).resolves.toMatchObject({
deepseekHarnessModelProfile: {
id: profileId,
apiKey: 'deepseek-secret'
}
})
})
it('uses the first compatible Harness model when the default model is incompatible', async () => {
const defaultId = '00000000-0000-4000-8000-000000000043'
const harnessId = '00000000-0000-4000-8000-000000000044'
const { store } = await createStore()
await store.update(
settings({
modelProfiles: [
{
id: defaultId,
name: 'Anthropic model',
baseUrl: 'https://anthropic.example',
modelName: 'claude',
protocol: 'anthropic-messages',
authentication: 'api-key',
imageGenerationQuality: 'auto',
apiKey: { action: 'replace', value: 'anthropic-secret' }
},
{
id: harnessId,
name: 'OpenAI-compatible gateway',
baseUrl: 'https://gateway.example/openai/v1',
modelName: 'qwen-plus',
protocol: 'openai-chat-completions',
authentication: 'api-key',
imageGenerationQuality: 'auto',
apiKey: { action: 'replace', value: 'deepseek-secret' }
}
],
defaultModelProfileId: defaultId
})
)
await expect(store.getResolvedSettings()).resolves.toMatchObject({
deepseekHarnessModelProfile: { id: harnessId }
})
})
it('migrates DeepSeek Harness to controlled platform mode and stores a compatible profile', async () => {
const { filePath, store } = await createStore()
await store.update(settings())