openclaw - ✅(Solved) Fix message send --json should expose a top-level messageId [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

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…
GitHub stats
openclaw/openclaw#84186Fetched 2026-05-20 03:42:58
View on GitHub
Comments
1
Participants
2
Timeline
8
Reactions
1
Timeline (top)
labeled ×5closed ×1commented ×1cross-referenced ×1

openclaw message send --json does not expose a stable top-level message id even when the provider receipt contains one.

Root Cause

Automation that sends a message and then edits, verifies, or links to it needs a stable field to read. A top-level id avoids brittle provider-specific JSON parsing.

Fix Action

Fixed

PR fix notes

PR #84191: Expose messageId in message CLI JSON output

Description (problem / solution / changelog)

Summary

Adds a top-level messageId to openclaw message send --json output when the provider receipt contains one.

Motivation

Closes #84186.

The raw provider payload remains useful, but automation should not need provider-specific knowledge to find the id of the message it just sent.

Change Type

  • Bug fix
  • CLI output improvement

Scope

  • Extracts messageId from direct and nested send receipt shapes.
  • Adds top-level messageId only when present.
  • Preserves the existing raw payload object unchanged.
  • Adds a focused CLI JSON test for nested receipt output.

Linked Issue/PR

Closes #84186.

Real Behavior Proof

Behavior or issue addressed: openclaw message send --json must expose a top-level messageId when the provider receipt includes one while preserving the original provider payload.

Real environment tested: Redacted OpenClaw development checkout on this PR branch, using the real message CLI and Discord provider send path with IDs removed from public proof.

Exact steps or command run after this patch: Ran openclaw message send --channel discord --target channel:<redacted> --message <redacted> --json and transformed only the returned IDs to REDACTED_ID before publishing the output.

Evidence after fix: Redacted real CLI output:

{
  "action": "send",
  "channel": "discord",
  "topLevelMessageId": "REDACTED_ID",
  "payloadResultMessageId": "REDACTED_ID",
  "payloadPreserved": true
}

Observed result after fix: The JSON output included the new top-level message id, retained the nested provider message id, and preserved the existing provider payload object.

Not tested: No additional provider families were exercised; this proof covers the Discord CLI send path and the formatter path covered by the regression test.

Root Cause

buildMessageCliJson returned the raw provider payload but did not normalize common receipt identifiers into a stable CLI field.

Regression Test Plan

  • pnpm exec vitest run src/commands/message.test.ts

Result: 1 file passed, 6 tests passed.

User-visible / Behavior Changes

openclaw message send --json may now include messageId at the top level when available. Existing consumers can continue reading payload.

Diagram

N/A. This is a CLI JSON shape improvement.

Security Impact

No secrets, new permissions, or external calls. The id is already present in the existing payload.

Repro + Verification

Before this change, callers had to inspect nested provider payload fields. The new test verifies a nested payload.result.messageId becomes top-level messageId, and the redacted real CLI send confirms the field is present on actual Discord message delivery while preserving the original payload.

Evidence

  • Focused regression command passed.
  • Redacted real CLI send output above confirms top-level messageId and preserved payload.

Human Verification

Real provider send path was exercised with IDs redacted from public proof.

Compatibility / Migration

Backward compatible. This only adds a field when it can be derived.

Risks

Low. Existing output fields are preserved.

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • src/commands/message.test.ts (modified, +34/-0)
  • src/commands/message.ts (modified, +21/-0)
RAW_BUFFERClick to expand / collapse

Summary

openclaw message send --json does not expose a stable top-level message id even when the provider receipt contains one.

Current behavior

The JSON output includes the raw provider payload, so callers have to know provider-specific nested shapes such as payload.result.messageId.

Expected behavior

When the send result contains a message id, the CLI JSON output should also include a top-level messageId while preserving the raw provider payload for compatibility.

Why this matters

Automation that sends a message and then edits, verifies, or links to it needs a stable field to read. A top-level id avoids brittle provider-specific JSON parsing.

Suggested scope

Keep this to output shaping:

  • Extract messageId from common send receipt shapes.
  • Add it to JSON output only when present.
  • Preserve the existing payload object unchanged.
  • Cover the nested receipt case with a focused CLI test.

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…

FAQ

Expected behavior

When the send result contains a message id, the CLI JSON output should also include a top-level messageId while preserving the raw provider payload for compatibility.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix message send --json should expose a top-level messageId [1 pull requests, 1 comments, 2 participants]