openclaw - 💡(How to fix) Fix [Bug]: toLowerCase crash on every message in 2026.5.20! bootstrap file name undefined

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…

After updating to OpenClaw 2026.5.20, every incoming message crashes during bootstrap context building with TypeError: Cannot read properties of undefined (reading 'toLowerCase'), preventing all agent replies.

Error Message

Stack trace from gateway log (/tmp/openclaw/openclaw-2026-05-22.log):

TypeError: Cannot read properties of undefined (reading 'toLowerCase') at isAgentsBootstrapFile (pi-embedded-helpers-C95s_0hC.js:84:18) at trimBootstrapContent (pi-embedded-helpers-C95s_0hC.js:168:6) at buildBootstrapContextFiles (pi-embedded-helpers-C95s_0hC.js:279:19) at buildBootstrapContextForFiles (bootstrap-files-C7GTd8nX.js:195:9) at resolveBootstrapContextForRun (selection-BmjEdnnA.js:12896:20) at runEmbeddedAttempt (selection-BmjEdnnA.js:12876:136)

Also occurs at:

TypeError: Cannot read properties of undefined (reading 'toLowerCase') at isAgentsBootstrapName (bootstrap-budget-WP_UMPQC.js:15:14) at formatBootstrapTruncationWarningLines (bootstrap-budget-WP_UMPQC.js:152:52)

Preceding log line confirms an undefined filename in the bootstrap list:

workspace bootstrap file undefined is 129132 chars (limit 10232); truncating in injected context

Model fallback decision log confirming the crash:

model fallback decision: decision=candidate_failed requested=ollama/kimi-k2.6:cloud candidate=ollama/kimi-k2.6:cloud reason=unknown next=openrouter/moonshotai/kimi-k2.6 detail=Cannot read properties of undefined (reading 'toLowerCase')

Root Cause

The crash occurs because a workspace bootstrap file entry has an undefined name property, and two functions call .toLowerCase() without null-safety: isAgentsBootstrapFile(fileName) and isAgentsBootstrapName(name). Temporary workaround is adding ?. optional chaining to both calls in dist/, but the proper fix is upstream: ensuring the bootstrap file list builder never emits entries with undefined names, or adding defensive null checks in the TypeScript source.

Fix Action

Fix / Workaround

  • Affected users/systems/channels: All users across all channels (Telegram direct messages and groups). The crash happens in the shared bootstrap context builder before any channel-specific code runs.
    • Severity: Critical — blocks all agent replies. Gateway starts and connects to channels, but every single message fails before the agent can respond.
    • Frequency: Always. 100% of messages reproduce the crash. Observed on 6+ consecutive messages.
    • Consequence: Complete agent outage. The gateway is effectively unusable until the crash is patched or the undefined filename entry is removed from the workspace bootstrap list.

The crash occurs because a workspace bootstrap file entry has an undefined name property, and two functions call .toLowerCase() without null-safety: isAgentsBootstrapFile(fileName) and isAgentsBootstrapName(name). Temporary workaround is adding ?. optional chaining to both calls in dist/, but the proper fix is upstream: ensuring the bootstrap file list builder never emits entries with undefined names, or adding defensive null checks in the TypeScript source.

Code Example

Stack trace from gateway log (/tmp/openclaw/openclaw-2026-05-22.log):

  TypeError: Cannot read properties of undefined (reading 'toLowerCase')
      at isAgentsBootstrapFile (pi-embedded-helpers-C95s_0hC.js:84:18)
      at trimBootstrapContent (pi-embedded-helpers-C95s_0hC.js:168:6)
      at buildBootstrapContextFiles (pi-embedded-helpers-C95s_0hC.js:279:19)
      at buildBootstrapContextForFiles (bootstrap-files-C7GTd8nX.js:195:9)
      at resolveBootstrapContextForRun (selection-BmjEdnnA.js:12896:20)
      at runEmbeddedAttempt (selection-BmjEdnnA.js:12876:136)

  Also occurs at:

  TypeError: Cannot read properties of undefined (reading 'toLowerCase')
      at isAgentsBootstrapName (bootstrap-budget-WP_UMPQC.js:15:14)
      at formatBootstrapTruncationWarningLines (bootstrap-budget-WP_UMPQC.js:152:52)

  Preceding log line confirms an undefined filename in the bootstrap list:

  workspace bootstrap file undefined is 129132 chars (limit 10232); truncating in injected context

  Model fallback decision log confirming the crash:

  model fallback decision: decision=candidate_failed requested=ollama/kimi-k2.6:cloud
  candidate=ollama/kimi-k2.6:cloud reason=unknown next=openrouter/moonshotai/kimi-k2.6
  detail=Cannot read properties of undefined (reading 'toLowerCase')
RAW_BUFFERClick to expand / collapse

Bug type

Crash (process/app exits or hangs)

Beta release blocker

No

Summary

After updating to OpenClaw 2026.5.20, every incoming message crashes during bootstrap context building with TypeError: Cannot read properties of undefined (reading 'toLowerCase'), preventing all agent replies.

Steps to reproduce

  1. Update to OpenClaw 2026.5.20 (build e510042)
  2. Start gateway: openclaw gateway --port 18789
  3. Send any Telegram direct message to the bot
  4. Observe logs: Embedded agent failed before reply: Cannot read properties of undefined (reading 'toLowerCase')

Expected behavior

Prior versions (e.g., 2026.5.16) processed messages normally without bootstrap context crashes.

Actual behavior

Prior versions (e.g., 2026.5.16) processed messages normally without bootstrap context crashes.

Actual behavior: Gateway starts successfully and Telegram polling connects, but every message fails. Full stack trace:

TypeError: Cannot read properties of undefined (reading 'toLowerCase') at isAgentsBootstrapFile (dist/pi-embedded-helpers-C95s_0hC.js:84:18) at trimBootstrapContent (dist/pi-embedded-helpers-C95s_0hC.js:168:6) at buildBootstrapContextFiles (dist/pi-embedded-helpers-C95s_0hC.js:279:19) at buildBootstrapContextForFiles (dist/bootstrap-files-C7GTd8nX.js:195:9) at resolveBootstrapContextForRun (dist/selection-BmjEdnnA.js:12896:20)

Also hits bootstrap-budget-WP_UMPQC.js:15 (isAgentsBootstrapName).

OpenClaw version

2026.5.20 (e510042)

Operating system

Ubuntu (Linux 7.0.5-orbstack-00330-ge3df4e19b0a0-dirty)

Install method

No response

Model

ollama/kimi-k2.6:cloud

Provider / routing chain

ollama (primary) → openrouter/moonshotai/kimi-k2.6 (fallback)

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Stack trace from gateway log (/tmp/openclaw/openclaw-2026-05-22.log):

  TypeError: Cannot read properties of undefined (reading 'toLowerCase')
      at isAgentsBootstrapFile (pi-embedded-helpers-C95s_0hC.js:84:18)
      at trimBootstrapContent (pi-embedded-helpers-C95s_0hC.js:168:6)
      at buildBootstrapContextFiles (pi-embedded-helpers-C95s_0hC.js:279:19)
      at buildBootstrapContextForFiles (bootstrap-files-C7GTd8nX.js:195:9)
      at resolveBootstrapContextForRun (selection-BmjEdnnA.js:12896:20)
      at runEmbeddedAttempt (selection-BmjEdnnA.js:12876:136)

  Also occurs at:

  TypeError: Cannot read properties of undefined (reading 'toLowerCase')
      at isAgentsBootstrapName (bootstrap-budget-WP_UMPQC.js:15:14)
      at formatBootstrapTruncationWarningLines (bootstrap-budget-WP_UMPQC.js:152:52)

  Preceding log line confirms an undefined filename in the bootstrap list:

  workspace bootstrap file undefined is 129132 chars (limit 10232); truncating in injected context

  Model fallback decision log confirming the crash:

  model fallback decision: decision=candidate_failed requested=ollama/kimi-k2.6:cloud
  candidate=ollama/kimi-k2.6:cloud reason=unknown next=openrouter/moonshotai/kimi-k2.6
  detail=Cannot read properties of undefined (reading 'toLowerCase')

Impact and severity

  • Affected users/systems/channels: All users across all channels (Telegram direct messages and groups). The crash happens in the shared bootstrap context builder before any channel-specific code runs.
  • Severity: Critical — blocks all agent replies. Gateway starts and connects to channels, but every single message fails before the agent can respond.
  • Frequency: Always. 100% of messages reproduce the crash. Observed on 6+ consecutive messages.
  • Consequence: Complete agent outage. The gateway is effectively unusable until the crash is patched or the undefined filename entry is removed from the workspace bootstrap list.

Additional information

The crash occurs because a workspace bootstrap file entry has an undefined name property, and two functions call .toLowerCase() without null-safety: isAgentsBootstrapFile(fileName) and isAgentsBootstrapName(name). Temporary workaround is adding ?. optional chaining to both calls in dist/, but the proper fix is upstream: ensuring the bootstrap file list builder never emits entries with undefined names, or adding defensive null checks in the TypeScript source.

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

Prior versions (e.g., 2026.5.16) processed messages normally without bootstrap context crashes.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: toLowerCase crash on every message in 2026.5.20! bootstrap file name undefined