Every inbound Telegram message fails with “Something went wrong while processing your request. Please try again.” Gateway starts cleanly — no config errors, all plugins load, Telegram bot connects and polls. The error only surfaces when a message actually arrives:
telegram dispatch failed: ReferenceError: resolveMainSessionKey is not defined
telegram bot error: ReferenceError: resolveMainSessionKey is not defined
at drainFormattedSystemEvents (session-system-events-CtqtoK1L.js:46:78)
at runPreparedReply (pi-embedded-BaSvmUpW.js:94161:28)
npm install -g openclaw2026.3.24 via npm install -g openclaw (may require interrupted install or stale npm cache to trigger)Exact trigger unknown — two boxes with identical version tags had different file contents. Suspected partial npm install, interrupted download, or CDN serving stale tarball.
ReferenceError: resolveMainSessionKey is not defined — every message fails silently from the user’s perspectiveThe bundled file session-system-events-CtqtoK1L.js references resolveMainSessionKey() but doesn’t import it. The function is defined in main-session-DF6UibWM.js.
import { i as resolveMainSessionKey } from "./main-session-DF6UibWM.js";
// ...
const mainSessionKey = resolveMainSessionKey(params.cfg);
if (mainSessionKey !== params.sessionKey) {
queued.push(...drainSystemEventEntries(mainSessionKey));
}
queued.sort((left, right) => left.ts - right.ts);
// NO import for resolveMainSessionKey
// ...
// Logic crammed into one line, calls undefined function:
const queued = drainSystemEventEntries(params.sessionKey); const _mainKey = resolveMainSessionKey(params.cfg); if (_mainKey !== params.sessionKey) { queued.push(...drainSystemEventEntries(_mainKey)); } queued.sort((a, b) => a.ts - b.ts);
openclaw gateway status shows healthy ✅Copy the working file from a known-good install:
scp good-box:/usr/lib/node_modules/openclaw/dist/session-system-events-CtqtoK1L.js \
broken-box:/usr/lib/node_modules/openclaw/dist/session-system-events-CtqtoK1L.js
openclaw gateway restart
Or do a clean reinstall:
npm cache clean --force
npm install -g openclaw
openclaw gateway restart