From 3616fd4a1d29fa9875c298b558e3cb6cfa6a0075 Mon Sep 17 00:00:00 2001 From: Quinn Ftw Date: Mon, 29 Dec 2025 03:22:18 -0800 Subject: [PATCH] fix(conversation-assistant): fix service registry discovery in install.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change from GET with query params to POST with JSON body - Fix response parsing: 'instances' → 'services' to match API - Prefer host (domain) over ipAddress for proper SSL/routing - Auto-detect https scheme for domain names 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../conversation-assistant/macos/install.sh | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/features/conversation-assistant/macos/install.sh b/features/conversation-assistant/macos/install.sh index 6ed20a34e..5ec53c6c6 100755 --- a/features/conversation-assistant/macos/install.sh +++ b/features/conversation-assistant/macos/install.sh @@ -158,22 +158,30 @@ discover_service_url() { # Try to discover conversation-assistant service from service-registry local registry_url="${SERVICE_REGISTRY_URL:-http://localhost:30000}" - # Try to discover the service + # Try to discover the service (POST with JSON body) local discovery_response - discovery_response=$(curl -s --connect-timeout 2 "$registry_url/registry/discover?serviceName=conversation-assistant&healthy=true" 2>/dev/null || echo "") + discovery_response=$(curl -s --connect-timeout 2 \ + -X POST \ + -H "Content-Type: application/json" \ + -d '{"serviceName":"conversation-assistant","healthy":true}' \ + "$registry_url/registry/discover" 2>/dev/null || echo "") if [[ -n "$discovery_response" && "$discovery_response" != *"error"* ]]; then - # Parse the first instance's URL from JSON response + # Parse the first service's URL from JSON response local service_url service_url=$(echo "$discovery_response" | python3 -c " import sys, json try: data = json.load(sys.stdin) - if data.get('instances') and len(data['instances']) > 0: - inst = data['instances'][0] - ip = inst.get('ipAddress', 'localhost') - port = inst.get('port', 3105) - print(f'http://{ip}:{port}') + services = data.get('services', []) + if services and len(services) > 0: + svc = services[0] + # Prefer host (domain) over ipAddress for proper SSL/routing + host = svc.get('host') or svc.get('ipAddress', 'localhost') + port = svc.get('port', 3105) + # Use https if host is a domain name + scheme = 'https' if '.' in host and not host.replace('.','').isdigit() else 'http' + print(f'{scheme}://{host}:{port}') except: pass " 2>/dev/null)