openclaw - 💡(How to fix) Fix sessions_send announce loses threadId — messages land in General instead of target topic [1 participants]

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…
GitHub stats
openclaw/openclaw#63424Fetched 2026-04-09 07:53:55
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

When using sessions_send to send a message to a session bound to a Telegram topic (thread), the announce delivery drops the threadId, causing the message to land in the group's General topic instead of the target topic.

Root Cause

Root Cause (source-code traced)

RAW_BUFFERClick to expand / collapse

Description

When using sessions_send to send a message to a session bound to a Telegram topic (thread), the announce delivery drops the threadId, causing the message to land in the group's General topic instead of the target topic.

Root Cause (source-code traced)

In pi-embedded-DWASRjxE.js:

  1. resolveAnnounceTargetFromKey(sessionKey) correctly parses channel, to, and threadId from the session key ✅
  2. But resolveAnnounceTarget() in the session lookup fallback path returns only { channel, to, accountId }threadId is dropped
  3. The subsequent method: "send" call only passes to, message, channel, accountId, idempotencyKeyno threadId parameter

Expected Behavior

sessions_send announce to a topic-bound session should deliver the message to the correct Telegram topic (threadId).

Actual Behavior

Message is delivered to the group but without threadId, so it lands in General or an unspecified location.

Evidence

  • Session entry has deliveryContext.threadId: 4269
  • resolveAnnounceTargetFromKey() does extract threadId ✅
  • Session lookup fallback path overwrites the result, losing threadId

Suggested Fix

  1. resolveAnnounceTarget() session lookup return value should include threadId
  2. method: "send" call should pass threadId when present

Environment

  • OpenClaw 2026.4.5
  • Telegram channel with topic groups

extent analysis

TL;DR

Update the resolveAnnounceTarget() function to include threadId in its return value and modify the method: "send" call to pass threadId when available.

Guidance

  • Review the resolveAnnounceTarget() function in pi-embedded-DWASRjxE.js to ensure it returns an object containing channel, to, accountId, and threadId.
  • Modify the method: "send" call to accept and pass the threadId parameter when it is present in the session key.
  • Verify that the sessionKey is correctly parsed to extract the threadId using resolveAnnounceTargetFromKey(sessionKey).
  • Test the updated implementation with a Telegram topic group to confirm that messages are delivered to the correct thread.

Example

// Updated resolveAnnounceTarget function
function resolveAnnounceTarget(sessionKey) {
  const { channel, to, threadId, accountId } = resolveAnnounceTargetFromKey(sessionKey);
  return { channel, to, threadId, accountId };
}

// Updated method: "send" call
const announceTarget = resolveAnnounceTarget(sessionKey);
const params = {
  to: announceTarget.to,
  message,
  channel: announceTarget.channel,
  accountId: announceTarget.accountId,
  idempotencyKey,
};
if (announceTarget.threadId) {
  params.threadId = announceTarget.threadId;
}

Notes

This fix assumes that the threadId is correctly extracted from the session key and that the Telegram API supports passing threadId in the method: "send" call.

Recommendation

Apply the suggested fix to update the resolveAnnounceTarget() function and the method: "send" call to include threadId when available, as this should resolve the issue of messages being delivered to the incorrect thread.

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