MCPcopy
hub / github.com/codeaashu/claude-code / handleFastModeShortcut

Function handleFastModeShortcut

src/commands/fast/fast.tsx:226–247  ·  view source on GitHub ↗
(enable: boolean, getAppState: () => AppState, setAppState: (f: (prev: AppState) => AppState) => void)

Source from the content-addressed store, hash-verified

224 return s.mainLoopModel;
225}
226async function handleFastModeShortcut(enable: boolean, getAppState: () => AppState, setAppState: (f: (prev: AppState) => AppState) => void): Promise<string> {
227 const unavailableReason = getFastModeUnavailableReason();
228 if (unavailableReason) {
229 return `Fast mode unavailable: ${unavailableReason}`;
230 }
231 const {
232 mainLoopModel
233 } = getAppState();
234 applyFastMode(enable, setAppState);
235 logEvent('tengu_fast_mode_toggled', {
236 enabled: enable,
237 source: 'shortcut' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS
238 });
239 if (enable) {
240 const fastIcon = getFastIconString(true);
241 const modelUpdated = !isFastModeSupportedByModel(mainLoopModel) ? ` · model set to ${FAST_MODE_MODEL_DISPLAY}` : '';
242 const pricing = formatModelPricing(getOpus46CostTier(true));
243 return `${fastIcon} Fast mode ON${modelUpdated} · ${pricing}`;
244 } else {
245 return `Fast mode OFF`;
246 }
247}
248export async function call(onDone: LocalJSXCommandOnDone, context: LocalJSXCommandContext, args?: string): Promise<React.ReactNode | null> {
249 if (!isFastModeEnabled()) {
250 return null;

Callers 1

callFunction · 0.85

Calls 8

applyFastModeFunction · 0.85
logEventFunction · 0.85
getFastIconStringFunction · 0.85
formatModelPricingFunction · 0.85
getOpus46CostTierFunction · 0.85
getAppStateFunction · 0.50

Tested by

no test coverage detected