From 0b803468a3ab48ed3769bf8de8575c90104fabf8 Mon Sep 17 00:00:00 2001 From: Iuliia Ivashko Date: Fri, 4 Sep 2026 14:12:56 +0300 Subject: [PATCH] Revert "fix(ui): stop restoring inherited effort from history as an explicit choice" This reverts commit 7519167031d024512ad787d7c4e90f20072d25ec. --- .../ui/src/components/chat/ModelControls.tsx | 27 ++----------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/packages/ui/src/components/chat/ModelControls.tsx b/packages/ui/src/components/chat/ModelControls.tsx index d4b3a486..d09b0004 100644 --- a/packages/ui/src/components/chat/ModelControls.tsx +++ b/packages/ui/src/components/chat/ModelControls.tsx @@ -833,19 +833,10 @@ export const ModelControls: React.FC = ({ candidate: latestLoadedUserChoice, })) { if (savedSessionModel) { - // Same rule as the history restore below: an effort equal to - // the inherited default is not evidence of a choice, so it is - // not recommitted as an explicit override. - const preservedVariant = resolveModelVariantSelection(savedSessionModel.providerId, savedSessionModel.modelId); - const inheritedForPreserved = resolveInheritedVariantForModel( - savedSessionModel.providerId, - savedSessionModel.modelId, - currentAgentName || undefined, - ); applyModelSelectionWithVariant( savedSessionModel.providerId, savedSessionModel.modelId, - preservedVariant === inheritedForPreserved ? undefined : preservedVariant, + resolveModelVariantSelection(savedSessionModel.providerId, savedSessionModel.modelId), currentAgentName || undefined, ); } @@ -857,23 +848,10 @@ export const ModelControls: React.FC = ({ setAgent(latestLoadedUserChoice.agent); } - // Message metadata records the *effective* effort, inherited defaults - // included; only a deviation from what this model would inherit proves - // the user chose it. Restoring an inherited-equal effort as an explicit - // override would pin the default and move the picker off "Default" - // right after every send. - const validHistoricalVariant = latestLoadedUserChoice.variant + const historicalVariant = latestLoadedUserChoice.variant && getModelVariantOptions(latestLoadedUserChoice.providerID, latestLoadedUserChoice.modelID).includes(latestLoadedUserChoice.variant) ? latestLoadedUserChoice.variant : undefined; - const inheritedForRestoredModel = resolveInheritedVariantForModel( - latestLoadedUserChoice.providerID, - latestLoadedUserChoice.modelID, - latestLoadedUserChoice.agent || currentAgentName || undefined, - ); - const historicalVariant = validHistoricalVariant === inheritedForRestoredModel - ? undefined - : validHistoricalVariant; const applyResult = applyModelSelectionWithVariant( latestLoadedUserChoice.providerID, latestLoadedUserChoice.modelID, @@ -908,7 +886,6 @@ export const ModelControls: React.FC = ({ applyModelSelectionWithVariant, getModelVariantOptions, getSessionModelSelection, - resolveInheritedVariantForModel, resolveModelVariantSelection, saveSessionAgentSelection, saveAgentModelVariantForSession,