hermes-agent/gateway
teknium1 5a426e084a feat: add streaming LLM response support across all platforms
Token-by-token streaming of LLM responses, disabled by default.
Enable via streaming.enabled: true in config.yaml or
HERMES_STREAMING_ENABLED=true env var.

Core (run_agent.py):
- stream_callback parameter on AIAgent
- _run_streaming_chat_completion() for Chat Completions streaming
- _run_codex_stream() now emits tokens via callback
- _interruptible_api_call routes to streaming when callback is set
- Graceful fallback to non-streaming on any error

Gateway (gateway/run.py):
- Read streaming config (master switch + per-platform overrides)
- Queue-based callback bridging agent thread to async event loop
- stream_preview task: progressive message editing with cursor
- Skip normal send when streaming already delivered the response
- Thread-safe, respects platform rate limits (1.5s edit interval)

API Server (gateway/platforms/api_server.py):
- Real token-by-token SSE when stream=true (replaces pseudo-streaming)
- stream_callback wired through _create_agent and _run_agent
- Background agent task + queue for concurrent streaming

Config:
- streaming.enabled (master switch, default: false)
- Per-platform: streaming.telegram, streaming.discord, etc.
- HERMES_STREAMING_ENABLED env var override
2026-03-10 16:29:26 -07:00
..
platforms feat: add streaming LLM response support across all platforms 2026-03-10 16:29:26 -07:00
__init__.py Enhance CLI with multi-platform messaging integration and configuration management 2026-02-02 19:01:51 -08:00
channel_directory.py Merge PR #369: fix(gateway): add missing UTF-8 encoding to file I/O 2026-03-09 00:36:38 -07:00
config.py feat: add OpenAI-compatible API server platform adapter (Phase 1) 2026-03-10 16:05:17 -07:00
delivery.py Hermes Agent UX Improvements 2026-02-22 02:16:11 -08:00
hooks.py Add messaging platform enhancements: STT, stickers, Discord UX, Slack, pairing, hooks 2026-02-15 21:38:59 -08:00
mirror.py Merge PR #565: fix: sanitize FTS5 queries and close mirror DB connections 2026-03-09 23:59:26 -07:00
pairing.py Add messaging platform enhancements: STT, stickers, Discord UX, Slack, pairing, hooks 2026-02-15 21:38:59 -08:00
run.py feat: add streaming LLM response support across all platforms 2026-03-10 16:29:26 -07:00
session.py fix: eliminate 3x SQLite message duplication in gateway sessions (#860) 2026-03-10 15:22:44 -07:00
status.py fix: prevent duplicate gateway instances from running simultaneously 2026-03-05 20:35:33 -08:00
sticker_cache.py Add messaging platform enhancements: STT, stickers, Discord UX, Slack, pairing, hooks 2026-02-15 21:38:59 -08:00