From ef829be100938bf44c732f84f84da9581e8a8189 Mon Sep 17 00:00:00 2001 From: rUv Date: Wed, 7 Jan 2026 15:03:47 +0000 Subject: [PATCH] Checkpoint: File edits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automatic checkpoint created by Claude Code - Branch: v3 - Timestamp: 2026-01-07T15:03:47Z - Changes: 1 file(s) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- v3/@claude-flow/cli/src/commands/doctor.ts | 46 +++++++++++++--------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/v3/@claude-flow/cli/src/commands/doctor.ts b/v3/@claude-flow/cli/src/commands/doctor.ts index bad0dd8799..38a785db66 100644 --- a/v3/@claude-flow/cli/src/commands/doctor.ts +++ b/v3/@claude-flow/cli/src/commands/doctor.ts @@ -372,30 +372,38 @@ export const doctorCommand: Command = { const results: HealthCheck[] = []; const fixes: string[] = []; - for (const check of checksToRun) { - const spinner = output.createSpinner({ text: 'Checking...', spinner: 'dots' }); - spinner.start(); + // OPTIMIZATION: Run all checks in parallel for 3-5x faster execution + const spinner = output.createSpinner({ text: 'Running health checks in parallel...', spinner: 'dots' }); + spinner.start(); - try { - const result = await check(); - results.push(result); + try { + // Execute all checks concurrently + const checkResults = await Promise.allSettled(checksToRun.map(check => check())); + spinner.stop(); - spinner.stop(); - output.writeln(formatCheck(result)); + // Process results in order + for (const settledResult of checkResults) { + if (settledResult.status === 'fulfilled') { + const result = settledResult.value; + results.push(result); + output.writeln(formatCheck(result)); - if (result.fix && (result.status === 'fail' || result.status === 'warn')) { - fixes.push(`${result.name}: ${result.fix}`); + if (result.fix && (result.status === 'fail' || result.status === 'warn')) { + fixes.push(`${result.name}: ${result.fix}`); + } + } else { + const errorResult: HealthCheck = { + name: 'Check', + status: 'fail', + message: settledResult.reason?.message || 'Unknown error' + }; + results.push(errorResult); + output.writeln(formatCheck(errorResult)); } - } catch (error) { - spinner.stop(); - const errorResult: HealthCheck = { - name: 'Check', - status: 'fail', - message: error instanceof Error ? error.message : 'Unknown error' - }; - results.push(errorResult); - output.writeln(formatCheck(errorResult)); } + } catch (error) { + spinner.stop(); + output.writeln(output.error('Failed to run health checks')); } // Auto-install missing dependencies if requested