Skip to content

fix(simplex): accept non-audio file transfers via /freceive - #55185

Open
liuhao1024 wants to merge 4 commits into
NousResearch:mainfrom
liuhao1024:liuhao/cron-bugfix-55180-simplex-non-audio-attachments
Open

liuhao1024 wants to merge 4 commits into
NousResearch:mainfrom
liuhao1024:liuhao/cron-bugfix-55180-simplex-non-audio-attachments

Conversation

@liuhao1024

Copy link
Copy Markdown
Contributor

What does this PR do?

The SimpleX adapter only accepts XFTP file transfers (via /freceive) for audio files. Images, PDFs, and other documents sent over XFTP are silently dropped — the message arrives as text-only, with no attachment.

The root cause is an audio-only guard on the deferred-file code path: if not file_path and _is_audio_ext(ext) and file_id is not None. Non-audio files without a filePath (still downloading) fall through to the if file_path: block, which skips them entirely.

This PR removes the _is_audio_ext(ext) restriction so all pending file transfers are accepted and deferred until rcvFileComplete fires, regardless of file type.

Related Issue

Fixes #55180

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • plugins/platforms/simplex/adapter.py: Removed _is_audio_ext(ext) from the pending-file guard so images, documents, and all other file types are accepted via /freceive and deferred until download completes. Updated comment and log message to reflect the broader scope.
  • tests/gateway/test_simplex_plugin.py: Added _make_pending_file_chat_item helper for files not yet downloaded. Added test_pending_image_file_accepts_transfer and test_pending_document_file_accepts_transfer regression tests.

How to Test

  1. Run python -m pytest tests/gateway/test_simplex_plugin.py -v — all 32 tests should pass, including the two new test_pending_* tests.
  2. Connect the SimpleX adapter and send the bot an image (not just audio). The agent should receive the image attachment with vision context.
  3. Send a PDF — the agent should receive it as a document attachment.
  4. Audio (voice notes) should continue working as before.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — N/A (adapter-only change)
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

The deferred-file guard only triggered for audio extensions, silently
dropping images, PDFs, and other documents that hadn't finished
downloading via XFTP.  Remove the audio-only restriction so all
pending file transfers are accepted and deferred until rcvFileComplete.

Fixes NousResearch#55180
@alt-glitch alt-glitch added type/bug Something isn't working comp/plugins Plugin system and bundled plugins sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages P3 Low — cosmetic, nice to have labels Jun 29, 2026

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Clean 2-file fix accepting non-audio file transfers via /freceive in SimpleX. Well-scoped with proper MIME type handling.

@teknium1

Copy link
Copy Markdown
Collaborator

Thanks for the focused SimpleX fix. The premise is confirmed on current main: plugins/platforms/simplex/adapter.py:580 still defers only audio files, while :441-467 re-delivers completed files only when they were first recorded as pending. Removing the audio predicate addresses that exact gap without changing the surrounding delivery design.

Problems

  • The added tests verify the initial pending state and /freceive request, but do not test the required completion path at plugins/platforms/simplex/adapter.py:441-467. The final assertion in the image test also does not install a handle_message capture.

Suggested changes

  • Extend the pending image/document tests through a matching rcvFileComplete event and assert one captured event with the completed path and expected PHOTO/DOCUMENT type.

Automated hermes-sweeper review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]:

4 participants