* Close everything. Used on graceful daemon shutdown (SIGTERM/idle timeout) * and on direct-mode stop. Idempotent.
()
| 182 | * and on direct-mode stop. Idempotent. |
| 183 | */ |
| 184 | stop(): void { |
| 185 | if (this.closed) return; |
| 186 | this.closed = true; |
| 187 | // Detach + terminate the worker pool first so no tool call routes to a |
| 188 | // worker mid-teardown; outstanding pool calls resolve with graceful guidance. |
| 189 | this.toolHandler.setQueryPool(null); |
| 190 | if (this.queryPool) { |
| 191 | void this.queryPool.destroy(); |
| 192 | this.queryPool = null; |
| 193 | } |
| 194 | this.toolHandler.closeAll(); |
| 195 | if (this.cg) { |
| 196 | try { this.cg.close(); } catch { /* ignore */ } |
| 197 | this.cg = null; |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | private async doInitialize(searchFrom: string): Promise<void> { |
| 202 | this.toolHandler.setDefaultProjectHint(searchFrom); |
nothing calls this directly
no test coverage detected