Flatten the profile fold's base selection and drop an unused import

This commit is contained in:
Mohamed Boudra
2026-11-08 13:00:18 +01:00
parent c6f2a782bb
commit b91a4f5bc9
2 changed files with 3 additions and 7 deletions
@@ -183,12 +183,9 @@ export function foldProfileFeatureValues<T extends ProfileOptionFields>(input: {
if (featureValues) return { ...rest, options: { ...featureValues, ...ownOptions } };
return ownOptions ? { ...rest, options: ownOptions } : rest;
}
const base =
rest.options !== undefined
? ownOptions
: stored?.provider === rest.provider
? convert(provider, stored?.options)
: undefined;
const storedOptions =
stored?.provider === rest.provider ? convert(provider, stored?.options) : undefined;
const base = rest.options !== undefined ? ownOptions : storedOptions;
const options = applyProviderOptionsPatch({ options: base, patch: featureValues ?? {} });
return Object.keys(options).length > 0 ? { ...rest, options } : { ...rest, options: undefined };
}
@@ -5,7 +5,6 @@ import { createTestLogger } from "../../test-utils/test-logger.js";
import type {
AgentClient,
AgentDraftControls,
AgentOptionControl,
AgentModelDefinition,
AgentMode,
AgentSessionConfig,