openclaw - 💡(How to fix) Fix Bundled openshell module crashes exec tool — requires TELEGRAM_BOT_TOKEN even when standalone CLI is used [1 comments, 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#56813Fetched 2026-04-08 01:47:34
View on GitHub
Comments
1
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
commented ×1subscribed ×1

The bundled openshell npm module at /usr/lib/node_modules/openclaw/node_modules/openshell requires TELEGRAM_BOT_TOKEN at startup, even when no Telegram integration is configured. When this env var is absent, the exec tool fails with:

[tools] exec failed: [openshell] Failed to start: Error: TELEGRAM_BOT_TOKEN is required.
    at loadConfig (file:///usr/lib/node_modules/openclaw/node_modules/openshell/dist/config.js:37:15)

This blocks all exec tool calls in sandboxed sessions.

Error Message

[tools] exec failed: [openshell] Failed to start: Error: TELEGRAM_BOT_TOKEN is required. at loadConfig (file:///usr/lib/node_modules/openclaw/node_modules/openshell/dist/config.js:37:15)

Root Cause

The bundled openshell npm module at /usr/lib/node_modules/openclaw/node_modules/openshell requires TELEGRAM_BOT_TOKEN at startup, even when no Telegram integration is configured. When this env var is absent, the exec tool fails with:

[tools] exec failed: [openshell] Failed to start: Error: TELEGRAM_BOT_TOKEN is required.
    at loadConfig (file:///usr/lib/node_modules/openclaw/node_modules/openshell/dist/config.js:37:15)

This blocks all exec tool calls in sandboxed sessions.

Fix Action

Workaround

Rename the bundled module so OpenClaw falls back to the standalone CLI:

sudo mv /usr/lib/node_modules/openclaw/node_modules/openshell \
        /usr/lib/node_modules/openclaw/node_modules/openshell.disabled

This must be reapplied after every npm install -g openclaw upgrade, as the module is reinstalled.

Code Example

[tools] exec failed: [openshell] Failed to start: Error: TELEGRAM_BOT_TOKEN is required.
    at loadConfig (file:///usr/lib/node_modules/openclaw/node_modules/openshell/dist/config.js:37:15)

---

sudo mv /usr/lib/node_modules/openclaw/node_modules/openshell \
        /usr/lib/node_modules/openclaw/node_modules/openshell.disabled
RAW_BUFFERClick to expand / collapse

Version: OpenClaw 2026.3.24 and 2026.3.28

Environment: Ubuntu 22.04, OpenShell 0.0.16 (standalone CLI at ~/.local/bin/openshell), OpenClaw installed globally via npm install -g openclaw

Description

The bundled openshell npm module at /usr/lib/node_modules/openclaw/node_modules/openshell requires TELEGRAM_BOT_TOKEN at startup, even when no Telegram integration is configured. When this env var is absent, the exec tool fails with:

[tools] exec failed: [openshell] Failed to start: Error: TELEGRAM_BOT_TOKEN is required.
    at loadConfig (file:///usr/lib/node_modules/openclaw/node_modules/openshell/dist/config.js:37:15)

This blocks all exec tool calls in sandboxed sessions.

Workaround

Rename the bundled module so OpenClaw falls back to the standalone CLI:

sudo mv /usr/lib/node_modules/openclaw/node_modules/openshell \
        /usr/lib/node_modules/openclaw/node_modules/openshell.disabled

This must be reapplied after every npm install -g openclaw upgrade, as the module is reinstalled.

Expected behavior

The bundled openshell module should not require TELEGRAM_BOT_TOKEN when Telegram is not configured. Alternatively, OpenClaw should prefer the standalone OpenShell CLI (openshell on PATH) when sandbox.backend: "openshell" is configured and the standalone CLI is available.

Impact

Critical — all exec tool calls fail in sandboxed sessions until the workaround is applied. Affects any deployment using standalone OpenShell with OpenClaw's sandbox backend.

extent analysis

Fix Plan

To resolve the issue, we need to modify the openshell module to not require the TELEGRAM_BOT_TOKEN environment variable when Telegram integration is not configured. We can achieve this by updating the config.js file in the openshell module.

Code Changes

We need to update the loadConfig function in config.js to check if Telegram integration is configured before requiring the TELEGRAM_BOT_TOKEN environment variable.

// config.js
function loadConfig() {
  // ... existing code ...

  if (process.env.TELEGRAM_INTEGRATION_ENABLED === 'true') {
    if (!process.env.TELEGRAM_BOT_TOKEN) {
      throw new Error('TELEGRAM_BOT_TOKEN is required.');
    }
  }

  // ... existing code ...
}

Alternatively, we can modify the OpenClaw configuration to prefer the standalone OpenShell CLI when sandbox.backend is set to "openshell" and the standalone CLI is available.

// openclaw.config.js
module.exports = {
  // ... existing config ...
  sandbox: {
    backend: 'openshell',
    useStandaloneCli: true,
  },
};

Verification

To verify the fix, restart the OpenClaw service and check if the exec tool calls are working as expected in sandboxed sessions. You can also check the logs to ensure that the TELEGRAM_BOT_TOKEN error is no longer present.

Extra Tips

To prevent regressions, make sure to update the openshell module to the latest version and test the changes thoroughly. Additionally, consider adding a check to ensure that the standalone OpenShell CLI is available before attempting to use it.

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 bundled openshell module should not require TELEGRAM_BOT_TOKEN when Telegram is not configured. Alternatively, OpenClaw should prefer the standalone OpenShell CLI (openshell on PATH) when sandbox.backend: "openshell" is configured and the standalone CLI is available.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING