feat: add SimpleX Chat gateway adapter (#2557)#2558
Closed
Mibayy wants to merge 1 commit into
Closed
Conversation
Closes NousResearch#2557 SimpleX Chat is a private, decentralised messaging platform where users own their contacts and groups without persistent identifiers. This PR adds full gateway support following the ADDING_A_PLATFORM.md checklist (all 16 points covered): Core adapter (gateway/platforms/simplex.py): - WebSocket-based connection to the simplex-chat daemon (-p 5225) - Persistent WS listener with exponential-backoff reconnect + jitter - Health monitor that force-reconnects on stale connections - Inbound: handles newChatItem / newChatItems events, DMs and groups - Outbound: send() via WS JSON commands (@[id] msg / #[id] msg) - File attachment support with local path cache (image/audio/document) - Filters own echoes via corrId prefix - Requires: pip install websockets Integration points: - gateway/config.py — Platform.SIMPLEX enum + env var loading - gateway/run.py — _create_adapter() + both auth allowlist maps - toolsets.py — hermes-simplex toolset + hermes-gateway include - cron/scheduler.py — platform_map for cron delivery - tools/send_message_tool.py — platform_map + _send_simplex() standalone fn - agent/prompt_builder.py — PLATFORM_HINTS["simplex"] - gateway/channel_directory.py — session-based contact discovery - hermes_cli/status.py — SIMPLEX_WS_URL status display - hermes_cli/gateway.py — _PLATFORMS entry + _setup_simplex() wizard Tests (tests/gateway/test_simplex.py): - Platform enum value - Env var config loading (with/without home channel) - Adapter init (default URL, custom URL) - check_simplex_requirements() - Auth allowlist map coverage - Helper functions (_guess_extension, _is_image_ext, _is_audio_ext) - _make_corr_id uniqueness - send() DM and group routing (mock WS) Docs (website/docs/user-guide/messaging/simplex.md): - Install and start the daemon - Setup wizard and env var reference - Authorization model (allowlist / DM pairing) - Cron delivery examples - Privacy notes and troubleshooting Environment variables: SIMPLEX_WS_URL WebSocket URL of daemon (default: ws://127.0.0.1:5225) SIMPLEX_ALLOWED_USERS Comma-separated allowed contact IDs SIMPLEX_ALLOW_ALL_USERS Set true to allow all contacts SIMPLEX_HOME_CHANNEL Default contact ID for cron delivery SIMPLEX_HOME_CHANNEL_NAME Human label for home channel
|
Wow, that was fast. I wanted someone with more experience to the programming. I am more or less having fun building things and trying to get as much experience as I can, I am getting there. Thank you. 🙏 |
|
Indeed, I have built a similar setup today and happy to see already a PR. +1 |
|
+1 |
teknium1
pushed a commit
that referenced
this pull request
May 15, 2026
SimpleX Chat (https://simplex.chat) is a private, decentralised messenger with no persistent user IDs — every contact is identified by an opaque internal ID generated at connection time. This adds it as a Hermes gateway platform via the plugin system. The adapter connects to a local simplex-chat daemon via WebSocket, listens for inbound messages, and sends replies. Originally proposed in PR #2558 as a core-modifying integration; reshaped here as a self- contained plugin under plugins/platforms/simplex/ with no edits to any core file. Discovery is filesystem-based (scanned by gateway.config), and the platform identity is resolved on demand via Platform("simplex"). Plugin contract: - check_requirements() requires SIMPLEX_WS_URL AND the websockets package - validate_config() / is_connected() accept env or config.yaml input - _env_enablement() seeds PlatformConfig.extra (ws_url + home_channel) - _standalone_send() supports out-of-process cron delivery - interactive_setup() provides a stdin wizard for hermes gateway setup - register() wires the adapter into the registry with required_env, install_hint, cron_deliver_env_var, allowed_users_env, and a platform_hint for the LLM. Lazy dependency: the websockets Python package is imported inside the functions that need it. The plugin is importable and discoverable even when websockets is missing — check_requirements() simply returns False until `pip install websockets` is run. No new pyproject extras are introduced. Environment variables: SIMPLEX_WS_URL WebSocket URL of the daemon (required) SIMPLEX_ALLOWED_USERS Comma-separated allowed contact IDs SIMPLEX_ALLOW_ALL_USERS Set true to allow all contacts SIMPLEX_HOME_CHANNEL Default contact for cron delivery SIMPLEX_HOME_CHANNEL_NAME Human label for the home channel Closes #2557.
Contributor
|
Salvaged onto current main and merged via #26232 — reshaped from the original 12-file core integration into a self-contained platform plugin under |
DIZ-admin
pushed a commit
to DIZ-admin/hermes-agent
that referenced
this pull request
May 16, 2026
SimpleX Chat (https://simplex.chat) is a private, decentralised messenger with no persistent user IDs — every contact is identified by an opaque internal ID generated at connection time. This adds it as a Hermes gateway platform via the plugin system. The adapter connects to a local simplex-chat daemon via WebSocket, listens for inbound messages, and sends replies. Originally proposed in PR NousResearch#2558 as a core-modifying integration; reshaped here as a self- contained plugin under plugins/platforms/simplex/ with no edits to any core file. Discovery is filesystem-based (scanned by gateway.config), and the platform identity is resolved on demand via Platform("simplex"). Plugin contract: - check_requirements() requires SIMPLEX_WS_URL AND the websockets package - validate_config() / is_connected() accept env or config.yaml input - _env_enablement() seeds PlatformConfig.extra (ws_url + home_channel) - _standalone_send() supports out-of-process cron delivery - interactive_setup() provides a stdin wizard for hermes gateway setup - register() wires the adapter into the registry with required_env, install_hint, cron_deliver_env_var, allowed_users_env, and a platform_hint for the LLM. Lazy dependency: the websockets Python package is imported inside the functions that need it. The plugin is importable and discoverable even when websockets is missing — check_requirements() simply returns False until `pip install websockets` is run. No new pyproject extras are introduced. Environment variables: SIMPLEX_WS_URL WebSocket URL of the daemon (required) SIMPLEX_ALLOWED_USERS Comma-separated allowed contact IDs SIMPLEX_ALLOW_ALL_USERS Set true to allow all contacts SIMPLEX_HOME_CHANNEL Default contact for cron delivery SIMPLEX_HOME_CHANNEL_NAME Human label for the home channel Closes NousResearch#2557.
2 tasks
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
SimpleX Chat (https://simplex.chat) is a private, decentralised messenger with no persistent user IDs — every contact is identified by an opaque internal ID generated at connection time. This adds it as a Hermes gateway platform via the plugin system. The adapter connects to a local simplex-chat daemon via WebSocket, listens for inbound messages, and sends replies. Originally proposed in PR NousResearch#2558 as a core-modifying integration; reshaped here as a self- contained plugin under plugins/platforms/simplex/ with no edits to any core file. Discovery is filesystem-based (scanned by gateway.config), and the platform identity is resolved on demand via Platform("simplex"). Plugin contract: - check_requirements() requires SIMPLEX_WS_URL AND the websockets package - validate_config() / is_connected() accept env or config.yaml input - _env_enablement() seeds PlatformConfig.extra (ws_url + home_channel) - _standalone_send() supports out-of-process cron delivery - interactive_setup() provides a stdin wizard for hermes gateway setup - register() wires the adapter into the registry with required_env, install_hint, cron_deliver_env_var, allowed_users_env, and a platform_hint for the LLM. Lazy dependency: the websockets Python package is imported inside the functions that need it. The plugin is importable and discoverable even when websockets is missing — check_requirements() simply returns False until `pip install websockets` is run. No new pyproject extras are introduced. Environment variables: SIMPLEX_WS_URL WebSocket URL of the daemon (required) SIMPLEX_ALLOWED_USERS Comma-separated allowed contact IDs SIMPLEX_ALLOW_ALL_USERS Set true to allow all contacts SIMPLEX_HOME_CHANNEL Default contact for cron delivery SIMPLEX_HOME_CHANNEL_NAME Human label for the home channel Closes NousResearch#2557.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #2557
Adds full SimpleX Chat support as a gateway messaging platform. SimpleX is a private, decentralised messenger with no persistent user IDs — a natural complement to the existing Signal adapter.
SimpleX runs a local simplex-chat daemon that exposes a WebSocket API. Hermes connects to it, listens for inbound messages, and sends replies.
Changes
Core adapter (gateway/platforms/simplex.py):
All 16 ADDING_A_PLATFORM.md touch points covered:
Environment variables:
SIMPLEX_WS_URL WebSocket URL (default ws://127.0.0.1:5225)
SIMPLEX_ALLOWED_USERS Comma-separated allowed contact IDs
SIMPLEX_ALLOW_ALL_USERS Set true to allow all contacts
SIMPLEX_HOME_CHANNEL Default contact for cron delivery
SIMPLEX_HOME_CHANNEL_NAME Human label for home channel
Quick start:
simplex-chat -p 5225
hermes setup gateway # select SimpleX Chat
Tests:
python -m pytest tests/gateway/test_simplex.py -v