Problem
backend.env.j2 does not set AUTOBOT_AI_STACK_HOST or AUTOBOT_AI_STACK_PORT. The backend falls back to ssot_config.py's default (127.0.0.1) and network_constants.py's ConfigRegistry.get("vm.aistack", "").
In co-located deployments on WSL2-based nodes (e.g. the backend/ai-stack backend node), 127.0.0.1 gets ECONNREFUSED — the correct loopback IP is 10.255.255.254 (WSL2 mirrored networking's lo interface IP). The backend silently cannot reach the AI stack.
How It Was Discovered
During #3491: verified that NetworkConstants.AI_STACK_HOST resolves to 127.0.0.1 (the fallback) since vm.aistack is not in config. Direct socket.connect(('127.0.0.1', 8080)) returned ECONNREFUSED, but nc -zv 10.255.255.254 8080 succeeded.
Fix
Add to backend.env.j2:
# AI Stack (co-located on same host)
AUTOBOT_AI_STACK_HOST={{ ai_stack_host | default('127.0.0.1') }}
AUTOBOT_AI_STACK_PORT={{ ai_stack_port | default(8080) }}
And in the backend role's defaults/main.yml, set ai_stack_host appropriately for co-located deployments. For WSL2 nodes: 10.255.255.254. For normal Linux nodes: 127.0.0.1.
Affected Files
autobot-slm-backend/ansible/roles/backend/templates/backend.env.j2
autobot-slm-backend/ansible/roles/backend/defaults/main.yml
Problem
backend.env.j2does not setAUTOBOT_AI_STACK_HOSTorAUTOBOT_AI_STACK_PORT. The backend falls back tossot_config.py's default (127.0.0.1) andnetwork_constants.py'sConfigRegistry.get("vm.aistack", "").In co-located deployments on WSL2-based nodes (e.g. the backend/ai-stack backend node),
127.0.0.1getsECONNREFUSED— the correct loopback IP is10.255.255.254(WSL2 mirrored networking's lo interface IP). The backend silently cannot reach the AI stack.How It Was Discovered
During #3491: verified that
NetworkConstants.AI_STACK_HOSTresolves to127.0.0.1(the fallback) sincevm.aistackis not in config. Directsocket.connect(('127.0.0.1', 8080))returned ECONNREFUSED, butnc -zv 10.255.255.254 8080succeeded.Fix
Add to
backend.env.j2:And in the backend role's
defaults/main.yml, setai_stack_hostappropriately for co-located deployments. For WSL2 nodes:10.255.255.254. For normal Linux nodes:127.0.0.1.Affected Files
autobot-slm-backend/ansible/roles/backend/templates/backend.env.j2autobot-slm-backend/ansible/roles/backend/defaults/main.yml