Skip to content

Support current LINQ webhooks and Hermes adapter lifecycle - #2

Open
SYMBaiEX wants to merge 2 commits into
linq-team:mainfrom
SYMBaiEX:sym/current-webhook-compatibility
Open

Support current LINQ webhooks and Hermes adapter lifecycle#2
SYMBaiEX wants to merge 2 commits into
linq-team:mainfrom
SYMBaiEX:sym/current-webhook-compatibility

Conversation

@SYMBaiEX

@SYMBaiEX SYMBaiEX commented Aug 7, 2026

Copy link
Copy Markdown

Summary

  • support current 2026-02-03 message.received payloads while preserving legacy 2025-01-01 compatibility
  • normalize the documented current LINQ message, chat, sender, timestamp, direction, service, group, reply, and optional owner fields into the adapter's existing internal contract
  • preserve the original LINQ event data on Hermes MessageEvent.raw_message
  • accept Hermes' current keyword-only is_reconnect connection argument
  • update the README to document both webhook versions and current group detection

Current LINQ webhooks place message fields such as id and parts directly under data, while the older payload nested them under data.message. Without normalization, the adapter rejects current inbound messages as missing message.id. Current Hermes also calls platform adapters with connect(is_reconnect=...).

The scope is intentionally limited to inbound webhook and Hermes lifecycle compatibility. It does not change outbound messaging, media handling, authentication, CLI behavior, or plugin registration.

Testing

  • python -m unittest discover -s tests -v — 28 tests passed
  • python -m py_compile adapter.py signing.py tests/test_signing.py
  • git diff --check upstream/main...HEAD
  • verified LinqAdapter remains concrete and matches the Hermes v2026.8.3 BasePlatformAdapter.connect contract

Copilot AI lite review requested due to automatic review settings August 7, 2026 01:58

Copilot AI 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.

Pull request overview

This PR updates the Hermes Linq plugin to accept both legacy and current LINQ message.received webhook payload shapes by normalizing current payloads into the adapter’s existing internal contract, while also aligning the adapter lifecycle with Hermes’ current connect(is_reconnect=...) calling convention.

Changes:

  • Added signing.normalize_message_received_data() to map current LINQ webhook payloads into the legacy-shaped contract used by the adapter.
  • Updated LinqAdapter to call the normalizer, preserve the original payload on MessageEvent.raw_message, and accept keyword-only is_reconnect in connect.
  • Extended unit tests and README documentation to cover both webhook versions and current group detection via chat.is_group.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/test_signing.py Adds coverage for normalizing current vs. legacy message.received payloads, including group flag and optional owner handling.
signing.py Introduces payload normalization for current LINQ webhook shapes and updates group-chat classification docs.
adapter.py Uses normalization for inbound webhooks, preserves raw payload on events, and updates connect signature for Hermes lifecycle compatibility.
README.md Documents support for both legacy/current webhook payload versions and updated group detection notes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread signing.py Outdated
Comment thread signing.py Outdated
@SYMBaiEX
SYMBaiEX force-pushed the sym/current-webhook-compatibility branch from 3c9b090 to 2e1cd3c Compare August 7, 2026 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants