MCPcopy Create free account
hub / github.com/oboard/claude-code-rev / onChangeMainModelConfig

Function onChangeMainModelConfig

src/components/Settings/Config.tsx:208–236  ·  view source on GitHub ↗
(value: string | null)

Source from the content-addressed store, hash-verified

206 const envOverrideProviderId = getEnvironmentProviderOverrideId();
207 const providerMenuValue = envOverrideProviderId ? `${activeProviderConfig.name} (env override)` : activeProviderConfig.name;
208 function onChangeMainModelConfig(value: string | null): void {
209 const previousModel = mainLoopModel;
210 logEvent('tengu_config_model_changed', {
211 from_model: previousModel as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
212 to_model: value as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS
213 });
214 setAppState(prev => ({
215 ...prev,
216 mainLoopModel: value,
217 mainLoopModelForSession: null
218 }));
219 setChanges(prev_0 => {
220 const valStr = modelDisplayString(value) + (isBilledAsExtraUsage(value, false, isOpus1mMergeEnabled()) ? ' · Billed as extra usage' : '');
221 if ('model' in prev_0) {
222 const {
223 model,
224 ...rest
225 } = prev_0;
226 return {
227 ...rest,
228 model: valStr
229 };
230 }
231 return {
232 ...prev_0,
233 model: valStr
234 };
235 });
236 }
237 const handleProviderSelectionComplete = useCallback((result: ProviderSelectionResult) => {
238 setShowSubmenu(null);
239 setTabsHidden(false);

Callers 1

ConfigFunction · 0.85

Calls 4

logEventFunction · 0.85
modelDisplayStringFunction · 0.85
isBilledAsExtraUsageFunction · 0.85
isOpus1mMergeEnabledFunction · 0.85

Tested by

no test coverage detected