From 32345ba856ccee35b2da010cb9e8d325cbaeee21 Mon Sep 17 00:00:00 2001 From: Priyanshu Choudhary <57816400+Priyanchew@users.noreply.github.com> Date: Tue, 5 May 2026 02:41:01 +0530 Subject: [PATCH] fix(cli): satisfy lint on ao open changes - replace inline `import("node:child_process")` type annotation in vi.mock with a top-of-file `import type * as ChildProcess` (consistent-type-imports) - drop the `[]` initializer on `sessionsToOpen` since every branch assigns before any read (no-useless-assignment) Co-Authored-By: Claude Opus 4.7 --- packages/cli/__tests__/commands/open.test.ts | 3 ++- packages/cli/src/commands/open.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/cli/__tests__/commands/open.test.ts b/packages/cli/__tests__/commands/open.test.ts index 817bff448..94a69a4ca 100644 --- a/packages/cli/__tests__/commands/open.test.ts +++ b/packages/cli/__tests__/commands/open.test.ts @@ -1,3 +1,4 @@ +import type * as ChildProcess from "node:child_process"; import { describe, it, expect, vi, beforeEach, afterEach } from "vitest"; const { @@ -21,7 +22,7 @@ const { })); vi.mock("node:child_process", async (importOriginal) => { - const actual = await importOriginal(); + const actual = await importOriginal(); return { ...actual, spawn: mockSpawn }; }); diff --git a/packages/cli/src/commands/open.ts b/packages/cli/src/commands/open.ts index 61f4c13b4..60bd95fbb 100644 --- a/packages/cli/src/commands/open.ts +++ b/packages/cli/src/commands/open.ts @@ -91,7 +91,7 @@ export function registerOpen(program: Command): void { // live sessions. For a named lookup the user is asking about a specific // session, so we keep terminated ones in scope and open the dashboard // so they can read the transcript even if the agent has died. - let sessionsToOpen: Session[] = []; + let sessionsToOpen: Session[]; if (!target || target === "all") { sessionsToOpen = all.filter((s) => !isTerminalSession(s));