#15407: feat: Add `message_id` to inbound metadata
size: XS
Cluster:
Signal Plugin Enhancements
## Description
Agents currently cannot react to incoming messages on channels that require a message ID (Signal, Telegram, Discord, etc.) because the inbound message ID is not exposed in the system prompt, despite being available internally via `ctx.MessageSid`.
For example, calling ``message action=react channel=signal messageId=<id> emoji=👀`` is impossible because the agent has no way to know ``<id>``.
Adding `message_id` to the `openclaw.inbound_meta.v1` payload in `buildInboundMetaSystemPrompt()` should fix this.
## Use cases
- Reactions: Agents can react to the triggering message (e.g., 👀 "thinking" indicator before responding)
- Precise reply threading: Enables `[[reply_to:<id>]]` with the actual message ID
- Audit/logging: Agents can log the exact message ID for traceability
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates `buildInboundMetaSystemPrompt()` to include a `message_id` field in the trusted inbound metadata payload (`schema: openclaw.inbound_meta.v1`). The value is derived from `ctx.MessageSidFull` when available (full provider message ID) and falls back to `ctx.MessageSid`, enabling agents/tools to reference and react to the exact inbound message for providers that require message IDs (e.g., reactions, reply-threading, audit/logging).
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- Change is a small, backward-compatible addition to a JSON metadata payload. Existing code already uses `MessageSidFull ?? MessageSid` for message targeting, and no internal consumers of `openclaw.inbound_meta.v1` were found that would break on an added field.
- No files require special attention
<sub>Last reviewed commit: 4b1ffb4</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#15148: auto-reply: add message_time and compact inbound metadata JSON
by detecti1 · 2026-02-13
78.4%
#7353: fix: prevent silent message drops after config.patch restart
by 18-RAJAT · 2026-02-02
73.6%
#15853: feat: add option to suppress media placeholder text
by MisterGuy420 · 2026-02-14
73.1%
#9701: feat: handle Signal message edits with [edited] marker (#9656)
by divol89 · 2026-02-05
72.9%
#7580: feat: add message:received internal hook with prompt injection
by rodrigoschott · 2026-02-03
72.8%
#14367: feat(telegram): add message read via inbound message store
by michaelquinlan88 · 2026-02-12
72.5%
#6071: fix(cli): add --thread-id option to message read command
by lyra63237 · 2026-02-01
72.5%
#18893: fix(message): use currentMessageId for react fallback and suppress ...
by teededung · 2026-02-17
72.2%
#19917: feat(discord): allow disabling intermediate status reactions
by Gitjay11 · 2026-02-18
72.2%
#7145: chore: update package description to reflect multi-channel capabili...
by Protocol-zero-0 · 2026-02-02
72.2%