From ad5271b217c9ea7c9165c405eb887c0b542d2fbb Mon Sep 17 00:00:00 2001 From: Sahil-SS9 <218421507+Sahil-SS9@users.noreply.github.com> Date: Sat, 27 Jun 2026 17:17:42 +0100 Subject: [PATCH] fix: gate per-platform streaming behind global streaming.enabled (#53697) The effective streaming resolver in gateway/run.py had two sites where per-platform display.platforms..streaming values were used directly without checking the global streaming.enabled master switch. When was set globally, the Telegram platform still had streaming enabled because its per-platform default bypassed the global gate. Fix: introduce an intermediate variable that combines and , then AND it with the per-platform override (or default-true when no override exists). This ensures streaming.enabled: false acts as a hard global kill switch regardless of per-platform defaults or overrides. Affects two resolver sites: - Line ~14854: session streaming setup - Line ~16034: stream consumer initialization (cherry picked from commit 2b210eb2a0e0b9421dae9e3c1984ceb59760e3a3) --- gateway/run_turn.py | 5 +++-- gateway/run_turn_runner.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gateway/run_turn.py b/gateway/run_turn.py index 1484ea2059..c14faa8528 100644 --- a/gateway/run_turn.py +++ b/gateway/run_turn.py @@ -2725,8 +2725,9 @@ class GatewayTurnMixin: _scfg = StreamingConfig() from gateway.display_config import resolve_display_setting _plat_streaming = resolve_display_setting(_load_gateway_config(), _platform_config_key(source.platform), "streaming") - _streaming_enabled = ( - _scfg.enabled and _scfg.transport != "off" if _plat_streaming is None else bool(_plat_streaming) + _global_streaming_enabled = bool(_scfg.enabled) and _scfg.transport != "off" + _streaming_enabled = _global_streaming_enabled and ( + True if _plat_streaming is None else bool(_plat_streaming) ) if not _streaming_enabled: return None diff --git a/gateway/run_turn_runner.py b/gateway/run_turn_runner.py index 1b2e2c0bd3..80c265f9b1 100644 --- a/gateway/run_turn_runner.py +++ b/gateway/run_turn_runner.py @@ -921,8 +921,9 @@ class TurnRunner: scfg = StreamingConfig() # display.platforms..streaming may disable streaming per platform; None = follow global. plat_streaming = ctx.resolve_display_setting(ctx.user_config, platform_key, "streaming") - want_stream_deltas = not ctx.scheduled_heartbeat and ( - scfg.enabled and scfg.transport != "off" if plat_streaming is None else bool(plat_streaming) + global_streaming_enabled = bool(scfg.enabled) and scfg.transport != "off" + want_stream_deltas = not ctx.scheduled_heartbeat and global_streaming_enabled and ( + True if plat_streaming is None else bool(plat_streaming) ) want_interim_messages = bool(ctx.interim_assistant_messages_enabled) and not ctx.scheduled_heartbeat if want_stream_deltas or want_interim_messages: