* 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)
| 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. |
no test coverage detected