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

Method setModel

packages/acp-adapter/src/session.ts:348–359  ·  view source on GitHub ↗

* Forward an ACP `session/set_model` (`unstable_setSessionModel`) * request to the underlying SDK session. * * ACP allows model identifiers like `"kimi-k2,thinking"` where the * `,thinking` suffix signals "always-thinking" mode (mirrors the * Python ref's `_ModelIDConv.from_acp_model_

(modelId: ModelId)

Source from the content-addressed store, hash-verified

346 * `AcpServer.unstable_setSessionModel` decides how to translate them.
347 */
348 async setModel(modelId: ModelId): Promise<void> {
349 const suffix = ',thinking';
350 const hasSuffix = modelId.endsWith(suffix);
351 const baseKey = hasSuffix ? modelId.slice(0, -suffix.length) : modelId;
352 await this.session.setModel(baseKey);
353 if (hasSuffix && typeof this.session.setThinking === 'function') {
354 await this.session.setThinking(await this.thinkingOnEffort());
355 this.currentThinkingEnabledInternal = true;
356 }
357 this.currentModelIdInternal = baseKey;
358 await this.emitConfigOptionUpdate();
359 }
360
361 /**
362 * Forward an ACP thinking-toggle change to the underlying SDK.

Callers 2

Calls 3

thinkingOnEffortMethod · 0.95
setThinkingMethod · 0.45

Tested by

no test coverage detected