openclaw - ✅(Solved) Fix Telegram CLI message send can hang instead of delegating to gateway [1 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#75477Fetched 2026-05-02 05:34:07
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
3
Author
Timeline (top)
cross-referenced ×2commented ×1subscribed ×1

openclaw message send --channel telegram ... can hang or fail to return even when the gateway is healthy and direct openclaw gateway call message.action ... succeeds.

Error Message

On a production gateway with Telegram accounts running and connected:

Root Cause

There are two related problems:

  1. The bundled Telegram plugin wrapper does not forward actions.resolveExecutionMode, so the CLI path can treat gateway-owned Telegram message actions as local actions.
  2. The CLI message command eagerly loads the configured channel plugin registry before dispatch. For Telegram sends this can initialize Telegram channel runtime in the CLI process instead of delegating directly to the live gateway.
  3. Message action gateway calls use the least-privilege helper directly, while the CLI path should use normal CLI gateway scopes.

Fix Action

Fix / Workaround

  1. The bundled Telegram plugin wrapper does not forward actions.resolveExecutionMode, so the CLI path can treat gateway-owned Telegram message actions as local actions.
  2. The CLI message command eagerly loads the configured channel plugin registry before dispatch. For Telegram sends this can initialize Telegram channel runtime in the CLI process instead of delegating directly to the live gateway.
  3. Message action gateway calls use the least-privilege helper directly, while the CLI path should use normal CLI gateway scopes.
pnpm exec vitest run extensions/telegram/src/channel-actions.contract.test.ts src/cli/program/message/helpers.test.ts
pnpm exec vitest run src/infra/outbound/message-action-runner.plugin-dispatch.test.ts src/infra/outbound/message.channels.test.ts src/infra/outbound/message.test.ts

PR fix notes

PR #75478: Fix Telegram CLI message sends hanging before gateway dispatch

Description (problem / solution / changelog)

Summary

Fixes openclaw message send --channel telegram ... hanging in the local CLI process by ensuring Telegram sends are delegated to the live gateway message-action path.

Fixes #75477

Changes

  • Preserve Telegram actions.resolveExecutionMode through the bundled plugin wrapper so gateway-owned message actions stay gateway-owned.
  • Use the normal CLI gateway helper for message-action gateway calls instead of forcing least-privilege helper semantics on the CLI path.
  • Add a Telegram-specific CLI send fast path that calls message.action directly and avoids loading the local channel plugin registry/runtime in the CLI process.
  • Add regression coverage for the wrapper execution mode and CLI fast path.

Validation

pnpm exec vitest run extensions/telegram/src/channel-actions.contract.test.ts src/cli/program/message/helpers.test.ts
pnpm exec vitest run src/infra/outbound/message-action-runner.plugin-dispatch.test.ts src/infra/outbound/message.channels.test.ts src/infra/outbound/message.test.ts

Local production validation on a downstream fork confirmed:

openclaw message send --channel telegram --account default --target <chat> --message "..." --json

returns a gateway-handled JSON payload with Telegram messageId instead of leaving a stuck openclaw-message process.

Changed files

  • extensions/telegram/src/channel-actions.contract.test.ts (modified, +7/-1)
  • extensions/telegram/src/channel.ts (modified, +4/-0)
  • src/cli/program/message/helpers.test.ts (modified, +59/-0)
  • src/cli/program/message/helpers.ts (modified, +107/-0)
  • src/infra/outbound/message-action-runner.plugin-dispatch.test.ts (modified, +9/-9)
  • src/infra/outbound/message-action-runner.ts (modified, +2/-2)
  • src/infra/outbound/message.gateway.runtime.ts (modified, +1/-1)
  • src/infra/outbound/message.ts (modified, +2/-2)

Code Example

pnpm exec vitest run extensions/telegram/src/channel-actions.contract.test.ts src/cli/program/message/helpers.test.ts
pnpm exec vitest run src/infra/outbound/message-action-runner.plugin-dispatch.test.ts src/infra/outbound/message.channels.test.ts src/infra/outbound/message.test.ts
RAW_BUFFERClick to expand / collapse

Summary

openclaw message send --channel telegram ... can hang or fail to return even when the gateway is healthy and direct openclaw gateway call message.action ... succeeds.

Observed behavior

On a production gateway with Telegram accounts running and connected:

  • openclaw gateway call channels.status --params '{"probe":false}' reports Telegram accounts as running/connected.
  • openclaw gateway call message.action --params '{...}' sends successfully and returns a Telegram message id.
  • openclaw message send --channel telegram --account default --target ... --message ... --json may remain stuck in a local openclaw-message process and never prints JSON.

The local CLI process also loads/stages Telegram bundled runtime dependencies before hanging, which is unnecessary for a gateway-owned Telegram send.

Root cause

There are two related problems:

  1. The bundled Telegram plugin wrapper does not forward actions.resolveExecutionMode, so the CLI path can treat gateway-owned Telegram message actions as local actions.
  2. The CLI message command eagerly loads the configured channel plugin registry before dispatch. For Telegram sends this can initialize Telegram channel runtime in the CLI process instead of delegating directly to the live gateway.
  3. Message action gateway calls use the least-privilege helper directly, while the CLI path should use normal CLI gateway scopes.

Expected behavior

openclaw message send --channel telegram ... should route through the live gateway message action path and return a confirmed result, without initializing Telegram runtime in the CLI process.

Validation

The attached PR adds coverage for:

  • Telegram message actions preserving gateway-owned execution mode through the wrapper.
  • CLI Telegram sends using a gateway fast path without local plugin registry loading.
  • Message action gateway calls using the CLI gateway helper path.

Tested with:

pnpm exec vitest run extensions/telegram/src/channel-actions.contract.test.ts src/cli/program/message/helpers.test.ts
pnpm exec vitest run src/infra/outbound/message-action-runner.plugin-dispatch.test.ts src/infra/outbound/message.channels.test.ts src/infra/outbound/message.test.ts

extent analysis

TL;DR

Apply the changes from the attached PR to fix the openclaw message send command hanging issue by ensuring the CLI uses the gateway fast path for Telegram sends.

Guidance

  • Review the PR changes to understand how the actions.resolveExecutionMode is forwarded and how the CLI message command is modified to use the gateway fast path.
  • Verify that the openclaw gateway call message.action command succeeds before applying the fix to ensure the gateway is healthy.
  • Test the openclaw message send command with the --channel telegram option after applying the PR changes to confirm the fix.
  • Check the test coverage added in the PR to ensure the fix is properly validated.

Example

No code snippet is provided as the issue is resolved through a PR with specific changes.

Notes

The fix relies on the attached PR, which adds coverage for the specific issues mentioned. Ensure the PR is properly reviewed and tested before applying the changes.

Recommendation

Apply the workaround by merging the attached PR, as it addresses the root causes of the issue and provides proper test coverage.

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

openclaw message send --channel telegram ... should route through the live gateway message action path and return a confirmed result, without initializing Telegram runtime in the CLI process.

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 Telegram CLI message send can hang instead of delegating to gateway [1 pull requests, 1 comments, 2 participants]