fix(opencode): keep model switching runtime-hot
This commit is contained in:
@@ -361,10 +361,13 @@ export async function importCurrentUserModelConfig(
|
||||
createdAt: existing?.createdAt ?? now,
|
||||
updatedAt: now,
|
||||
};
|
||||
const shouldRestartRuntime = importedProviderRuntimeShapeChanged(existing, account)
|
||||
|| await importedProviderApiKeyChanged(providerService, existing, accountApiKey);
|
||||
signal.throwIfAborted();
|
||||
const runtimeIsActive = ctx.opencodeManager.getStatus().state !== 'stopped';
|
||||
const runtimeAlreadyUsesLocalProxyApiKey = useLocalAiProxy
|
||||
&& ctx.opencodeManager.getRuntimeGenerationProvenance?.() === 'fresh';
|
||||
const shouldRestartRuntime = importedProviderRuntimeShapeChanged(existing, account)
|
||||
|| (!runtimeAlreadyUsesLocalProxyApiKey
|
||||
&& await importedProviderApiKeyChanged(providerService, existing, accountApiKey));
|
||||
signal.throwIfAborted();
|
||||
const refreshAlreadyPending = lease.isRefreshPending();
|
||||
const runtimeRefreshRequired = runtimeIsActive
|
||||
&& (shouldRestartRuntime || refreshAlreadyPending);
|
||||
|
||||
Reference in New Issue
Block a user