MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / handleEffortCommand

Function handleEffortCommand

apps/kimi-code/src/tui/commands/config.ts:230–251  ·  view source on GitHub ↗
(host: SlashCommandHost, args: string)

Source from the content-addressed store, hash-verified

228}
229
230export async function handleEffortCommand(host: SlashCommandHost, args: string): Promise<void> {
231 const alias = host.state.appState.model;
232 const model = host.state.appState.availableModels[alias];
233 if (model === undefined) {
234 host.showError('No model selected. Run /model to select one first.');
235 return;
236 }
237 const effective = effectiveModelAlias(model);
238 const segments = segmentsFor(effective);
239 const arg = args.trim().toLowerCase();
240 if (arg.length === 0) {
241 showEffortPicker(host, effective, segments);
242 return;
243 }
244 if (!segments.includes(arg)) {
245 host.showError(
246 `Unsupported thinking effort "${arg}" for ${alias}. Available: ${segments.join(', ')}`,
247 );
248 return;
249 }
250 await performModelSwitch(host, alias, arg, true);
251}
252
253function showEffortPicker(
254 host: SlashCommandHost,

Callers 1

Calls 5

segmentsForFunction · 0.90
effectiveModelAliasFunction · 0.85
showEffortPickerFunction · 0.85
performModelSwitchFunction · 0.85
showErrorMethod · 0.65

Tested by

no test coverage detected