feat(simplex): groups, native attachments, text batching, auto-accept (salvage #27978) - #42584
Merged
Conversation
Salvage of PR #27978 cherry-picked onto current main, resolving conflicts with main's intervening SimpleX plugin fixes (resp-envelope normalization, health-monitor reconnect-churn fix, bare-form DM addressing). What's new: - Group support via SIMPLEX_GROUP_ALLOWED (comma-separated IDs or '*'); inbound items surface chat_id=group:<id> + chat_type=group. Disabled by default so a bot in a group doesn't process every member's traffic. - Inbound files/voice via rcvFileDescrReady (immediate /freceive) deferred through _pending_file_transfers, replayed on rcvFileComplete. Voice notes -> MessageType.VOICE. - Native outbound media: send_image (PNG/JPEG + inline thumbnail), send_voice (msgContent.type=voice), send_video, send_document. All addressed by numeric ID via /_send ... json [...]. - MEDIA:<path> tags in agent replies stripped and dispatched as voice/document. - Text-burst batching (HERMES_SIMPLEX_TEXT_BATCH_DELAY, default 0.8s). - Auto-accept contact requests (SIMPLEX_AUTO_ACCEPT, default true). - Group send path uses structured /_send #<id> json form (the bracket #[<id>] form is parsed as display-name lookup and silently drops). plugin.yaml bumped to 1.1.0; docs updated. All inside plugins/platforms/simplex/ - no core edits. Co-authored-by: Juraj Bednar <juraj@bednar.io>
Contributor
🔎 Lint report:
|
| Rule | Count |
|---|---|
invalid-method-override |
5 |
unresolved-import |
2 |
invalid-argument-type |
1 |
First entries
plugins/platforms/simplex/adapter.py:990: [invalid-method-override] invalid-method-override: Invalid override of method `send_video`: Definition is incompatible with `BasePlatformAdapter.send_video`
plugins/platforms/simplex/adapter.py:294: [unresolved-import] unresolved-import: Cannot resolve imported module `websockets.exceptions`
plugins/platforms/simplex/adapter.py:873: [unresolved-import] unresolved-import: Cannot resolve imported module `PIL`
plugins/platforms/simplex/adapter.py:436: [invalid-argument-type] invalid-argument-type: Argument to bound method `SimplexAdapter._handle_chat_item` is incorrect: Expected `dict[Unknown, Unknown]`, found `Unknown | None | dict[Unknown, Unknown]`
plugins/platforms/simplex/adapter.py:1033: [invalid-method-override] invalid-method-override: Invalid override of method `send_voice`: Definition is incompatible with `BasePlatformAdapter.send_voice`
plugins/platforms/simplex/adapter.py:1001: [invalid-method-override] invalid-method-override: Invalid override of method `send_document`: Definition is incompatible with `BasePlatformAdapter.send_document`
plugins/platforms/simplex/adapter.py:925: [invalid-method-override] invalid-method-override: Invalid override of method `send_image`: Definition is incompatible with `BasePlatformAdapter.send_image`
plugins/platforms/simplex/adapter.py:977: [invalid-method-override] invalid-method-override: Invalid override of method `send_image_file`: Definition is incompatible with `BasePlatformAdapter.send_image_file`
✅ Fixed issues (1):
| Rule | Count |
|---|---|
invalid-argument-type |
1 |
First entries
plugins/platforms/simplex/adapter.py:312: [invalid-argument-type] invalid-argument-type: Argument to bound method `SimplexAdapter._handle_new_chat_item` is incorrect: Expected `dict[Unknown, Unknown]`, found `Unknown | None | dict[Unknown, Unknown]`
Unchanged: 5556 pre-existing issues carried over.
Diagnostics are surfaced as warnings — this check never fails the build.
1 task
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.
Summary
Salvage of #27978 (@jooray) onto current main — the SimpleX plugin gains group chats, native attachments, inbound file/voice handling,
MEDIA:dispatch, text batching, and auto-accept, all insideplugins/platforms/simplex/with no core edits.The PR branch was 1084 commits stale; main had independently fixed the bare-form DM addressing, added
resp-envelope normalization, and quieted the health-monitor reconnect churn. Conflicts were resolved keeping main's fixes AND layering the contributor's features on top.Changes
adapter.py: group support (SIMPLEX_GROUP_ALLOWED), inbound files/voice viarcvFileDescrReady/rcvFileCompletedeferral, nativesend_image/send_voice/send_video/send_documentvia/_send … json,MEDIA:<path>strip+dispatch, text-burst batching,SIMPLEX_AUTO_ACCEPT. Group send uses structured/_send #<id> json(bracket#[<id>]is parsed as display-name lookup and silently drops).plugin.yaml: 1.0.0 → 1.1.0, new env vars surfaced.tests/gateway/test_simplex_plugin.py:test_send_dm/test_send_groupupdated to assert the bare-DM + structured-group forms.website/docs/user-guide/messaging/simplex.md: documents the new env vars.scripts/release.py: AUTHOR_MAP entry for jooray.Validation
pytest tests/gateway/test_simplex_plugin.py@Alice hi there(bare form)/_send #grp-99 json [...](newlines/quotes escaped)chat_id=group:grp-99,chat_type=group/accept 7/freceiveMEDIA:tagCloses #27978. Original out-of-tree core-modifying version was #4870 (superseded by the plugin architecture).
Infographic