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

Method destroy

src/agent/ContextComponent.ts:119–138  ·  view source on GitHub ↗

* 销毁上下文组件

()

Source from the content-addressed store, hash-verified

117 * 销毁上下文组件
118 */
119 public async destroy(): Promise<void> {
120 if (!this.isReady) {
121 return;
122 }
123
124 this.log('销毁上下文组件...');
125
126 try {
127 if (this.contextManager) {
128 await this.contextManager.cleanup();
129 this.contextManager = undefined;
130 }
131
132 this.currentSessionId = undefined;
133 this.isReady = false;
134 this.log('上下文组件已销毁');
135 } catch (error) {
136 this.log(`销毁上下文组件时出错: ${error}`);
137 }
138 }
139
140 /**
141 * 创建新会话

Callers

nothing calls this directly

Calls 2

logMethod · 0.95
cleanupMethod · 0.45

Tested by

no test coverage detected