From b0a25afa73e487d21f9f6f5d218417a999a6106a Mon Sep 17 00:00:00 2001 From: JasonOA888 Date: Fri, 13 Mar 2026 01:58:43 +0800 Subject: [PATCH] fix(cli): warn when services partially start instead of false success MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #1102 ## Root Cause CLI always printed '✓ All services started' after asyncio.run(), regardless of whether docling or container services actually started successfully. ## Solution - Return (all_success, failed_services) from async _inner() - Check status after completion - Show warning on partial startup instead of false success - Guide users to check status for details ## Changes - src/tui/cli.py: _start_services_cli() ## Testing - [x] All services success → '✓ All services started' - [x] Docling fails → '⚠ Partial startup: 1 service(s) failed' - [x] Container fails → Warning shown, no false success ## Impact Users now get accurate feedback when startup is incomplete. --- src/tui/cli.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/tui/cli.py b/src/tui/cli.py index a2e4ea773..0675632f8 100644 --- a/src/tui/cli.py +++ b/src/tui/cli.py @@ -345,6 +345,9 @@ def _start_services_cli( console.print("Starting OpenRAG services...", style="bold") async def _inner(): + all_success = True + failed_services = [] + # Start container services if container_manager.is_available(): async for item in container_manager.start_services(): @@ -359,7 +362,8 @@ async def _inner(): console.print(f" {message}") if not success and "error" in message.lower(): - console.print(f" [red]✗ {message}[/red]") + all_success = False + failed_services.append(message) else: console.print(" [yellow]No container runtime available[/yellow]") @@ -369,11 +373,19 @@ async def _inner(): if success: console.print(f" {message}") else: - console.print(f" [yellow]{message}[/yellow]") + all_success = False + failed_services.append(f"docling: {message}") + console.print(f" [red]✗ {message}[/red]") + + return all_success, failed_services try: - asyncio.run(_inner()) - console.print("[green]✓ All services started[/green]") + all_success, failed_services = asyncio.run(_inner()) + if all_success: + console.print("[green]✓ All services started[/green]") + else: + console.print(f"[yellow]⚠ Partial startup: {len(failed_services)} service(s) failed[/yellow]") + console.print("[yellow] Run 'Show status' for details[/yellow]") except Exception as e: console.print(f"[red]✗ Error starting services: {e}[/red]")