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

Method close

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

Source from the content-addressed store, hash-verified

321 }
322
323 async close(): Promise<void> {
324 try {
325 await Promise.allSettled(
326 Array.from(this.readyAgents(), async (agent) => agent.cron?.stop()),
327 );
328 await this.cancelActiveTurnsOnClose();
329 await this.stopBackgroundTasksOnExit();
330 await this.flushMetadata();
331 await this.triggerSessionEnd('exit');
332 } finally {
333 try {
334 await this.mcp.shutdown();
335 } finally {
336 await this.logHandle?.close();
337 }
338 }
339 }
340
341 async closeForReload(): Promise<void> {
342 try {

Callers 2

Calls 8

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

Tested by

no test coverage detected