openclaw - ✅(Solved) Fix Slack extension contract-api.js regression causes TypeError on config load (v2026.4.8) [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

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#63239Fetched 2026-04-09 07:56:28
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
closed ×1commented ×1cross-referenced ×1mentioned ×1

Error Message

Failed to read config at /home/clawdbot/.openclaw/openclaw.json TypeError: Cannot read properties of undefined (reading 't') at Object.get [as legacyConfigRules] (/home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/extensions/slack/contract-api.js:1:647) at resolvePluginDoctorContracts (file:///home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:220:52) at listPluginDoctorLegacyConfigRules (file:///home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:233:9) at resolveLegacyConfigForRead (file:///home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:19138:82) at Object.loadConfig (file:///home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:19203:29) at file:///home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:19669:56 at loadPinnedRuntimeConfig (/home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/runtime-snapshot-BVfF9E0s.js:42:17) at loadConfig (file:///home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:19669:9) at primeConfiguredContextWindows (/home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/context-CIaFOK75.js:119:39) at ensureContextWindowCacheLoaded (/home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/context-CIaFOK75.js:137:15)

Fix Action

Fix / Workaround

Workaround Attempted

  • Adding "allow": true results in schema validation error: channels.slack: invalid config: must NOT have additional properties

PR fix notes

PR #63311: fix(plugins): keep test helpers out of contract barrels

Description (problem / solution / changelog)

Summary

  • keep bundled plugin contract barrels runtime-only so test helpers do not leak into production surfaces
  • move Slack and iMessage test-only helpers onto test-api and route shared channel helpers through bundled plugin public/test surface loaders
  • keep the plugin guardrail lightweight while still covering Slack-style harness leaks, make the test-only filenames more explicit, and validate bundled artifact paths stay plugin-local

Changes

  • remove test-helper exports from extensions/slack/contract-api.ts and extensions/imessage/contract-api.ts
  • add/keep test-only exports on extensions/slack/test-api.ts and extensions/imessage/test-api.ts
  • add plugin-level contract barrel guardrails in src/plugins/contracts/plugin-entry-guardrails.test.ts
  • simplify the contract-barrel source scan to TypeScript source extensions actually used by bundled plugin contract barrels
  • remove the redundant Slack-specific channel guard now that the plugin-level guard covers that leak shape
  • update shared channel helpers to use loadBundledPluginTestApiSync(...) / loadBundledPluginPublicSurfaceSync(...) instead of repo-relative extensions/** imports
  • reject bundled plugin artifact paths that are empty, absolute, or traverse outside the plugin root while still allowing valid nested plugin-local paths like src/...
  • rename obvious test-only implementation files to clearer names like outbound-payload.test-harness.ts and imessage.test-plugin.ts

Validation

  • node scripts/run-vitest.mjs run src/plugins/public-surface-runtime.test.ts src/plugins/contracts/plugin-entry-guardrails.test.ts src/channels/plugins/contracts/channel-import-guardrails.test.ts extensions/slack/src/outbound-payload.test.ts extensions/imessage/src/test-plugin.test.ts src/plugin-sdk/facade-loader.test.ts src/plugin-sdk/facade-runtime.test.ts
  • pnpm build:strict-smoke
  • independent verify passes over general, tests, and silent-failure lanes during iteration

Linked Issues

  • Refs #62949
  • Refs #63239

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • extensions/imessage/contract-api.ts (modified, +0/-1)
  • extensions/imessage/src/imessage.test-plugin.ts (renamed, +21/-9)
  • extensions/imessage/src/test-plugin.test.ts (modified, +8/-1)
  • extensions/imessage/test-api.ts (added, +1/-0)
  • extensions/slack/contract-api.ts (modified, +0/-1)
  • extensions/slack/src/outbound-payload.test-harness.ts (renamed, +0/-0)
  • extensions/slack/src/outbound-payload.test.ts (modified, +1/-1)
  • extensions/slack/test-api.ts (modified, +1/-0)
  • extensions/whatsapp/contract-api.ts (modified, +0/-6)
  • extensions/whatsapp/src/outbound-base.test.ts (modified, +1/-1)
  • extensions/whatsapp/test-api.ts (modified, +1/-0)
  • src/plugin-sdk/facade-activation-check.runtime.ts (modified, +2/-1)
  • src/plugin-sdk/facade-loader.ts (modified, +6/-2)
  • src/plugin-sdk/facade-runtime.ts (modified, +7/-3)
  • src/plugins/contracts/plugin-entry-guardrails.test.ts (modified, +266/-6)
  • src/plugins/public-surface-runtime.test.ts (added, +32/-0)
  • src/plugins/public-surface-runtime.ts (modified, +28/-4)
  • src/test-utils/bundled-plugin-public-surface.ts (modified, +4/-2)
  • test/helpers/channels/imessage-test-plugin.ts (modified, +19/-1)
  • test/helpers/channels/outbound-payload-contract.ts (modified, +130/-23)

Code Example

Failed to read config at /home/clawdbot/.openclaw/openclaw.json TypeError: Cannot read properties of undefined (reading 't')
    at Object.get [as legacyConfigRules] (/home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/extensions/slack/contract-api.js:1:647)
    at resolvePluginDoctorContracts (file:///home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:220:52)
    at listPluginDoctorLegacyConfigRules (file:///home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:233:9)
    at resolveLegacyConfigForRead (file:///home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:19138:82)
    at Object.loadConfig (file:///home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:19203:29)
    at file:///home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:19669:56
    at loadPinnedRuntimeConfig (/home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/runtime-snapshot-BVfF9E0s.js:42:17)
    at loadConfig (file:///home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:19669:9)
    at primeConfiguredContextWindows (/home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/context-CIaFOK75.js:119:39)
    at ensureContextWindowCacheLoaded (/home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/context-CIaFOK75.js:137:15)

---

"slack": {
  "mode": "socket",
  "signingSecret": "${SLACK_SIGNING_SECRET}",
  "webhookPath": "/slack/events",
  "enabled": true,
  "botToken": "${SLACK_BOT_TOKEN}",
  "appToken": "${SLACK_APP_TOKEN}",
  "userTokenReadOnly": true,
  "groupPolicy": "allowlist",
  "streaming": {
    "mode": "partial",
    "block": { "enabled": false },
    "nativeTransport": true
  },
  "dmPolicy": "pairing",
  "allowFrom": ["U0AFE0K3X0B"]
}
RAW_BUFFERClick to expand / collapse

Bug: Slack Extension contract-api.js Regression Causes Config Load Failure

Steps to Reproduce

  1. Install OpenClaw .4.8
  2. Configure Slack channel in openclaw.json with standard socket mode config
  3. Run any CLI command that loads config (e.g., openclaw wiki init)
  4. Observe crash with TypeError

Error Stack Trace

Failed to read config at /home/clawdbot/.openclaw/openclaw.json TypeError: Cannot read properties of undefined (reading 't')
    at Object.get [as legacyConfigRules] (/home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/extensions/slack/contract-api.js:1:647)
    at resolvePluginDoctorContracts (file:///home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:220:52)
    at listPluginDoctorLegacyConfigRules (file:///home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:233:9)
    at resolveLegacyConfigForRead (file:///home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:19138:82)
    at Object.loadConfig (file:///home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:19203:29)
    at file:///home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:19669:56
    at loadPinnedRuntimeConfig (/home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/runtime-snapshot-BVfF9E0s.js:42:17)
    at loadConfig (file:///home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/config-DMMR1XE_.js:19669:9)
    at primeConfiguredContextWindows (/home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/context-CIaFOK75.js:119:39)
    at ensureContextWindowCacheLoaded (/home/clawdbot/.npm-global/lib/node_modules/openclaw/dist/context-CIaFOK75.js:137:15)

Environment

  • OpenClaw version: 2026.4.8
  • Node: v25.9.0
  • OS: Linux 6.17.0-20-generic (x64)

Slack Config (openclaw.json)

"slack": {
  "mode": "socket",
  "signingSecret": "${SLACK_SIGNING_SECRET}",
  "webhookPath": "/slack/events",
  "enabled": true,
  "botToken": "${SLACK_BOT_TOKEN}",
  "appToken": "${SLACK_APP_TOKEN}",
  "userTokenReadOnly": true,
  "groupPolicy": "allowlist",
  "streaming": {
    "mode": "partial",
    "block": { "enabled": false },
    "nativeTransport": true
  },
  "dmPolicy": "pairing",
  "allowFrom": ["U0AFE0K3X0B"]
}

Workaround Attempted

  • Adding "allow": true results in schema validation error: channels.slack: invalid config: must NOT have additional properties

Impact

  • CLI commands that load config crash before executing
  • Gateway runs fine (loaded config before this regression)
  • Blocking use of new features like openclaw wiki init

Expected Behavior

  • Config should load without TypeError
  • Slack extension should handle legacy config rules gracefully

extent analysis

TL;DR

The most likely fix is to update the contract-api.js file in the Slack extension to handle legacy config rules correctly or apply a workaround to the openclaw.json configuration.

Guidance

  • The error stack trace suggests a regression in the contract-api.js file, which is causing a TypeError when loading the config.
  • The openclaw.json configuration seems to be valid, but the addition of "allow": true results in a schema validation error, indicating that the configuration schema may need to be updated.
  • To mitigate the issue, try removing or commenting out the legacyConfigRules property in the contract-api.js file, if possible, to see if it resolves the TypeError.
  • Verify that the config loads correctly by running a CLI command that loads the config, such as openclaw wiki init, after applying any changes.

Example

No code snippet is provided as the issue is related to a specific file (contract-api.js) and its internal implementation.

Notes

The provided information suggests a regression in the contract-api.js file, but without access to the file's code or the ability to modify it, applying a workaround to the openclaw.json configuration may be the only viable option.

Recommendation

Apply a workaround to the openclaw.json configuration, as updating the contract-api.js file may not be feasible. The reason is that the error stack trace points to a specific issue in the contract-api.js file, and modifying the configuration may provide a temporary solution until the underlying issue is resolved.

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