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

Method reloadSession

packages/agent-core/src/rpc/core-impl.ts:455–478  ·  view source on GitHub ↗
(input: ReloadSessionPayload)

Source from the content-addressed store, hash-verified

453 }
454
455 async reloadSession(input: ReloadSessionPayload): Promise<ResumeSessionResult> {
456 const summary = await this.sessionStore.get(input.sessionId);
457 const active = this.sessions.get(summary.id);
458 if (active?.hasActiveTurn === true) {
459 throw new KimiError(
460 ErrorCodes.TURN_AGENT_BUSY,
461 `Session "${summary.id}" cannot be reloaded while a turn is running`,
462 { details: { sessionId: summary.id } },
463 );
464 }
465
466 this.reloadProviderManager();
467 this.clearRuntimeCache();
468 await this.reloadPlugins({});
469
470 if (active !== undefined) {
471 await active.closeForReload();
472 this.sessions.delete(summary.id);
473 }
474 return this.resumeSessionWithOverrides(
475 { sessionId: summary.id },
476 { forcePluginSessionStartReminder: input.forcePluginSessionStartReminder },
477 );
478 }
479
480 async forkSession(input: ForkSessionPayload): Promise<ResumeSessionResult> {
481 const source = await this.sessionStore.get(input.sessionId);

Callers 1

runtime.test.tsFile · 0.45

Calls 7

reloadProviderManagerMethod · 0.95
clearRuntimeCacheMethod · 0.95
reloadPluginsMethod · 0.95
closeForReloadMethod · 0.80
getMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected