From ba04f506567f91afceb096fdabb2f1c6545f2877 Mon Sep 17 00:00:00 2001 From: Prateek Date: Wed, 18 Feb 2026 12:22:09 +0530 Subject: [PATCH] fix: lsof flags, dry-run error guard, remove unused --regenerate 1. Fix lsof flag from -Fn to -Ffn so findProcessWebDir() actually gets the file descriptor field needed to match "fcwd" markers. 2. Dry-run cleanup now guards "no sessions" message with both killed.length === 0 AND errors.length === 0, matching the non-dry-run branch behavior. 3. Remove unused --regenerate CLI option from ao start (defined but never referenced in the action body). Co-Authored-By: Claude Sonnet 4.6 --- packages/cli/src/commands/session.ts | 14 ++++++++------ packages/cli/src/commands/start.ts | 2 -- packages/cli/src/lib/dashboard-rebuild.ts | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/cli/src/commands/session.ts b/packages/cli/src/commands/session.ts index 9a3fb8701..1d872a214 100644 --- a/packages/cli/src/commands/session.ts +++ b/packages/cli/src/commands/session.ts @@ -116,17 +116,19 @@ export function registerSession(program: Command): void { } } - if (result.killed.length === 0) { + if (result.killed.length === 0 && result.errors.length === 0) { console.log(chalk.dim(" No sessions to clean up.")); } else { for (const id of result.killed) { console.log(chalk.yellow(` Would kill ${id}`)); } - console.log( - chalk.dim( - `\nDry run complete. ${result.killed.length} session${result.killed.length !== 1 ? "s" : ""} would be cleaned.`, - ), - ); + if (result.killed.length > 0) { + console.log( + chalk.dim( + `\nDry run complete. ${result.killed.length} session${result.killed.length !== 1 ? "s" : ""} would be cleaned.`, + ), + ); + } } } else { const result = await sm.cleanup(opts.project); diff --git a/packages/cli/src/commands/start.ts b/packages/cli/src/commands/start.ts index 672c99a01..a95356b72 100644 --- a/packages/cli/src/commands/start.ts +++ b/packages/cli/src/commands/start.ts @@ -117,7 +117,6 @@ export function registerStart(program: Command): void { .description("Start orchestrator agent and dashboard for a project") .option("--no-dashboard", "Skip starting the dashboard server") .option("--no-orchestrator", "Skip starting the orchestrator agent") - .option("--regenerate", "Regenerate CLAUDE.orchestrator.md") .option("--rebuild", "Clean and rebuild dashboard before starting") .action( async ( @@ -125,7 +124,6 @@ export function registerStart(program: Command): void { opts?: { dashboard?: boolean; orchestrator?: boolean; - regenerate?: boolean; rebuild?: boolean; }, ) => { diff --git a/packages/cli/src/lib/dashboard-rebuild.ts b/packages/cli/src/lib/dashboard-rebuild.ts index 3b192e1ba..b6de94011 100644 --- a/packages/cli/src/lib/dashboard-rebuild.ts +++ b/packages/cli/src/lib/dashboard-rebuild.ts @@ -26,7 +26,7 @@ export async function findRunningDashboardPid(port: number): Promise { - const lsofDetail = await execSilent("lsof", ["-p", pid, "-Fn"]); + const lsofDetail = await execSilent("lsof", ["-p", pid, "-Ffn"]); if (!lsofDetail) return null; // lsof -Fn outputs lines like "n/path/to/cwd" — the cwd entry follows "fcwd"