openclaw - ✅(Solved) Fix openclaw message thread create for Telegram: thread-create → topic-create remap not happening; gateway rejects with Unsupported Telegram action [2 pull requests, 1 comments, 2 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#81581Fetched 2026-05-14 03:30:43
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
2
Author
Timeline (top)
cross-referenced ×3commented ×1

Error Message

GatewayClientRequestError: Error: Unsupported Telegram action: thread-create

Fix Action

Workaround

Direct Bot API call works:

curl -X POST "https://api.telegram.org/bot$TOKEN/createForumTopic" \
  --data-urlencode "chat_id=$GROUP_ID" \
  --data-urlencode "name=$TOPIC_NAME"

Returns {"ok":true,"result":{"message_thread_id":<N>,...}} and the topic appears in the group. So the underlying bot capability is intact; only the openclaw message thread create CLI dispatch is broken.

PR fix notes

PR #81596: fix(telegram): expose CLI thread remap

Description (problem / solution / changelog)

Summary

  • forward Telegram's channel-owned resolveCliActionRequest through the exported Telegram plugin actions adapter
  • preserve the existing default action/args behavior when no runtime or static remap exists
  • add a plugin-surface contract test proving CLI thread-create remaps to Telegram topic-create

Fixes #81581.

Verification

  • pnpm exec oxfmt --check extensions/telegram/src/channel.ts extensions/telegram/src/channel-actions.contract.test.ts
  • pnpm vitest run extensions/telegram/src/channel-actions.contract.test.ts src/cli/program/message/register.thread.test.ts
  • pnpm check:changed
  • git diff --check

Real behavior proof

Behavior addressed: Before this patch, the static Telegram action implementation contained the thread-create -> topic-create remap, but the exported telegramPlugin.actions wrapper did not expose resolveCliActionRequest. The shared CLI asks the exported channel plugin for the remap, so Telegram thread creation could fall through as bare thread-create and reach the gateway unsupported.

Real setup tested: Local OpenClaw checkout at /home/chenglunhu/code/openclaw, branch fix/telegram-thread-create-cli-remap-81581, commit 1a534aa741cf0a7f65358e5d159d357d9e9f1822, using the real registerMessageThreadCommands CLI registration and exported telegramPlugin action surface through pnpm exec tsx.

Exact steps or command run after the patch: Registered the exported Telegram plugin in a test registry, registered the real message thread create command, parsed thread create --channel telegram -t -1003894873578 --thread-name "Test topic" --json, and captured the action/options that the CLI would dispatch.

Evidence after fix: Terminal output from the live command:

{
  "action": "topic-create",
  "target": "-1003894873578",
  "name": "Test topic",
  "hasThreadName": false
}

Observed result after fix: The CLI dispatch target is topic-create, the Telegram forum topic name is mapped to name, and the generic threadName field is removed before gateway dispatch. This is the action shape the Telegram runtime already supports.

Not tested: I did not call the live Telegram Bot API; the reporter already verified raw createForumTopic works and the bug is in OpenClaw's CLI/plugin dispatch boundary.

Scout audit

  • Audit A (existing helper): existing remap helper found in extensions/telegram/src/channel-actions.ts; reused by forwarding it through the exported wrapper.
  • Audit B (shared callers): no shared helper contract changed; ChannelMessageActionAdapter.resolveCliActionRequest contract preserved with default { action, args } fallback.
  • Audit C (broader rival): gh pr list --search "81581 in:body" found no open rival PR.

Changed files

  • extensions/telegram/src/channel-actions.contract.test.ts (modified, +21/-1)
  • extensions/telegram/src/channel.ts (modified, +8/-0)

PR #81604: fix(telegram): forward resolveCliActionRequest in action wrapper

Description (problem / solution / changelog)

Summary

The telegramMessageActions wrapper in channel.ts delegates resolveExecutionMode, describeMessageTool, extractToolSend, and handleAction to the implementation in channel-actions.ts, but omits resolveCliActionRequest. This causes the CLI thread-createtopic-create remap to silently fail: getChannelPlugin('telegram').actions.resolveCliActionRequest is undefined, so the bare thread-create action reaches the gateway and is rejected as unsupported.

Related Issue

Closes #81581

Changes

  • extensions/telegram/src/channel.ts: Add resolveCliActionRequest forwarding to the wrapper object, delegating to the existing implementation in channel-actions.ts
  • extensions/telegram/src/channel-actions.test.ts: Add tests verifying the thread-createtopic-create remap and passthrough for other actions

Testing

✓ channel-actions.test.ts (8 tests, all pass)
✓ register.thread.test.ts (2 tests, all pass)

Real behavior proof

I don't have a Telegram bot configured to reproduce end-to-end. However, the root cause is verifiable by code inspection:

  1. register.thread.ts:10 calls getChannelPlugin(channel)?.actions?.resolveCliActionRequest
  2. channel.ts:219-244 defines the telegramMessageActions wrapper — before this fix, it had no resolveCliActionRequest property
  3. Therefore, the optional chain always returned undefined, and the fallback at line 21 dispatched the bare thread-create action
  4. handleAction in the same wrapper (line 234) calls resolveTelegramMessageActionName(action) which has no mapping for thread-create (only topic-create), throwing Unsupported Telegram action: thread-create

The fix adds the missing forwarding — the implementation in channel-actions.ts:164 already handles the remap correctly and is covered by the new unit tests.

CI Notes

  • checks-fast-contracts-plugins-d: Pre-existing failure — codex-mcp-projection and codex-native-task-runtime are undocumented in the SDK guardrail test. Unrelated to this change.
  • Real behavior proof: No Telegram bot available for live verification. Requesting proof: override if the code-level proof above is sufficient.

Changed files

  • extensions/telegram/src/channel-actions.test.ts (modified, +22/-0)
  • extensions/telegram/src/channel.ts (modified, +2/-0)

Code Example

openclaw message thread create \
  --account myrzka_bot \
  --channel telegram \
  --target -1003894873578 \
  --thread-name "Test topic" \
  --json

---

GatewayClientRequestError: Error: Unsupported Telegram action: thread-create

---

[ws] ⇄ res ✗ message.action 64ms errorCode=UNAVAILABLE errorMessage=Error: Unsupported Telegram action: thread-create channel=telegram

---

return {
  action: "topic-create",
  args: {
    ...rest,
    name: readStringValue(threadName),
  },
};

---

curl -X POST "https://api.telegram.org/bot$TOKEN/createForumTopic" \
  --data-urlencode "chat_id=$GROUP_ID" \
  --data-urlencode "name=$TOPIC_NAME"
RAW_BUFFERClick to expand / collapse

Bug Description

openclaw message thread create for the Telegram channel fails with GatewayClientRequestError: Error: Unsupported Telegram action: thread-create. The Telegram plugin's resolveCliActionRequest for the thread-create action — which is supposed to remap to topic-create (the only name the Telegram action runtime recognizes) — isn't taking effect, so the bare thread-create action reaches the gateway and is rejected.

Reproduction

openclaw message thread create \
  --account myrzka_bot \
  --channel telegram \
  --target -1003894873578 \
  --thread-name "Test topic" \
  --json

Result:

GatewayClientRequestError: Error: Unsupported Telegram action: thread-create

Gateway log:

[ws] ⇄ res ✗ message.action 64ms errorCode=UNAVAILABLE errorMessage=Error: Unsupported Telegram action: thread-create channel=telegram

The myrzka_bot account has admin "Manage Topics" permission in the target supergroup (verified empirically — raw https://api.telegram.org/bot$TOKEN/createForumTopic works fine). The bot's channel capabilities list topic-create and topic-edit as supported actions per openclaw channels capabilities.

Environment

  • OpenClaw 2026.5.7 (eeef486)
  • Channel: Telegram (bot token, supergroup target)
  • Bot has admin role + "Manage Topics" permission

Expected behavior

The CLI should remap thread-createtopic-create for Telegram per src/cli/program/message/register.thread.ts:resolveThreadCreateRequest calling getChannelPlugin("telegram")?.actions?.resolveCliActionRequest?.({ action: "thread-create", args: opts }). The Telegram plugin's source at extensions/telegram/src/channel-actions.ts contains the remap logic:

return {
  action: "topic-create",
  args: {
    ...rest,
    name: readStringValue(threadName),
  },
};

But the bare thread-create is reaching the gateway, indicating either:

  • The plugin's resolveCliActionRequest for thread-create isn't being invoked from the CLI dispatcher
  • The remap result is being dropped/ignored
  • The Telegram plugin doesn't export resolveCliActionRequest to the channel plugin loader in this code path

Workaround

Direct Bot API call works:

curl -X POST "https://api.telegram.org/bot$TOKEN/createForumTopic" \
  --data-urlencode "chat_id=$GROUP_ID" \
  --data-urlencode "name=$TOPIC_NAME"

Returns {"ok":true,"result":{"message_thread_id":<N>,...}} and the topic appears in the group. So the underlying bot capability is intact; only the openclaw message thread create CLI dispatch is broken.

Acceptance

  • openclaw message thread create --channel telegram --account <bot> --target <chatId> --thread-name "Foo" succeeds and creates the forum topic
  • Returns the new message_thread_id in the result
  • --dry-run shows the resolved topic-create action, not thread-create

Related context

Filed by the Great-Sarak fleet (operator: Sorotassu). Hit during a kickstart-issue automation script that creates one Telegram forum topic per GitHub issue. Worked around by falling back to raw Bot API; the workaround is at kryshanti/myrzka/.scripts/kickstart-issue.sh in the Great-Sarak fleet for reference.

Will revert to openclaw message thread create in our script once this is fixed.

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

The CLI should remap thread-createtopic-create for Telegram per src/cli/program/message/register.thread.ts:resolveThreadCreateRequest calling getChannelPlugin("telegram")?.actions?.resolveCliActionRequest?.({ action: "thread-create", args: opts }). The Telegram plugin's source at extensions/telegram/src/channel-actions.ts contains the remap logic:

return {
  action: "topic-create",
  args: {
    ...rest,
    name: readStringValue(threadName),
  },
};

But the bare thread-create is reaching the gateway, indicating either:

  • The plugin's resolveCliActionRequest for thread-create isn't being invoked from the CLI dispatcher
  • The remap result is being dropped/ignored
  • The Telegram plugin doesn't export resolveCliActionRequest to the channel plugin loader in this code path

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 openclaw message thread create for Telegram: thread-create → topic-create remap not happening; gateway rejects with Unsupported Telegram action [2 pull requests, 1 comments, 2 participants]