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

Method setMode

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

* Forward an ACP `session/set_mode` request to the underlying SDK * session. * * Phase 12.2 supports the full 4-mode taxonomy (PLAN D9 at * `PLAN.md:85-106`): * * - `'default'` → `setPlanMode(false)` + `setPermission('manual')` * - `'plan'` → `setPlanMode(true)` + `setPerm

(modeId: SessionModeId)

Source from the content-addressed store, hash-verified

438 * will see the rejection and can re-query state).
439 */
440 async setMode(modeId: SessionModeId): Promise<void> {
441 if (!isAcpModeId(modeId)) {
442 throw RequestError.invalidParams({ modeId }, `Unknown sessionModeId: ${modeId}`);
443 }
444 const { plan, permission } = acpModeToToggles(modeId);
445 await this.session.setPlanMode(plan);
446 await this.session.setPermission(permission);
447 this.currentModeIdInternal = modeId;
448 await this.emitConfigOptionUpdate();
449 }
450
451 /**
452 * Push a `config_option_update` session notification carrying the

Callers 2

setSessionModeMethod · 0.45

Calls 5

isAcpModeIdFunction · 0.90
acpModeToTogglesFunction · 0.90
setPlanModeMethod · 0.80
setPermissionMethod · 0.45

Tested by

no test coverage detected