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", },