From fcc2dc058dda15440260e6abc02e11debb2b6054 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Tue, 10 Nov 2026 04:28:29 -0500 Subject: [PATCH] chore(orchestration): annotate the remote count query's row type --- .../db/remote-owned/remote-dispatch-records.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/runtime/orchestration/db/remote-owned/remote-dispatch-records.ts b/src/main/runtime/orchestration/db/remote-owned/remote-dispatch-records.ts index 24a0cc0c971..3a045909fcb 100644 --- a/src/main/runtime/orchestration/db/remote-owned/remote-dispatch-records.ts +++ b/src/main/runtime/orchestration/db/remote-owned/remote-dispatch-records.ts @@ -70,11 +70,10 @@ export function listRemoteDispatches( export function countRemoteDispatches(db: OrchestrationDb, runId: string | undefined): number { // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: COUNT(*) returns one number. - return ( - db.db - .prepare('SELECT COUNT(*) AS count FROM remote_dispatches WHERE (? IS NULL OR run_id = ?)') - .get(runId ?? null, runId ?? null) as { count: number } - ).count + const row = db.db + .prepare('SELECT COUNT(*) AS count FROM remote_dispatches WHERE (? IS NULL OR run_id = ?)') + .get(runId ?? null, runId ?? null) as { count: number } + return row.count } /** Identity only: which server runs the Dispatch and for which Task. State comes from the server's queue. */