Skip to content

Feature: Handle Signal message edits (editMessage envelope) #9656

@NOVA-Openclaw

Description

@NOVA-Openclaw

Problem

When a Signal message is edited, signal-cli provides an editMessage envelope containing:

  • targetSentTimestamp — the original message timestamp being edited
  • dataMessage — the new message content

Currently, OpenClaw treats edited messages as entirely new messages, which:

  1. Creates duplicate context in the session
  2. Can trigger duplicate responses
  3. Loses the connection between original and edited content

Use Case

In group chats, users frequently edit messages to fix typos or clarify. The agent sees both versions as separate messages, cluttering context and potentially responding to outdated content.

Proposed Solution

  1. Detect edits: Check for envelope.editMessage in incoming Signal messages
  2. Mark as edit: Add [edited] marker or metadata to the message context
  3. Optional dedup: Replace the original message in the transcript with the edited version (using targetSentTimestamp to match)
  4. Skip re-triggering: Don't trigger a new response for edits unless the user explicitly @mentions

Technical Reference

signal-cli already provides the metadata:

// src/main/java/org/asamk/signal/json/JsonEditMessage.java
record JsonEditMessage(long targetSentTimestamp, JsonDataMessage dataMessage)

JSON envelope example:

{
  "envelope": {
    "editMessage": {
      "targetSentTimestamp": 1234567890,
      "dataMessage": { "message": "corrected text", ... }
    }
  }
}

Affected Code

  • Signal plugin message receiver
  • Message envelope parsing
  • Session transcript handling

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions