From 801ccaec6a09f133bcc1ea25ac5e32a8e5ab6431 Mon Sep 17 00:00:00 2001 From: suraj-markup Date: Sat, 23 May 2026 21:44:57 +0530 Subject: [PATCH] chore(cli): address PR review feedback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three small follow-ups raised by reviewers on #2039: - Remove stale findFreePort mock in autoCreateConfig test — the function no longer calls findFreePort, so the mock setup was dead code - Drop misleading "⚠ Could not register project in global config" warning printed immediately before rethrowing. The yellow warning visually signalled a recoverable-and-continuing flow, but the function now throws fatally. Let the thrown error propagate to the caller for presentation; the registerProjectInGlobalConfig error message is descriptive enough on its own - Add trailing newline to cli-first-run-config.integration.test.ts Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/cli/__tests__/commands/start.test.ts | 3 --- packages/cli/src/commands/start.ts | 3 --- .../src/cli-first-run-config.integration.test.ts | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/cli/__tests__/commands/start.test.ts b/packages/cli/__tests__/commands/start.test.ts index f7223fec3..1b7a3f593 100644 --- a/packages/cli/__tests__/commands/start.test.ts +++ b/packages/cli/__tests__/commands/start.test.ts @@ -2389,9 +2389,6 @@ describe("start command — autoCreateConfig", () => { vi.mocked(detectAvailableAgents).mockResolvedValue([]); vi.mocked(detectAgentRuntime).mockResolvedValue("claude-code"); - const { findFreePort } = await import("../../src/lib/web-dir.js"); - vi.mocked(findFreePort).mockResolvedValue(3000); - // start.ts uses `import { cwd } from "node:process"` which is intercepted // by the node:process mock defined at the top of this file. mockProcessCwd.mockReturnValue(tmpDir); diff --git a/packages/cli/src/commands/start.ts b/packages/cli/src/commands/start.ts index 5636e8407..4f5d86eb0 100644 --- a/packages/cli/src/commands/start.ts +++ b/packages/cli/src/commands/start.ts @@ -590,9 +590,6 @@ export async function autoCreateConfig(workingDir: string): Promise expect(fromLocal.projects[projectId].path).toBe(repoPath); expect(fromGlobal.projects[projectId].path).toBe(repoPath); }, 90_000); -}); \ No newline at end of file +});