* 清理资源
()
| 372 | * 清理资源 |
| 373 | */ |
| 374 | async cleanup(): Promise<void> { |
| 375 | if (this.currentSessionId) { |
| 376 | await this.saveCurrentSession(); |
| 377 | } |
| 378 | |
| 379 | this.memory.clear(); |
| 380 | this.cache.clear(); |
| 381 | await this.persistent.cleanupOldSessions(); |
| 382 | |
| 383 | this.currentSessionId = null; |
| 384 | console.log('上下文管理器资源清理完成'); |
| 385 | } |
| 386 | |
| 387 | // 私有方法 |
| 388 |
no test coverage detected