From fee584673daf6817bd0d8d3867fda4ee3bd015c0 Mon Sep 17 00:00:00 2001 From: Raven Scott Date: Fri, 11 Sep 2026 16:24:35 -0400 Subject: [PATCH] Close QVAC after GPU preflight --- daemon/gpu-doctor.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/daemon/gpu-doctor.js b/daemon/gpu-doctor.js index 28c90c2..135d921 100644 --- a/daemon/gpu-doctor.js +++ b/daemon/gpu-doctor.js @@ -21,4 +21,20 @@ try { } catch (error) { console.error(`gpu-doctor: ${error.message}`); process.exitCode = 1; +} finally { + // Resource discovery initializes QVAC handles even without loading a model. + // This one-shot command owns them and must close them before returning to + // first-run. Bound cleanup in case a native handle never settles. + const watchdog = setTimeout(() => { + console.error('gpu-doctor: QVAC cleanup timed out'); + process.exit(1); + }, 5000); + try { + await Agent.engine.close(); + } finally { + clearTimeout(watchdog); + } + // Bare addons may retain handles after close; this diagnostic has no more + // work to do. Never put this exit in the shared daemon/runtime lifecycle. + if (globalThis.Bare) Bare.exit(process.exitCode || 0); }