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

Method emitConfigOptionUpdate

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

* Push a `config_option_update` session notification carrying the * full SessionConfigOption[] snapshot computed from the * adapter-side `currentModelId` + `currentModeId` authoritative state. * * Called from setModel and setMode after the SDK * toggle(s) succe

()

Source from the content-addressed store, hash-verified

467 * that triggered it.
468 */
469 private async emitConfigOptionUpdate(): Promise<void> {
470 if (!this.harness) return;
471 try {
472 const snapshot = await buildSessionConfigOptions(
473 this.harness,
474 this.currentModelIdInternal,
475 this.currentThinkingEnabledInternal,
476 this.currentModeIdInternal,
477 );
478 await this.conn.sessionUpdate(configOptionUpdateNotification(this.id, snapshot));
479 } catch (err) {
480 log.warn('acp: failed to emit config_option_update', {
481 sessionId: this.id,
482 error: err instanceof Error ? err.message : String(err),
483 });
484 }
485 }
486
487 /**
488 * Replay the underlying SDK session's persisted history as a stream

Callers 3

setModelMethod · 0.95
setThinkingMethod · 0.95
setModeMethod · 0.95

Calls 4

warnMethod · 0.65
sessionUpdateMethod · 0.45

Tested by

no test coverage detected