Skip to content

[codex] Fix Signal document attachments - #7445

Closed
cameronbergh wants to merge 1 commit into
NousResearch:mainfrom
cameronbergh:codex/signal-document-attachments
Closed

[codex] Fix Signal document attachments#7445
cameronbergh wants to merge 1 commit into
NousResearch:mainfrom
cameronbergh:codex/signal-document-attachments

Conversation

@cameronbergh

Copy link
Copy Markdown
Contributor

What changed

This fixes inbound Signal file attachments so Hermes can actually use them during conversations.

  • classify inbound Signal application/* and text/* attachments as DOCUMENT
  • inject small text attachments like .md and .txt directly into prompt context
  • preserve attachment filenames when Signal falls back to getAttachment bytes
  • prefer local attachment paths from signal-cli when available
  • add regression coverage for markdown and PDF attachments on the Signal adapter

Why this changed

On the current Signal path, image and audio attachments worked, but document attachments were effectively dropped from the useful prompt path.

Two issues caused that:

  1. Signal attachments were cached, but non-image/audio files were not marked as MessageType.DOCUMENT, so the later document-enrichment flow never ran.
  2. When Signal returned raw attachment bytes, Hermes could lose the original filename and treat text documents as generic binary files.

This meant sending a .md file over Signal often produced an empty or unhelpful response even though the file arrived.

Impact

Users can now send small markdown or text files to Hermes over Signal and have Hermes read them as part of the message context. Other document attachments are preserved as documents with usable saved paths and filenames.

This also makes the Signal behavior consistent with the existing Slack and Discord document handling patterns.

Validation

  • python3 -m pytest -o addopts='' /Users/openclaw/.hermes/hermes-agent/tests/gateway/test_signal.py
    • 64 passed

Notes

I observed existing signal-cli getAttachment null-pointer errors in local logs. This change reduces reliance on that path by using the local attachment path when Signal already provides one.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists platform/signal Signal CLI adapter comp/gateway Gateway runner, session dispatch, delivery labels Apr 29, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #13243 and #12851 (both fix #12845 for document MIME classification). This PR goes further with filename preservation and local path preference. Not a duplicate but overlapping scope.

@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Thanks for this. Closing as stale — the branch is ~8731 commits behind main and the Signal adapter has been substantially rewritten since, so the diff no longer applies cleanly and would revert intervening work (inbound document classification already exists on main; the diff touches ~2129 files). The underlying idea is welcome — if it's still relevant on current main, a fresh PR against gateway/platforms/signal.py would be the way to land it.

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

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/signal Signal CLI adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants