P2 Telegram Streaming Default Bypasses Global Kill Switch — streaming.enabled=false Isn't a Kill Switch (#53697)

Executive Summary

The default config ships with streaming.enabled: false (global master switch OFF) but also display.platforms.telegram.streaming: true (per-platform default ON). The runtime resolver in gateway/run.py (lines 14854, 16034) uses a logic pattern that bypasses the global kill switch entirely when a per-platform override exists. The global kill switch isn't a kill switch — it's a suggestion that the per-platform default silently overrides. This is the 6th distinct Telegram/gateway bug we've tracked.

Root Cause Analysis

The Faulty Resolution Logic

In gateway/run.py at two sites (lines 14854, 16034):

Runtime Resolver (Buggy)
_streaming_enabled = ( _scfg.enabled and _scfg.transport != "off" if _plat_streaming is None else bool(_plat_streaming) )

When _plat_streaming is True, this returns True without checking _scfg.enabled. The per-platform default bypasses the global kill switch entirely.

Expected vs Actual

Global enabledPlatform overrideExpectedActual
falsetruefalsetrue
falsefalsefalsefalse
falseunsetfalsefalse
truetruetruetrue

Code-Level Reproduction

A self-contained Python snippet that imports from hermes_cli.config and gateway.config, mirrors the runtime resolution, and asserts effective_streaming is False. The assertion fails: runtime_effective_streaming=True.

Related but distinct from #6558 / PR #38921 (which addressed streaming.transport: off). This is about streaming.enabled: false still being bypassed.

Proposed Fix

Gate per-platform override behind global switch:

Corrected Resolver
_streaming_enabled = _global_streaming_enabled and ( True if _plat_streaming is None else bool(_plat_streaming) )

Reporter willing to submit PR.

Impact Assessment

DimensionSeverityDetail
Config IntegrityHIGHGlobal kill switch is silently ignored — user thinks streaming is off, but Telegram messages stream anyway
Message DeliveryHIGHUnwanted streaming can break message formatting on platforms that don't handle streaming well
DiscoveryHIGHUser must read gateway source code or observe Telegram behavior to discover the bypass — config says one thing, runtime does another
Fix ComplexityLOWOne-line change: gate per-platform override behind global switch

Telegram/Gateway Bug History (6 Distinct Issues)

IssueSeverityDescription
#40691P2Polling-conflict freeze
#39525P2Dead after sleep/Wi-Fi
#44679P2Matrix DM regression
#50218P2Markdown table stripping
#51961P2Streaming final message broken
#53697P2Telegram streaming default bypasses global kill switch

⚠️ Pattern: Six distinct Telegram/gateway bugs across polling, connectivity, cross-platform regression, formatting, streaming integrity, and config resolution. The gateway layer's per-platform override mechanism needs a systematic audit for config-bypass patterns.

Source Evidence

📋 https://hermes-agent.reviews/hermes-telegram-streaming-bypass-global-killswitch-53697.html
Tracked by hermes-agent.reviews — June 27, 2026