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

Method closeForReload

packages/agent-core/src/session/index.ts:341–354  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

339 }
340
341 async closeForReload(): Promise<void> {
342 try {
343 await Promise.allSettled(
344 Array.from(this.readyAgents(), async (agent) => agent.cron?.stop()),
345 );
346 await this.flushMetadata();
347 } finally {
348 try {
349 await this.mcp.shutdown();
350 } finally {
351 await this.logHandle?.close();
352 }
353 }
354 }
355
356 private async cancelActiveTurnsOnClose(): Promise<void> {
357 const backgroundAgentIds = this.activeBackgroundAgentIds();

Callers 3

init.test.tsFile · 0.80
reloadSessionMethod · 0.80

Calls 5

readyAgentsMethod · 0.95
flushMetadataMethod · 0.95
stopMethod · 0.65
closeMethod · 0.65
shutdownMethod · 0.45

Tested by

no test coverage detected