Revert "fix(ui): stop restoring inherited effort from history as an explicit choice"
This reverts commit 7519167031.
This commit is contained in:
@@ -833,19 +833,10 @@ export const ModelControls: React.FC<ModelControlsProps> = ({
|
|||||||
candidate: latestLoadedUserChoice,
|
candidate: latestLoadedUserChoice,
|
||||||
})) {
|
})) {
|
||||||
if (savedSessionModel) {
|
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(
|
applyModelSelectionWithVariant(
|
||||||
savedSessionModel.providerId,
|
savedSessionModel.providerId,
|
||||||
savedSessionModel.modelId,
|
savedSessionModel.modelId,
|
||||||
preservedVariant === inheritedForPreserved ? undefined : preservedVariant,
|
resolveModelVariantSelection(savedSessionModel.providerId, savedSessionModel.modelId),
|
||||||
currentAgentName || undefined,
|
currentAgentName || undefined,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -857,23 +848,10 @@ export const ModelControls: React.FC<ModelControlsProps> = ({
|
|||||||
setAgent(latestLoadedUserChoice.agent);
|
setAgent(latestLoadedUserChoice.agent);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Message metadata records the *effective* effort, inherited defaults
|
const historicalVariant = latestLoadedUserChoice.variant
|
||||||
// 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
|
|
||||||
&& getModelVariantOptions(latestLoadedUserChoice.providerID, latestLoadedUserChoice.modelID).includes(latestLoadedUserChoice.variant)
|
&& getModelVariantOptions(latestLoadedUserChoice.providerID, latestLoadedUserChoice.modelID).includes(latestLoadedUserChoice.variant)
|
||||||
? latestLoadedUserChoice.variant
|
? latestLoadedUserChoice.variant
|
||||||
: undefined;
|
: undefined;
|
||||||
const inheritedForRestoredModel = resolveInheritedVariantForModel(
|
|
||||||
latestLoadedUserChoice.providerID,
|
|
||||||
latestLoadedUserChoice.modelID,
|
|
||||||
latestLoadedUserChoice.agent || currentAgentName || undefined,
|
|
||||||
);
|
|
||||||
const historicalVariant = validHistoricalVariant === inheritedForRestoredModel
|
|
||||||
? undefined
|
|
||||||
: validHistoricalVariant;
|
|
||||||
const applyResult = applyModelSelectionWithVariant(
|
const applyResult = applyModelSelectionWithVariant(
|
||||||
latestLoadedUserChoice.providerID,
|
latestLoadedUserChoice.providerID,
|
||||||
latestLoadedUserChoice.modelID,
|
latestLoadedUserChoice.modelID,
|
||||||
@@ -908,7 +886,6 @@ export const ModelControls: React.FC<ModelControlsProps> = ({
|
|||||||
applyModelSelectionWithVariant,
|
applyModelSelectionWithVariant,
|
||||||
getModelVariantOptions,
|
getModelVariantOptions,
|
||||||
getSessionModelSelection,
|
getSessionModelSelection,
|
||||||
resolveInheritedVariantForModel,
|
|
||||||
resolveModelVariantSelection,
|
resolveModelVariantSelection,
|
||||||
saveSessionAgentSelection,
|
saveSessionAgentSelection,
|
||||||
saveAgentModelVariantForSession,
|
saveAgentModelVariantForSession,
|
||||||
|
|||||||
Reference in New Issue
Block a user