openclaw - ✅(Solved) Fix Slack extension contract API crashes on config load even when plugin disabled [1 pull requests, 2 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#63358Fetched 2026-04-09 07:54:50
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
commented ×2closed ×1cross-referenced ×1mentioned ×1

Error Message

Failed to read config at /home/clawmander/.openclaw/openclaw.json TypeError: Cannot read properties of undefined (reading 't')
 at Object.get [as legacyConfigRules] (/home/clawmander/.npm-global/lib/node_modules/openclaw/dist/extensions/slack/contract-api.js:1:647)
 at resolvePluginDoctorContracts (file:///home/clawmander/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:220:52)
 at listPluginDoctorLegacyConfigRules (file:///home/clawmander/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:233:9)
 at resolveLegacyConfigForRead (file:///home/clawmander/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:19138:82)
 at Object.loadConfig (file:///home/clawmander/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:19203:29)

Root Cause

The error occurs in contract-api.js line 647 in the legacyConfigRules getter. The contract API is being invoked during config validation even though the plugin is disabled. The code attempts to read a property (appears to be .t or similar) from an undefined object.

Looking at the Slack extension's doctor-contract.ts, the legacyConfigRules array contains config validation rules that check for legacy streaming aliases. These rules are being evaluated even when the plugin is disabled.

Fix Action

Fix / Workaround

Workaround Attempts

PR fix notes

PR #63362: Fix: Stub legacyConfigRules in Slack contract API to prevent crash

Description (problem / solution / changelog)

Problem

When the Slack plugin is disabled but present in config, OpenClaw crashes with:

TypeError: Cannot read properties of undefined (reading 't')
 at Object.get [as legacyConfigRules] (dist/extensions/slack/contract-api.js:1:647)

This occurs because legacyConfigRules is re-exported from a nested ESM file (doctor-contract-Byp5_Sbd.js) that fails to load via jiti, leaving the import undefined.

Solution

Stub legacyConfigRules as an empty array in contract-api.js when the plugin is disabled. Since the plugin is disabled, the contract rules won't be evaluated anyway.

Changes

  • dist/extensions/slack/contract-api.js: Replace broken import with stub export

Testing

  • Verified fix resolves crash on OpenClaw 2026.4.8
  • Slack disabled: no impact (empty array never used)
  • Slack enabled: would need additional testing (not applicable for this patch)

Notes

This is a defensive fix for disabled plugins. The proper long-term fix would be to ensure nested ESM imports resolve correctly via jiti, but this stub prevents crashes for users with disabled Slack plugins.

Closes #63358

Changed files

  • extensions/slack/contract-api.ts (modified, +8/-1)

Code Example

Failed to read config at /home/clawmander/.openclaw/openclaw.json TypeError: Cannot read properties of undefined (reading 't')
 at Object.get [as legacyConfigRules] (/home/clawmander/.npm-global/lib/node_modules/openclaw/dist/extensions/slack/contract-api.js:1:647)
 at resolvePluginDoctorContracts (file:///home/clawmander/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:220:52)
 at listPluginDoctorLegacyConfigRules (file:///home/clawmander/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:233:9)
 at resolveLegacyConfigForRead (file:///home/clawmander/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:19138:82)
 at Object.loadConfig (file:///home/clawmander/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:19203:29)
RAW_BUFFERClick to expand / collapse

Bug Description

OpenClaw 2026.4.8 crashes on startup with a TypeError when the Slack plugin is disabled but still present in the config. The error occurs in the Slack extension's contract API when trying to read a config property.

Error Message

Failed to read config at /home/clawmander/.openclaw/openclaw.json TypeError: Cannot read properties of undefined (reading 't')
 at Object.get [as legacyConfigRules] (/home/clawmander/.npm-global/lib/node_modules/openclaw/dist/extensions/slack/contract-api.js:1:647)
 at resolvePluginDoctorContracts (file:///home/clawmander/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:220:52)
 at listPluginDoctorLegacyConfigRules (file:///home/clawmander/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:233:9)
 at resolveLegacyConfigForRead (file:///home/clawmander/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:19138:82)
 at Object.loadConfig (file:///home/clawmander/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:19203:29)

Environment

  • OpenClaw: 2026.4.8 (9ece252)
  • OS: Linux (Ubuntu)
  • Node: v25.6.1
  • Slack plugin: disabled (plugins.entries.slack.enabled: false)
  • Slack in plugins.allow: yes

Steps to Reproduce

  1. Have Slack in plugins.allow array
  2. Set plugins.entries.slack.enabled: false
  3. Have a minimal channels.slack section in config (or remove it entirely)
  4. Run openclaw tui or openclaw gateway restart
  5. Error occurs during config validation

Expected Behavior

When Slack plugin is disabled, the config loader should skip Slack-specific contract validation or handle missing config gracefully.

Actual Behavior

The Slack extension's contract API (legacyConfigRules) is loaded even when the plugin is disabled, and it tries to access a config property that doesn't exist, causing a TypeError.

Root Cause Analysis

The error occurs in contract-api.js line 647 in the legacyConfigRules getter. The contract API is being invoked during config validation even though the plugin is disabled. The code attempts to read a property (appears to be .t or similar) from an undefined object.

Looking at the Slack extension's doctor-contract.ts, the legacyConfigRules array contains config validation rules that check for legacy streaming aliases. These rules are being evaluated even when the plugin is disabled.

Workaround Attempts

  1. ✅ Removed channels.slack section entirely - error persists
  2. ✅ Added slack to plugins.allow - error persists
  3. ✅ Added minimal channels.slack section with enabled: false - error persists

Impact

Prevents OpenClaw from starting when Slack plugin is disabled but was previously configured. Users cannot use OpenClaw TUI or gateway commands.

Related Issues

  • #23824 - Slack plugin crash loop
  • #10951 - Slack TypeError in agent responses
  • #59654 - agents add TypeError
  • #60414 - TypeError on every user message

Suggested Fix

  1. Guard the Slack contract API validation to only run when plugin is enabled
  2. Add null checks in legacyConfigRules getter
  3. Skip plugin doctor contracts for disabled plugins

Please investigate and fix this config validation bug.

extent analysis

TL;DR

The most likely fix is to guard the Slack contract API validation to only run when the plugin is enabled, adding null checks in the legacyConfigRules getter to prevent the TypeError.

Guidance

  • Review the contract-api.js file, specifically the legacyConfigRules getter, to ensure it handles cases where the plugin is disabled.
  • Add a conditional check to skip the Slack contract API validation when the Slack plugin is disabled (plugins.entries.slack.enabled: false).
  • Consider implementing null checks for the config property being accessed (appears to be .t or similar) to prevent similar TypeErrors in the future.
  • Verify the fix by setting plugins.entries.slack.enabled: false and running openclaw tui or openclaw gateway restart to ensure OpenClaw starts without errors.

Example

// Example of guarding the Slack contract API validation
if (plugins.entries.slack.enabled) {
  // Existing validation code here
} else {
  // Skip validation or handle disabled plugin case
}

Notes

The provided workaround attempts suggest that simply removing or modifying the channels.slack section does not resolve the issue, indicating the problem lies in how the Slack plugin's contract API is handled when disabled.

Recommendation

Apply a workaround by guarding the Slack contract API validation to only run when the plugin is enabled, as this directly addresses the root cause of the TypeError.

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