From ae42cac61ed29b287eeba6e5af6b1d8e464d59ea Mon Sep 17 00:00:00 2001 From: Fusion Date: Fri, 22 May 2026 23:55:51 +0200 Subject: [PATCH] fix: terminal tools always showing as unhealthy For terminal-only tools (no URL), only check container status for overall health instead of requiring tunnel health. Terminal tools do not have tunnels, so tunnel_status stays as 'not_applicable' which was failing the healthy check. --- apps/api/src/api/tool_instances.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/api/src/api/tool_instances.py b/apps/api/src/api/tool_instances.py index 859c87f..568e5fe 100644 --- a/apps/api/src/api/tool_instances.py +++ b/apps/api/src/api/tool_instances.py @@ -1217,10 +1217,14 @@ async def check_instance_tunnel_health( if tunnel_health.get("error"): response["error"] = tunnel_health["error"] - # Overall healthy only if container is running AND tunnel is healthy + # Overall healthy: web tools need running container + healthy tunnel; + # terminal tools only need running container container_healthy = container_info["status"] == "running" - tunnel_healthy = response["tunnel_status"] == "healthy" - response["healthy"] = container_healthy and tunnel_healthy + if instance.url: + tunnel_healthy = response["tunnel_status"] == "healthy" + response["healthy"] = container_healthy and tunnel_healthy + else: + response["healthy"] = container_healthy # If container is not running, override error message if not container_healthy: