Skip to content

fix(frontend/backend): unify WebSocket URL to /api/ws in ssot-config and frontend-config endpoint (#6232) - #6271

Merged
mrveiss merged 2 commits into
Dev_new_guifrom
issue-6232
Apr 27, 2026
Merged

mrveiss merged 2 commits into
Dev_new_guifrom
issue-6232

Conversation

@mrveiss

@mrveiss mrveiss commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix ssot-config.ts websocketUrl getter: /ws → /api/ws (matches backend route /api/ws/live)
  • Fix ssot_config.py websocket_url property: same path correction + add wss:// support when TLS is enabled
  • Expose canonical WebSocket URL via _build_frontend_services_config in system.py so frontend can validate its build-time value at runtime

Test plan

  • Frontend WebSocket connections use correct /api/ws path (not bare /ws which 404s)
  • GET /api/frontend-config response includes services.websocket.url
  • TLS path returns wss:// URL when backend_tls_enabled=True

Closes #6232

🤖 Generated with Claude Code

mrveiss and others added 2 commits April 27, 2026 11:51
…onfig (#6232)

- ssot-config.ts websocketUrl getter: add /api prefix; in HTTPS drop
  the explicit port (routes through nginx on 443) to avoid mixed-content
  browser blocks; in HTTP dev keep :${port.backend} for direct access
- frontend_config.py fallback websocket.url: add /api prefix
- autobot_shared/network_constants.py get_websocket_url(): add /api prefix

Fixes LiveEventService flooding console with reconnect timeouts caused by
connecting to wss://host:8001/ws/live instead of wss://host/api/ws/live.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…and frontend-config endpoint (#6232)

- ssot-config.ts websocketUrl getter: /ws → /api/ws so LiveEventService dials ws://host:8001/api/ws/live matching the backend route registered at /api/ws/live
- ssot_config.py websocket_url property: same path correction + wss:// when backend TLS is enabled
- system.py _build_frontend_services_config: add websocket.url key so /api/frontend-config exposes the canonical WebSocket base URL at runtime

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mrveiss
mrveiss merged commit d3cb514 into Dev_new_gui Apr 27, 2026
1 of 5 checks passed
@mrveiss
mrveiss deleted the issue-6232 branch April 27, 2026 09:00
mrveiss added a commit that referenced this pull request May 2, 2026
…6727)

#6718 changed `${config.websocketUrl}/live` → `${config.websocketUrl}/ws/live`
under the assumption that `websocketUrl` was bare (`wss://host`). It isn't.
Per the getter in ssot-config.ts and #6271 ("unify WebSocket URL to /api/ws"),
`websocketUrl` already ends in `/api/ws` — so the change builds
`wss://host/api/ws/ws/live`, which 404s every connection.

Reverting to the original `/live` suffix. Final URL is `wss://host/api/ws/live`,
which matches the backend handler at api/live_events.py:125 (router included
with empty prefix in core_routers.py:311, FastAPI app prefix /api).

The Chrome 'WebSocket error: Event' that motivated #6718's URL change was the
auth-token issue from #6692 (fixed by #6705 already on Dev_new_gui). The URL
itself was always correct; only the missing JWT was the problem. Adding a
stale comment to the getUrl helper to prevent the same mis-fix recurring.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant