()
| 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); |
nothing calls this directly
no test coverage detected