Skip to content

SimpleX adapter: DM text send addresses a numeric contactId as a display name → chatCmdError, silently dropped #63109

Description

@david-stmna

Environment: hermes-agent 0.18.2, simplex-chat 6.4.10, SimpleX gateway DM (1:1) chat.

Symptom: The gateway connects to the simplex-chat daemon, receives inbound DMs, the agent generates a correct response, and the log shows Sending response (N chars) to <id> — but nothing is delivered to the contact. Group messages are unaffected.

Root cause: In plugins/platforms/simplex/adapter.py, send() builds the DM command as @{chat_id} {content}, where chat_id is the numeric contactId. simplex-chat parses @<arg> text as a display-name lookup, so @4 hello looks for a contact literally named "4", finds none, and returns chatCmdError. Because the DM send is fire-and-forget (_send_ws without awaiting a reply), the error is never inspected and the message is silently dropped. The group branch and all media branches already use the structured /_send #<id> json […] / /_send @<id> json […] form; only the plain-text DM branch was not migrated (its comment still claims @<id> text "has always worked in production").

Fix:

python composed = json.dumps([{"msgContent": {"type": "text", "text": content}}]) cmd_str = f"/_send @{chat_id} json {composed}" ​
This matches the group/media paths and also fixes newline/markdown escaping via json.dumps. Verified: @4 …chatCmdError; /_send @4 json […]newChatItems → delivered (sndRcvd).

Secondary (recommended): the DM send should at least log a non-newChatItems response. The failure was invisible purely because the error was swallowed; surfacing it would make this class of bug self-evident.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/pluginsPlugin system and bundled pluginsduplicateThis issue or pull request already existstype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions