MCPcopy Create free account
hub / github.com/echoVic/blade-code / loadSession

Method loadSession

src/agent/ContextComponent.ts:186–200  ·  view source on GitHub ↗

* 加载现有会话

(sessionId: string)

Source from the content-addressed store, hash-verified

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

Callers 2

createSessionMethod · 0.95
loadContextSessionMethod · 0.45

Calls 1

logMethod · 0.95

Tested by

no test coverage detected