fix: preserve runtime configuration references
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build darwin arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build linux x64 Agent (push) Canceled after 0s
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s

Projects, channels, conversations, and Agent Runtimes now retain dynamic default references while explicit model selections remain pinned. Compatible fallback resolution stays aligned across settings validation, runtime creation, labels, context metrics, DeepSeek Harness browser routing, and remote project saves.

Prepare the bilingual Desktop 0.12.11 release metadata and keep Agent 0.11.22 as the published remote baseline.

Release note: 修复默认模型与 Runtime 配置变化后项目、通道和对话选择失去跟随关系的问题;显式选择仍保持固定,新请求使用当前兼容配置。
This commit is contained in:
mesalogo
2026-09-10 06:27:48 +08:00
parent b01a856bae
commit 21ac8330ea
30 changed files with 378 additions and 139 deletions
+21 -2
View File
@@ -69,6 +69,7 @@ type RuntimeModelSource =
export type RuntimeSelectionDefaultSettings = {
provider: AgentRuntimeSelection['provider']
defaultModelProfileId: string
modelProfiles?: RuntimeSelectionRepairSettings['modelProfiles']
opencodeBaseUrl: string
opencodeEmbedded: boolean
opencodeModelSource?: RuntimeModelSource
@@ -85,6 +86,7 @@ export function getRuntimeSelectionForProvider(
provider: Exclude<AgentRuntimeSelection['provider'], 'auto'>,
_settings: RuntimeSelectionDefaultSettings
): AgentRuntimeSelection {
void _settings
return { provider }
}
@@ -110,8 +112,25 @@ export function getRuntimeSelectionProfileId(
if (selection.provider === 'model') return settings.defaultModelProfileId
const source = selection.provider === 'opencode' ? settings.opencodeModelSource
: selection.provider === 'continue' ? settings.continueModelSource : settings.deepseekHarnessModelSource
return source?.kind === 'default' ? settings.defaultModelProfileId
: source?.kind === 'profile' ? source.profileId : undefined
if (source?.kind === 'profile') return source.profileId
if (source?.kind !== 'default') return undefined
const profiles = settings.modelProfiles ?? []
const isCompatible = (profile: ChannelModelProfile): boolean =>
selection.provider === 'deepseek-harness'
? profile.protocol === 'openai-chat-completions' &&
profile.authentication === 'api-key' &&
Boolean(profile.baseUrl) &&
isDeepSeekHarnessModelProfile({
baseUrl: profile.baseUrl!,
protocol: profile.protocol,
authentication: profile.authentication
})
: Boolean(profile.protocol) &&
profile.protocol !== 'openai-images-generations'
return profiles.find(
(profile) =>
profile.id === settings.defaultModelProfileId && isCompatible(profile)
)?.id ?? profiles.find(isCompatible)?.id
}
export function isChannelModelProfileUsable(