diff --git a/server.py b/server.py index 5447db53c..74e3a3e57 100644 --- a/server.py +++ b/server.py @@ -593,7 +593,18 @@ def main() -> None: # Start the gateway session watcher for real-time SSE updates try: from api.gateway_watcher import start_watcher - start_watcher() + + def _start_watcher_safe(): + try: + start_watcher() + except Exception as e: + print(f'[!!] WARNING: Gateway watcher failed to start: {e}', flush=True) + + t = threading.Thread(target=_start_watcher_safe, daemon=True) + t.start() + t.join(timeout=5) + if t.is_alive(): + print('[tip] Gateway watcher still initializing (non-blocking)', flush=True) except Exception as e: print(f'[!!] WARNING: Gateway watcher failed to start: {e}', flush=True)