* 加载现有会话
(sessionId: string)
| 184 | * 加载现有会话 |
| 185 | */ |
| 186 | public async loadSession(sessionId: string): Promise<boolean> { |
| 187 | if (!this.isReady || !this.contextManager) { |
| 188 | throw new Error('上下文组件未初始化或已被禁用'); |
| 189 | } |
| 190 | |
| 191 | const success = await this.contextManager!.loadSession(sessionId); |
| 192 | if (success) { |
| 193 | this.currentSessionId = sessionId; |
| 194 | this.log(`加载会话成功: ${sessionId}`); |
| 195 | } else { |
| 196 | this.log(`加载会话失败: ${sessionId}`); |
| 197 | } |
| 198 | |
| 199 | return success; |
| 200 | } |
| 201 | |
| 202 | /** |
| 203 | * 获取当前会话ID |
no test coverage detected