()
| 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(); |
no test coverage detected