* Close everything. Used on graceful daemon shutdown (SIGTERM/idle timeout) * and on direct-mode stop. Idempotent.
()
| 201 | * and on direct-mode stop. Idempotent. |
| 202 | */ |
| 203 | stop(): void { |
| 204 | if (this.closed) return; |
| 205 | this.closed = true; |
| 206 | // Detach + terminate the worker pool first so no tool call routes to a |
| 207 | // worker mid-teardown; outstanding pool calls resolve with graceful guidance. |
| 208 | this.toolHandler.setQueryPool(null); |
| 209 | if (this.queryPool) { |
| 210 | void this.queryPool.destroy(); |
| 211 | this.queryPool = null; |
| 212 | } |
| 213 | this.toolHandler.closeAll(); |
| 214 | if (this.cg) { |
| 215 | try { this.cg.close(); } catch { /* ignore */ } |
| 216 | this.cg = null; |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | private async doInitialize(searchFrom: string): Promise<void> { |
| 221 | this.toolHandler.setDefaultProjectHint(searchFrom); |
nothing calls this directly
no test coverage detected