← Back to PRs

#15407: feat: Add `message_id` to inbound metadata

by frosso open 2026-02-13 11:47 View on GitHub →
size: XS
## 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