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

Method unloadCurrentSession

apps/kimi-code/src/tui/kimi-tui.ts:1506–1520  ·  view source on GitHub ↗
(reason: string)

Source from the content-addressed store, hash-verified

1504 }
1505
1506 private unloadCurrentSession(reason: string): Session | undefined {
1507 const previous = this.session;
1508 this.sessionEventUnsubscribe?.();
1509 this.sessionEventUnsubscribe = undefined;
1510 this.clearReverseRpcPanels();
1511 previous?.setApprovalHandler(undefined);
1512 previous?.setQuestionHandler(undefined);
1513 this.approvalController.cancelAll(reason);
1514 this.questionController.cancelAll(reason);
1515 this.session = undefined;
1516 this.state.swarmModeEntry = undefined;
1517 this.harness.setTelemetryContext({ sessionId: null });
1518 this.setAppState({ goal: null });
1519 return previous;
1520 }
1521
1522 private clearReverseRpcPanels(): void {
1523 for (const dispose of this.reverseRpcDisposers) {

Callers 2

setSessionMethod · 0.95
closeSessionMethod · 0.95

Calls 6

clearReverseRpcPanelsMethod · 0.95
setAppStateMethod · 0.95
cancelAllMethod · 0.80
setTelemetryContextMethod · 0.80
setApprovalHandlerMethod · 0.45
setQuestionHandlerMethod · 0.45

Tested by

no test coverage detected