openclaw - ✅(Solved) Fix [Bug]: openclaw configure writes Telegram allowFrom as strings, but DM allowlist matching only works with numeric IDs [1 pull requests, 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#57888Fetched 2026-04-08 01:56:31
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
referenced ×2cross-referenced ×1labeled ×1

openclaw configure wrote my Telegram DM allowlist entry as a quoted string:

"allowFrom": ["1234567890"]

With that config, the bot did not respond to direct messages from the allowlisted account.

After changing the same value to a numeric JSON value:

and restarting the gateway, replies worked immediately.

This looks like a type mismatch between onboarding output and Telegram runtime allowlist matching.

Root Cause

openclaw configure wrote my Telegram DM allowlist entry as a quoted string:

"allowFrom": ["1234567890"]

With that config, the bot did not respond to direct messages from the allowlisted account.

After changing the same value to a numeric JSON value:

and restarting the gateway, replies worked immediately.

This looks like a type mismatch between onboarding output and Telegram runtime allowlist matching.

Fix Action

Fixed

PR fix notes

PR #57948: fix(telegram): ensure sender ID is converted to string before allowFrom matching

Description (problem / solution / changelog)

Summary

Fixes issue where Telegram DM allowlist matching failed when allowFrom was configured with string IDs but worked when configured with numeric IDs.

Root Cause

When allowFrom is configured with string IDs (e.g., "allowFrom": ["1234567890"]), the matching was failing because the sender ID comparison wasn't explicitly converting types before comparison.

Fix

Added explicit string conversion for senderId before comparing against allowFrom entries:

const senderIdStr = senderId ? String(senderId) : undefined;
if (senderIdStr && allow.entries.includes(senderIdStr)) {

This ensures robust matching regardless of how the sender ID is passed (string or number).

Testing

  • All existing Telegram bot tests pass (53 tests)
  • All DM access tests pass (4 tests)

Impact

  • Users can now configure Telegram DM allowlist with either string or numeric IDs
  • Fixes the mismatch between openclaw configure output (strings) and runtime matching

Fixes #57888

Changed files

  • extensions/telegram/src/bot-access.ts (modified, +3/-2)
  • src/infra/matrix-legacy-crypto.ts (modified, +3/-15)

Code Example

"allowFrom": ["1234567890"]

---

"channels": {
  "telegram": {
    "enabled": true,
    "dmPolicy": "allowlist",
    "allowFrom": ["1234567890"]
  }
}

---

"allowFrom": [1234567890]

---
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Summary

openclaw configure wrote my Telegram DM allowlist entry as a quoted string:

"allowFrom": ["1234567890"]

With that config, the bot did not respond to direct messages from the allowlisted account.

After changing the same value to a numeric JSON value:

and restarting the gateway, replies worked immediately.

This looks like a type mismatch between onboarding output and Telegram runtime allowlist matching.

Steps to reproduce

Run openclaw configure Configure Telegram with DM allowlisting enabled Let the wizard write:

"channels": {
  "telegram": {
    "enabled": true,
    "dmPolicy": "allowlist",
    "allowFrom": ["1234567890"]
  }
}

Restart the gateway Send a Telegram DM from that allowlisted account Observe: no reply / DM is not accepted Then:

Change the config manually to:

"allowFrom": [1234567890]

Restart the gateway Send the same Telegram DM again Observe: replies work

Expected behavior

Numeric Telegram sender IDs should work whether they are stored as JSON numbers or numeric strings.

Also, openclaw configure should write the format that runtime accepts.

Actual behavior

Quoted numeric IDs in channels.telegram.allowFrom did not work in my setup. Only unquoted numeric IDs worked.

OpenClaw version

2026.3.28

Operating system

Ubuntu 24.04 LTS (Linux 6.8.0-106-generic, x64)

Install method

npm global

Model

gpt-5.4

Provider / routing chain

Telegram -> OpenClaw gateway (local systemd service) -> direct Telegram channel runtime No external model/provider routing involved in reproducing the bug. Gateway mode: local Gateway bind: lan

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

Affected users/systems/channels: Users configuring the Telegram channel with DM allowlisting via openclaw configure, specifically setups using channels.telegram.dmPolicy = "allowlist" and channels.telegram.allowFrom.

Severity: Blocks workflow. Telegram DMs from the intended allowlisted account were not accepted until the config was manually corrected.

Frequency: Always in the observed setup when allowFrom was stored as a quoted numeric string; worked immediately after changing the same ID to a numeric JSON value.

Consequence: Telegram onboarding appears successful, but direct messages from the configured allowed account do not receive replies. Users must manually edit the config and restart the gateway to restore expected behavior.

Additional information

No response

extent analysis

Fix Plan

To fix the issue, we need to ensure that the allowFrom values in the channels.telegram configuration are written as numeric JSON values instead of quoted strings.

  • Update the openclaw configure script to write numeric IDs as JSON numbers:
"allowFrom": [1234567890]

Instead of:

"allowFrom": ["1234567890"]
  • Alternatively, update the Telegram runtime to accept both numeric strings and JSON numbers for allowFrom values.

Example Code

In the openclaw configure script, parse the input ID as an integer and write it to the config file as a JSON number:

const userId = parseInt(userIdInput, 10);
config.channels.telegram.allowFrom = [userId];

Instead of:

config.channels.telegram.allowFrom = [userIdInput];

Verification

After applying the fix, verify that the allowFrom values are written as numeric JSON values in the config file. Then, restart the gateway and send a Telegram DM from the allowlisted account to ensure that replies are working as expected.

Extra Tips

  • Make sure to test the fix with different input formats (e.g., numeric strings, JSON numbers) to ensure that the Telegram runtime accepts both.
  • Consider adding input validation to the openclaw configure script to ensure that only valid numeric IDs are accepted.

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

Numeric Telegram sender IDs should work whether they are stored as JSON numbers or numeric strings.

Also, openclaw configure should write the format that runtime accepts.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING