diff --git a/xtts/f5tts/bridge.py b/xtts/f5tts/bridge.py index 66338a2..474eddd 100644 --- a/xtts/f5tts/bridge.py +++ b/xtts/f5tts/bridge.py @@ -896,7 +896,14 @@ async def run_loop(runner: F5Runner) -> None: url = f"{scheme}://{uri_host}:{RVS_PORT}?token={RVS_TOKEN}" masked = url.replace(RVS_TOKEN, "***") if RVS_TOKEN else url - connect_kwargs = {"ping_interval": 20, "ping_timeout": 10, "max_size": 50 * 1024 * 1024} + # max_size MUSS zum RVS/zur Bridge passen (1500 MB). Der RVS ist ein + # BROADCAST-Relay: eine grosse Nachricht (Datei-Transfer, Voice-Upload, + # APK-Update) geht an JEDEN Client im Raum. Wer ein kleineres Limit hat, + # schliesst die Verbindung mit Code 1009 ("message too big") und landet in + # einer Reconnect-Schleife — real gesehen mit einem 209-MB-Frame, der + # whisper und f5tts im Minutentakt neu starten liess. + _MAX_WS_BYTES = int(os.getenv("RVS_MAX_SIZE_MB", "1500")) * 1024 * 1024 + connect_kwargs = {"ping_interval": 20, "ping_timeout": 10, "max_size": _MAX_WS_BYTES} try: logger.info("Verbinde zu RVS: %s%s", masked, f" (TCP {RVS_HOST})" if (use_tls and RVS_SNI) else "") async with websockets.connect(url, **connect_kwargs) as ws: diff --git a/xtts/llm-adapter/adapter.py b/xtts/llm-adapter/adapter.py index b4c4b42..6aedc5a 100644 --- a/xtts/llm-adapter/adapter.py +++ b/xtts/llm-adapter/adapter.py @@ -534,7 +534,14 @@ async def _run() -> None: uri_host = RVS_SNI if (use_tls and RVS_SNI) else RVS_HOST url = f"{scheme}://{uri_host}:{RVS_PORT}?token={RVS_TOKEN}" masked = url.replace(RVS_TOKEN, "***") if RVS_TOKEN else url - connect_kwargs = {"ping_interval": 20, "ping_timeout": 10, "max_size": 16 * 1024 * 1024} + # max_size MUSS zum RVS/zur Bridge passen (1500 MB). Der RVS ist ein + # BROADCAST-Relay: eine grosse Nachricht (Datei-Transfer, Voice-Upload, + # APK-Update) geht an JEDEN Client im Raum. Wer ein kleineres Limit hat, + # schliesst die Verbindung mit Code 1009 ("message too big") und landet in + # einer Reconnect-Schleife — real gesehen mit einem 209-MB-Frame, der + # whisper und f5tts im Minutentakt neu starten liess. + _MAX_WS_BYTES = int(os.getenv("RVS_MAX_SIZE_MB", "1500")) * 1024 * 1024 + connect_kwargs = {"ping_interval": 20, "ping_timeout": 10, "max_size": _MAX_WS_BYTES} try: logger.info("Verbinde zu RVS: %s%s (llama=%s)", masked, f" (TCP {RVS_HOST})" if (use_tls and RVS_SNI) else "", LLAMA_URL) diff --git a/xtts/voxtral/bridge.py b/xtts/voxtral/bridge.py index d824166..f01d012 100644 --- a/xtts/voxtral/bridge.py +++ b/xtts/voxtral/bridge.py @@ -760,7 +760,14 @@ async def run_loop(sessions: SessionManager) -> None: uri_host = RVS_SNI if (use_tls and RVS_SNI) else RVS_HOST url = f"{scheme}://{uri_host}:{RVS_PORT}?token={RVS_TOKEN}" masked = url.replace(RVS_TOKEN, "***") if RVS_TOKEN else url - connect_kwargs = {"ping_interval": 20, "ping_timeout": 10, "max_size": 50 * 1024 * 1024} + # max_size MUSS zum RVS/zur Bridge passen (1500 MB). Der RVS ist ein + # BROADCAST-Relay: eine grosse Nachricht (Datei-Transfer, Voice-Upload, + # APK-Update) geht an JEDEN Client im Raum. Wer ein kleineres Limit hat, + # schliesst die Verbindung mit Code 1009 ("message too big") und landet in + # einer Reconnect-Schleife — real gesehen mit einem 209-MB-Frame, der + # whisper und f5tts im Minutentakt neu starten liess. + _MAX_WS_BYTES = int(os.getenv("RVS_MAX_SIZE_MB", "1500")) * 1024 * 1024 + connect_kwargs = {"ping_interval": 20, "ping_timeout": 10, "max_size": _MAX_WS_BYTES} try: logger.info("Verbinde zu RVS: %s%s", masked, f" (TCP {RVS_HOST})" if (use_tls and RVS_SNI) else "") async with websockets.connect(url, **connect_kwargs) as ws: diff --git a/xtts/whisper/bridge.py b/xtts/whisper/bridge.py index 1db3d6c..e1c9d9d 100644 --- a/xtts/whisper/bridge.py +++ b/xtts/whisper/bridge.py @@ -898,7 +898,14 @@ async def run_loop(runner: WhisperRunner, sessions: SessionManager) -> None: uri_host = RVS_SNI if (use_tls and RVS_SNI) else RVS_HOST url = f"{scheme}://{uri_host}:{RVS_PORT}?token={RVS_TOKEN}" masked = url.replace(RVS_TOKEN, "***") if RVS_TOKEN else url - connect_kwargs = {"ping_interval": 20, "ping_timeout": 10, "max_size": 50 * 1024 * 1024} + # max_size MUSS zum RVS/zur Bridge passen (1500 MB). Der RVS ist ein + # BROADCAST-Relay: eine grosse Nachricht (Datei-Transfer, Voice-Upload, + # APK-Update) geht an JEDEN Client im Raum. Wer ein kleineres Limit hat, + # schliesst die Verbindung mit Code 1009 ("message too big") und landet in + # einer Reconnect-Schleife — real gesehen mit einem 209-MB-Frame, der + # whisper und f5tts im Minutentakt neu starten liess. + _MAX_WS_BYTES = int(os.getenv("RVS_MAX_SIZE_MB", "1500")) * 1024 * 1024 + connect_kwargs = {"ping_interval": 20, "ping_timeout": 10, "max_size": _MAX_WS_BYTES} try: logger.info("Verbinde zu RVS: %s%s", masked, f" (TCP {RVS_HOST})" if (use_tls and RVS_SNI) else "") async with websockets.connect(url, **connect_kwargs) as ws: