diff --git a/src/core/Cline.ts b/src/core/Cline.ts index ea5e231a18..59bad31b65 100644 --- a/src/core/Cline.ts +++ b/src/core/Cline.ts @@ -2309,6 +2309,7 @@ export class Cline extends EventEmitter { const { mode, customModes, + apiModelId, customModePrompts, experiments = {} as Record, customInstructions: globalCustomInstructions, @@ -2323,6 +2324,7 @@ export class Cline extends EventEmitter { details += `\n\n# Current Mode\n` details += `${currentMode}\n` details += `${modeDetails.name}\n` + details += `${apiModelId}\n` if (Experiments.isEnabled(experiments ?? {}, EXPERIMENT_IDS.POWER_STEERING)) { details += `${modeDetails.roleDefinition}\n` if (modeDetails.customInstructions) { diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 9633dd11ef..2353dff490 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -1355,6 +1355,7 @@ export class ClineProvider extends EventEmitter implements apiConfiguration: providerSettings, lastShownAnnouncementId: stateValues.lastShownAnnouncementId, customInstructions: stateValues.customInstructions, + apiModelId: stateValues.apiModelId, alwaysAllowReadOnly: stateValues.alwaysAllowReadOnly ?? false, alwaysAllowReadOnlyOutsideWorkspace: stateValues.alwaysAllowReadOnlyOutsideWorkspace ?? false, alwaysAllowWrite: stateValues.alwaysAllowWrite ?? false, diff --git a/webview-ui/src/components/settings/ApiOptions.tsx b/webview-ui/src/components/settings/ApiOptions.tsx index cfc48e8f73..21f40c92af 100644 --- a/webview-ui/src/components/settings/ApiOptions.tsx +++ b/webview-ui/src/components/settings/ApiOptions.tsx @@ -129,6 +129,13 @@ const ApiOptions = ({ [apiConfiguration], ) + // Update apiConfiguration.aiModelId whenever selectedModelId changes. + useEffect(() => { + if (selectedModelId) { + setApiConfigurationField("apiModelId", selectedModelId) + } + }, [selectedModelId, setApiConfigurationField]) + // Debounced refresh model updates, only executed 250ms after the user // stops typing. useDebounce(