openclaw - 💡(How to fix) Fix Plugin runtime resolver fails on bundled package entrypoints, causing Telegram channel crash loop [3 comments, 3 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#75902Fetched 2026-05-03 04:44:30
View on GitHub
Comments
3
Participants
3
Timeline
5
Reactions
2
Timeline (top)
commented ×3closed ×1cross-referenced ×1

The Telegram channel can crash-loop during startup because OpenClaw's plugin/runtime loader does not appear to resolve bare package imports through normal package entrypoints for bundled runtime dependencies.

This is broader than a single json5 package issue. After working around json5, the same failure pattern appeared with tslog.

Root Cause

The Telegram channel can crash-loop during startup because OpenClaw's plugin/runtime loader does not appear to resolve bare package imports through normal package entrypoints for bundled runtime dependencies.

Fix Action

Fix / Workaround

Local workaround that unblocked Telegram

I patched the installed OpenClaw bundle and regenerated runtime cache locally.

After patching and restarting the gateway, Telegram moved past the dependency-resolution crash and logged:

Code Example

OpenClaw: 2026.4.29 (a448042)
Runtime cache: ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96
Node: 25.9.0
OS: macOS 26.4.1 arm64
Telegram account: configured and enabled

---

Telegram default: configured, token=config, enabled

---

[telegram] [default] starting provider (@agentkomersbot)
[telegram] [default] auto-restart attempt ...

---

[telegram] [default] channel exited: Cannot find package 'json5' imported from /Users/agentkomers/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96/dist/redact-vz8FmIJK.js
Did you mean to import "json5/lib/index.js"?

---

[telegram] [default] channel exited: Cannot find package 'tslog' imported from /Users/agentkomers/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96/dist/logger-r45-Bhn_.js
Did you mean to import "tslog/cjs/index.js"?

---

json5@2.2.3
package.json main: lib/index.js
module: dist/index.mjs

---

tslog@4.10.2
package.json main: ./cjs/index.js
module: ./esm/index.js
exports["."].import: ./esm/index.js
exports["."].require: ./cjs/index.js

---

import JSON5 from "json5";
import { Logger } from "tslog";

---

import JSON5 from "./json5-index.mjs";

---

import { Logger } from "../node_modules/tslog/esm/index.js";

---

[telegram] [default] starting provider
[telegram] menu text exceeded the conservative 5700-character payload budget; shortening descriptions to keep 97 commands visible.
RAW_BUFFERClick to expand / collapse

Summary

The Telegram channel can crash-loop during startup because OpenClaw's plugin/runtime loader does not appear to resolve bare package imports through normal package entrypoints for bundled runtime dependencies.

This is broader than a single json5 package issue. After working around json5, the same failure pattern appeared with tslog.

Environment

OpenClaw: 2026.4.29 (a448042)
Runtime cache: ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96
Node: 25.9.0
OS: macOS 26.4.1 arm64
Telegram account: configured and enabled

openclaw channels list showed:

Telegram default: configured, token=config, enabled

The gateway was able to start the Telegram provider for @agentkomersbot, but the provider exited before it could stay online.

Repro / observed behavior

On gateway startup, Telegram repeatedly started and immediately exited:

[telegram] [default] starting provider (@agentkomersbot)
[telegram] [default] auto-restart attempt ...

The initial crash was from a generated runtime file importing json5:

[telegram] [default] channel exited: Cannot find package 'json5' imported from /Users/agentkomers/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96/dist/redact-vz8FmIJK.js
Did you mean to import "json5/lib/index.js"?

After bypassing the json5 import, the next failure showed the same pattern for tslog:

[telegram] [default] channel exited: Cannot find package 'tslog' imported from /Users/agentkomers/.openclaw/plugin-runtime-deps/openclaw-2026.4.29-da6bdffc3d96/dist/logger-r45-Bhn_.js
Did you mean to import "tslog/cjs/index.js"?

Why this looks like a runtime resolver bug

Both packages have valid package entrypoints:

[email protected]
package.json main: lib/index.js
module: dist/index.mjs
[email protected]
package.json main: ./cjs/index.js
module: ./esm/index.js
exports["."].import: ./esm/index.js
exports["."].require: ./cjs/index.js

Generated OpenClaw runtime files import them as bare package imports:

import JSON5 from "json5";
import { Logger } from "tslog";

Those should resolve via package main/module/exports, but in the plugin runtime they fail before Telegram can finish startup.

Local workaround that unblocked Telegram

I patched the installed OpenClaw bundle and regenerated runtime cache locally.

For json5, importing explicit package subpaths was still flaky during runtime dependency staging, so I vendored the package ESM entrypoint into OpenClaw's dist folder and changed generated imports to a local file:

import JSON5 from "./json5-index.mjs";

For tslog, changing the generated import to the explicit ESM entrypoint worked:

import { Logger } from "../node_modules/tslog/esm/index.js";

After patching and restarting the gateway, Telegram moved past the dependency-resolution crash and logged:

[telegram] [default] starting provider
[telegram] menu text exceeded the conservative 5700-character payload budget; shortening descriptions to keep 97 commands visible.

Expected behavior

The plugin/runtime loader should resolve bare imports for bundled runtime deps according to package entrypoints, or the generated bundle should avoid bare imports for packages whose entrypoints are known.

Telegram startup should not crash-loop before reaching Telegram API/auth logic.

Actual behavior

The Telegram channel crash-looped during module loading due to unresolved bundled dependencies.

Possible fix

One of:

  1. Fix the plugin runtime/Jiti/module loader so bare package imports honor package.json main/module/exports in the runtime dependency directory.
  2. Generate explicit subpath imports for bundled dependencies such as json5 and tslog.
  3. Ensure channel/plugin startup only begins after bundled runtime dependency staging is fully complete and visible to the module loader.

Related note: this may affect other generated runtime imports beyond Telegram; Telegram was just the channel that exposed the issue during startup.

extent analysis

TL;DR

The most likely fix is to modify the plugin/runtime loader to resolve bare package imports according to package entrypoints or generate explicit subpath imports for bundled dependencies.

Guidance

  • Verify that the package.json files of the bundled dependencies (json5 and tslog) have correct main, module, and exports fields.
  • Check if the generated runtime files are using bare package imports for these dependencies, and consider changing them to explicit subpath imports.
  • Ensure that the channel/plugin startup only begins after bundled runtime dependency staging is fully complete and visible to the module loader.
  • Consider patching the installed OpenClaw bundle and regenerating the runtime cache locally, as done in the local workaround.

Example

// Before
import JSON5 from "json5";
import { Logger } from "tslog";

// After (explicit subpath imports)
import JSON5 from "./json5-index.mjs";
import { Logger } from "../node_modules/tslog/esm/index.js";

Notes

This issue may affect other generated runtime imports beyond Telegram, so a thorough verification of all dependencies is recommended.

Recommendation

Apply a workaround by generating explicit subpath imports for bundled dependencies, as this approach has been shown to work in the local workaround. This will allow the Telegram channel to start up without crash-looping due to unresolved dependencies.

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 plugin/runtime loader should resolve bare imports for bundled runtime deps according to package entrypoints, or the generated bundle should avoid bare imports for packages whose entrypoints are known.

Telegram startup should not crash-loop before reaching Telegram API/auth logic.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING