From c0b88018eb8c95d139ac590cf60da5789cb6ca15 Mon Sep 17 00:00:00 2001 From: teknium1 Date: Mon, 16 Mar 2026 07:44:42 -0700 Subject: [PATCH] =?UTF-8?q?feat:=20ship=20streaming=20disabled=20by=20defa?= =?UTF-8?q?ult=20=E2=80=94=20opt-in=20via=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Streaming is now off by default for both CLI and gateway. Users opt in: CLI (config.yaml): display: streaming: true Gateway (config.yaml): streaming: enabled: true This lets early adopters test streaming while existing users see zero change. Once we have enough field validation, we flip the default to true in a subsequent release. --- cli.py | 5 ++++- gateway/config.py | 4 ++-- hermes_cli/config.py | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cli.py b/cli.py index 2aa181797a..51625fcf99 100755 --- a/cli.py +++ b/cli.py @@ -1017,6 +1017,9 @@ class HermesCLI: self.show_reasoning = CLI_CONFIG["display"].get("show_reasoning", False) self.verbose = verbose if verbose is not None else (self.tool_progress_mode == "verbose") + # streaming: stream tokens to the terminal as they arrive (display.streaming in config.yaml) + self.streaming_enabled = CLI_CONFIG["display"].get("streaming", False) + # Streaming display state self._stream_buf = "" # Partial line buffer for line-buffered rendering self._stream_started = False # True once first delta arrives @@ -1719,7 +1722,7 @@ class HermesCLI: checkpoint_max_snapshots=self.checkpoint_max_snapshots, pass_session_id=self.pass_session_id, tool_progress_callback=self._on_tool_progress, - stream_delta_callback=self._stream_delta, + stream_delta_callback=self._stream_delta if self.streaming_enabled else None, ) # Apply any pending title now that the session exists in the DB if self._pending_title and self._session_db: diff --git a/gateway/config.py b/gateway/config.py index 676b521401..0b01ed26c9 100644 --- a/gateway/config.py +++ b/gateway/config.py @@ -149,7 +149,7 @@ class PlatformConfig: @dataclass class StreamingConfig: """Configuration for real-time token streaming to messaging platforms.""" - enabled: bool = True + enabled: bool = False transport: str = "edit" # "edit" (progressive editMessageText) or "off" edit_interval: float = 0.3 # Seconds between message edits buffer_threshold: int = 40 # Chars before forcing an edit @@ -169,7 +169,7 @@ class StreamingConfig: if not data: return cls() return cls( - enabled=data.get("enabled", True), + enabled=data.get("enabled", False), transport=data.get("transport", "edit"), edit_interval=float(data.get("edit_interval", 0.3)), buffer_threshold=int(data.get("buffer_threshold", 40)), diff --git a/hermes_cli/config.py b/hermes_cli/config.py index f781313082..9c07153df4 100644 --- a/hermes_cli/config.py +++ b/hermes_cli/config.py @@ -202,6 +202,7 @@ DEFAULT_CONFIG = { "resume_display": "full", "bell_on_complete": False, "show_reasoning": False, + "streaming": False, "skin": "default", },