openclaw - ✅(Solved) Fix Bug: 2026.4.7 breaks Telegram bundled plugin and doctor may rewrite config to minimal stub [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#62903Fetched 2026-04-09 08:01:00
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Timeline (top)
closed ×1commented ×1cross-referenced ×1

Updating OpenClaw to 2026.4.7 can make the installation unusable in two ways:

  1. The Telegram bundled plugin path is broken after upgrade, causing config validation failure and gateway abort.
  2. Running openclaw doctor after that can rewrite an existing config into a minimal stub, making recovery harder.

Error Message

Config invalid

File: ~/.openclaw/openclaw.json

Problem:

  • <root>: read failed: Error: bundled plugin entry "./src/channel.setup.js" failed to open from "/Users/qianglin/.npm-global/lib/node_modules/openclaw/dist/extensions/telegram/setup-entry.js" (resolved "/Users/qianglin/.npm-global/lib/node_modules/openclaw/dist/extensions/telegram/src/channel.setup.js", plugin root "/Users/qianglin/.npm-global/lib/node_modules/openclaw/dist/extensions/telegram", reason "path"): ENOENT: no such file or directory, lstat '/Users/qianglin/.npm-global/lib/node_modules/openclaw/dist/extensions/telegram/src/channel.setup.js'

Gateway aborted: config is invalid.

Root Cause

Impact

After upgrade, OpenClaw may fail to start at all:

  • Config invalid
  • Gateway aborted: config is invalid
  • CLI status commands fail because config load fails

Fix Action

Fixed

PR fix notes

PR #62900: fix(telegram): stop setup entry from deep-importing src

Description (problem / solution / changelog)

Summary

  • point the bundled Telegram setup entry at packaged dist-facing sidecar modules instead of missing ./src/* files
  • add focused regression coverage for loading Telegram setup sidecars from a dist-only bundled plugin layout

Change Type

  • Bug fix
  • New feature
  • Breaking change
  • Refactor
  • Docs
  • Test-only

Scope

This PR is intentionally narrow.

It only changes the bundled Telegram setup entry specifiers and adds focused regression coverage around packaged bundled-entry loading.

It does not change:

  • bundled loader fallback semantics
  • non-Telegram bundled channel entries
  • plugin update flow
  • packaging behavior outside the Telegram setup entry metadata

Linked Issue/PR

  • Related #62867
  • Related #62868
  • Related #62875
  • Related #62880
  • Related #62886
  • Related #62904
  • Related #62905
  • Related #62898
  • Related #62903
  • This PR fixes a bug or regression

Root Cause / Regression History

The bundled Telegram setup-entry.ts still referenced ./src/channel.setup.js and ./src/secret-contract.js.

That works in the source tree, but the published npm package does not ship dist/extensions/telegram/src/**. It ships the dist-facing sidecar entry modules (./channel-plugin-api.js and ./secret-contract-api.js) instead.

After upgrading to 2026.4.7, bundled setup entry resolution could therefore fail during config load / gateway startup with ENOENT while trying to open the missing ./src/... files from dist/extensions/telegram.

Behavior Changes

Before:

  • the bundled Telegram setup entry tried to load ./src/channel.setup.js
  • the bundled Telegram setup entry tried to load ./src/secret-contract.js
  • packaged npm installs could fail config load or gateway startup with a bundled plugin entry ENOENT

After:

  • the bundled Telegram setup entry loads ./channel-plugin-api.js
  • the bundled Telegram setup entry loads ./secret-contract-api.js
  • setup plugin and setup secrets sidecars resolve correctly from a dist-only bundled plugin layout

Regression Test Plan

Updated:

  • src/plugin-sdk/channel-entry-contract.test.ts

Coverage:

  • creates a temporary dist-only dist/extensions/telegram plugin root
  • verifies ./channel-plugin-api.js resolves telegramSetupPlugin
  • verifies ./secret-contract-api.js resolves channelSecrets
  • keeps the contracts boundary lane green after narrowing the fix back down to Telegram only

Repro + Verification

Observed on an installed npm-global runtime:

  • config loading and plugin update were blocked by bundled plugin entry "./src/channel.setup.js" failed to open from dist/extensions/telegram/setup-entry.js

With this patch:

  • the focused contracts boundary test still passes
  • a dist-only runtime check using loadBundledEntryExportSync(...) successfully loads both Telegram setup sidecars through the new specifiers
  • the same specifier swap applied to the installed runtime unblocked config loading and let openclaw plugins update lossless-claw proceed normally

Tests

Passed locally:

  • node scripts/run-vitest.mjs run --config vitest.contracts.config.ts src/plugins/contracts/boundary-invariants.test.ts

Additional focused coverage added in this PR:

  • loads packaged telegram setup sidecars from dist-facing api modules

Did not run full repo pre-commit:

  • local git commit hooks were slow / stuck in the broader pnpm check -> tsgo chain, so I used focused validation for this narrow fix instead

Risks and Mitigations

Risk:

  • the Telegram bundled setup entry now depends on the dist-facing facade modules being the supported packaged contract

Mitigation:

  • those facade modules are already present in packaged installs
  • the new regression test exercises a dist-only bundled plugin layout directly
  • the change is limited to Telegram setup-entry metadata and does not alter shared loader behavior

AI assistance

AI-assisted: drafted and implemented with Codex, then locally reviewed and tested by me.

Changed files

  • src/plugin-sdk/channel-entry-contract.test.ts (modified, +19/-18)

Code Example

Config invalid

File: ~/.openclaw/openclaw.json

Problem:
 - <root>: read failed: Error: bundled plugin entry "./src/channel.setup.js" failed to open from "/Users/qianglin/.npm-global/lib/node_modules/openclaw/dist/extensions/telegram/setup-entry.js" (resolved "/Users/qianglin/.npm-global/lib/node_modules/openclaw/dist/extensions/telegram/src/channel.setup.js", plugin root "/Users/qianglin/.npm-global/lib/node_modules/openclaw/dist/extensions/telegram", reason "path"): ENOENT: no such file or directory, lstat '/Users/qianglin/.npm-global/lib/node_modules/openclaw/dist/extensions/telegram/src/channel.setup.js'

Gateway aborted: config is invalid.

---

Cannot find module 'grammy'

---

{
  "channels": {
    "whatsapp": {
      "enabled": true
    }
  },
  "wizard": {
    "lastRunAt": "2026-04-08T03:44:16.258Z",
    "lastRunVersion": "2026.4.7",
    "lastRunCommand": "doctor",
    "lastRunMode": "local"
  },
  "meta": {
    "lastTouchedVersion": "2026.4.7",
    "lastTouchedAt": "2026-04-08T03:44:16.435Z"
  }
}
RAW_BUFFERClick to expand / collapse

Summary

Updating OpenClaw to 2026.4.7 can make the installation unusable in two ways:

  1. The Telegram bundled plugin path is broken after upgrade, causing config validation failure and gateway abort.
  2. Running openclaw doctor after that can rewrite an existing config into a minimal stub, making recovery harder.

Impact

After upgrade, OpenClaw may fail to start at all:

  • Config invalid
  • Gateway aborted: config is invalid
  • CLI status commands fail because config load fails

This is effectively a hard failure for users with Telegram configured.

Environment

  • macOS (Darwin arm64)
  • Global install under ~/.npm-global/lib/node_modules/openclaw
  • Upgraded to 2026.4.7 (5050017)
  • Config path: ~/.openclaw/openclaw.json

Reproduction

  1. Upgrade OpenClaw to 2026.4.7
  2. Have Telegram configured in ~/.openclaw/openclaw.json
  3. Run:
    • openclaw status
    • or openclaw gateway status
  4. Observe config read failure
  5. Then run openclaw doctor / openclaw doctor --fix
  6. Observe config may be rewritten to a minimal stub

Actual Result

Config load fails with missing bundled Telegram plugin entry:

Config invalid

File: ~/.openclaw/openclaw.json

Problem:
 - <root>: read failed: Error: bundled plugin entry "./src/channel.setup.js" failed to open from "/Users/qianglin/.npm-global/lib/node_modules/openclaw/dist/extensions/telegram/setup-entry.js" (resolved "/Users/qianglin/.npm-global/lib/node_modules/openclaw/dist/extensions/telegram/src/channel.setup.js", plugin root "/Users/qianglin/.npm-global/lib/node_modules/openclaw/dist/extensions/telegram", reason "path"): ENOENT: no such file or directory, lstat '/Users/qianglin/.npm-global/lib/node_modules/openclaw/dist/extensions/telegram/src/channel.setup.js'

Gateway aborted: config is invalid.

In another attempt after upgrade, CLI also failed with missing dependency:

Cannot find module 'grammy'

Additional Problem: doctor rewrites config

After running openclaw doctor, the config was reduced to something like:

{
  "channels": {
    "whatsapp": {
      "enabled": true
    }
  },
  "wizard": {
    "lastRunAt": "2026-04-08T03:44:16.258Z",
    "lastRunVersion": "2026.4.7",
    "lastRunCommand": "doctor",
    "lastRunMode": "local"
  },
  "meta": {
    "lastTouchedVersion": "2026.4.7",
    "lastTouchedAt": "2026-04-08T03:44:16.435Z"
  }
}

This appears to overwrite or discard the original config contents instead of safely repairing it.

Expected Result

  • Upgrading to 2026.4.7 should keep bundled Telegram plugin paths valid
  • Required Telegram dependencies (such as grammy) should be present after install
  • openclaw doctor should never destructively collapse a valid existing config into a minimal stub

Suspected Root Cause

  • Broken packaging/publish artifact for bundled Telegram extension in dist/extensions/telegram
  • Possible missing dependency inclusion for Telegram stack (grammy)
  • doctor behavior under invalid/broken install may be too destructive

Notes

This issue is severe because it can both:

  • break startup, and
  • damage the user's config during attempted recovery.

extent analysis

TL;DR

Downgrade to a previous version of OpenClaw or manually restore the original config after running openclaw doctor to mitigate the issue.

Guidance

  • Verify the Telegram plugin path and dependencies are correctly configured before upgrading to 2026.4.7.
  • Check the openclaw.json file for any changes after running openclaw doctor and restore the original config if necessary.
  • Consider reinstalling the grammy dependency manually if it's missing after the upgrade.
  • Be cautious when running openclaw doctor as it may overwrite the existing config.

Example

No code snippet is provided as the issue is related to configuration and dependency management.

Notes

The root cause of the issue seems to be related to the packaging and publishing of the bundled Telegram extension and missing dependencies. The doctor command's behavior may also be too destructive, leading to config loss.

Recommendation

Apply a workaround by downgrading to a previous version of OpenClaw or manually restoring the original config after running openclaw doctor, as upgrading to 2026.4.7 seems to introduce the issue.

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