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

Method reloadCurrentSessionView

apps/kimi-code/src/tui/kimi-tui.ts:1650–1678  ·  view source on GitHub ↗
(session: Session, statusMessage: string)

Source from the content-addressed store, hash-verified

1648 }
1649
1650 async reloadCurrentSessionView(session: Session, statusMessage: string): Promise<void> {
1651 this.sessionEventUnsubscribe?.();
1652 this.sessionEventUnsubscribe = undefined;
1653 this.clearReverseRpcPanels();
1654 session.setApprovalHandler(undefined);
1655 session.setQuestionHandler(undefined);
1656 this.approvalController.cancelAll('reloading session');
1657 this.questionController.cancelAll('reloading session');
1658
1659 this.resetSessionRuntime();
1660 this.session = session;
1661 this.harness.setTelemetryContext({ sessionId: session.id });
1662 this.registerSessionHandlers(session);
1663 await this.syncRuntimeState(session);
1664 this.updateTerminalTitle();
1665 try {
1666 await this.refreshSkillCommands(session);
1667 await this.refreshPluginCommands(session);
1668 } catch {
1669 /* keep the reloaded session usable even if dynamic skills fail */
1670 }
1671 this.sessionEventHandler.startSubscription();
1672 const resumeState = session.getResumeState();
1673 if (resumeState?.warning !== undefined) {
1674 this.showStatus(`Warning: ${resumeState.warning}`, 'warning');
1675 }
1676 this.showStatus(statusMessage);
1677 void this.showSessionWarnings(session);
1678 }
1679
1680 async createNewSession(): Promise<void> {
1681 if (this.state.appState.isReplaying) {

Callers

nothing calls this directly

Calls 15

clearReverseRpcPanelsMethod · 0.95
resetSessionRuntimeMethod · 0.95
syncRuntimeStateMethod · 0.95
updateTerminalTitleMethod · 0.95
refreshSkillCommandsMethod · 0.95
refreshPluginCommandsMethod · 0.95
showStatusMethod · 0.95
showSessionWarningsMethod · 0.95
cancelAllMethod · 0.80
setTelemetryContextMethod · 0.80
startSubscriptionMethod · 0.80

Tested by

no test coverage detected