hermes - 💡(How to fix) Fix Feishu gateway: detect and annotate delayed/stale event callbacks [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

This approach is better than silently dropping messages because:

  • The user may still expect a response to that message
  • The agent can intelligently decide whether to respond, ask for clarification, or acknowledge the delay
  • No messages are lost

Fix Action

Fixed

Code Example

User (10:00): "check the network"  ← delayed, arrives at 14:00
Agent (14:00): "network is fine, ping 25ms"  ← confusing, context moved on

---

User (10:00): "[DELAYED MESSAGE, sent ~4 hours ago] check the network"
Agent (14:00): "这条是4小时前发的,当时网络确实有问题,现在已经修好了..."
RAW_BUFFERClick to expand / collapse

Problem

When network connectivity is lost, Feishu's event webhook retries delivery of pending messages after the connection is restored. The gateway receives these as new messages with fresh message_ids, so there's no way to distinguish them from real-time messages. This causes the agent to process and respond to old messages as if they were just sent, leading to confusing out-of-context replies.

Proposed Solution

Instead of skipping delayed messages (which may need handling), the gateway should:

  1. Detect stale messages by comparing the create_time in the Feishu event payload against the current time
  2. Annotate them in the conversation context with metadata like:
    • This is a delayed message
    • Approximately how long ago it was originally sent (e.g., "2 hours ago")
    • How many messages have passed since then (if trackable)
  3. Let the agent decide how to respond — the agent can naturally handle delayed messages once it knows they're stale

This approach is better than silently dropping messages because:

  • The user may still expect a response to that message
  • The agent can intelligently decide whether to respond, ask for clarification, or acknowledge the delay
  • No messages are lost

Example

Without fix:

User (10:00): "check the network"  ← delayed, arrives at 14:00
Agent (14:00): "network is fine, ping 25ms"  ← confusing, context moved on

With fix:

User (10:00): "[DELAYED MESSAGE, sent ~4 hours ago] check the network"
Agent (14:00): "这条是4小时前发的,当时网络确实有问题,现在已经修好了..."

Reproduction

  1. Start Hermes gateway connected to Feishu
  2. Send a message via Feishu
  3. Disconnect network before gateway processes it
  4. Restore network → Feishu retries the webhook → gateway processes the stale message as if it were new

Environment

  • Hermes Agent v0.13.0+
  • Platform: Feishu/Lark

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix Feishu gateway: detect and annotate delayed/stale event callbacks [1 pull requests]