From 3afb9b30c7cd51b627074f74d3b907edd13ebeb3 Mon Sep 17 00:00:00 2001 From: nash Date: Thu, 25 Jun 2026 12:22:36 +0500 Subject: [PATCH] fix(aws): don't panic on missing optional cluster_name in ECS log tools analyze_ecs_service_logs and get_ecs_task_logs read cluster_name with a bare type assertion; when the LLM omits the documented-optional field the value is a nil interface and the assertion panics. The dispatcher runs in unrecovered goroutines, so the panic crashes the process. Use the comma-ok form so the existing empty->default fallback handles it. Closes #207 --- internal/aws/llm.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/aws/llm.go b/internal/aws/llm.go index bbec6452..5f043358 100644 --- a/internal/aws/llm.go +++ b/internal/aws/llm.go @@ -1868,7 +1868,7 @@ func (c *Client) executeAWSOperation(ctx context.Context, toolName string, input if !ok { return "", fmt.Errorf("service_name parameter required") } - clusterName := input["cluster_name"].(string) // optional + clusterName, _ := input["cluster_name"].(string) // optional; absent → nil interface if clusterName == "" { clusterName = "default" } @@ -1911,7 +1911,7 @@ func (c *Client) executeAWSOperation(ctx context.Context, toolName string, input if !ok { return "", fmt.Errorf("task_arn parameter required") } - clusterName := input["cluster_name"].(string) + clusterName, _ := input["cluster_name"].(string) // optional; absent → nil interface if clusterName == "" { clusterName = "default" }