MCPcopy Create free account
hub / github.com/tiann/hapi / cleanup

Method cleanup

cli/src/cursor/cursorAcpRemoteLauncher.ts:221–247  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

219 }
220
221 protected async cleanup(): Promise<void> {
222 this.clearAbortHandlers(this.session.client.rpcHandlerManager);
223 this.unregisterModelApplyHandler?.();
224 this.unregisterModelApplyHandler = null;
225
226 if (this.permissionAdapter) {
227 await this.permissionAdapter.cancelAll('Session ended');
228 this.permissionAdapter = null;
229 }
230
231 if (this.extensionAdapter) {
232 await this.extensionAdapter.cancelAll('Session ended');
233 this.extensionAdapter = null;
234 }
235
236 if (this.backend) {
237 await this.backend.disconnect();
238 this.backend = null;
239 }
240
241 if (this.happyServer) {
242 this.happyServer.stop();
243 this.happyServer = null;
244 }
245
246 setCursorAcpModelsSnapshot(null);
247 }
248
249 private handleAgentMessage(message: AgentMessage): void {
250 const converted = convertAgentMessage(message);

Callers

nothing calls this directly

Calls 4

disconnectMethod · 0.65
stopMethod · 0.65
cancelAllMethod · 0.45

Tested by

no test coverage detected