From 784e62c5353831a00a3bc8e34c43546c68fa75dc Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Tue, 16 Jun 2026 22:53:27 -0700 Subject: [PATCH] fix(doctor): guard nullable engine in supervisor DB-lock fallback (#2227) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to the supervisor-visibility commit: doctor's engine binding is BrainEngine | null, so the inspectLock fallback must guard on a non-null engine (tsc TS2345). No behavior change — a null engine simply skips the DB-lock probe and falls back to the pidfile reading, as before. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/commands/doctor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/doctor.ts b/src/commands/doctor.ts index fe98bc920..f3b67ad30 100644 --- a/src/commands/doctor.ts +++ b/src/commands/doctor.ts @@ -4401,7 +4401,7 @@ export async function buildChecks( // Consult the queue-scoped DB singleton lock (#1849, HOME-independent) before // warning. PID-reuse-safe (isLockHolderLive keys on lock freshness). let detectedViaDbLock = false; - if (!pidfileRunning) { + if (!pidfileRunning && engine) { try { const { inspectLock, isLockHolderLive } = await import('../core/db-lock.ts'); const { supervisorLockId, SUPERVISOR_LOCK_TTL_MIN } = await import('../core/minions/supervisor.ts');