feat: ship streaming disabled by default — opt-in via config

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.
This commit is contained in:
teknium1 2026-03-16 07:44:42 -07:00
parent fc4080c58a
commit c0b88018eb
3 changed files with 7 additions and 3 deletions

5
cli.py
View file

@ -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:

View file

@ -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)),

View file

@ -202,6 +202,7 @@ DEFAULT_CONFIG = {
"resume_display": "full",
"bell_on_complete": False,
"show_reasoning": False,
"streaming": False,
"skin": "default",
},