openclaw - ✅(Solved) Fix [Bug]: hooks.mappings[].channel rejects valid runtime channel plugins like feishu [3 pull requests, 1 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#56226Fetched 2026-04-08 01:43:20
View on GitHub
Comments
1
Participants
2
Timeline
22
Reactions
0
Author
Participants
Timeline (top)
referenced ×11cross-referenced ×4labeled ×2closed ×1

hooks.mappings[].channel rejects valid channel values such as "feishu" during config parsing even when the channel plugin is configured.

Error Message

Startup fails with config validation error:

Root Cause

hooks.mappings[].channel rejects valid channel values such as "feishu" during config parsing even when the channel plugin is configured.

Fix Action

Fixed

PR fix notes

PR #56247: fix(config): allow any channel plugin id in hooks.mappings[].channel (#56226)

Description (problem / solution / changelog)

Fixes #56226

Problem

hooks.mappings[].channel rejects valid channel plugin values such as "feishu" during config parsing, even when the channel plugin is configured and available at runtime.

Error message:

hooks.mappings.0.channel: Invalid input (allowed: "last", "whatsapp", "telegram", "discord", "irc", "slack", "signal", "imessage", "msteams")

Root Cause

The Zod schema uses a static enum of channel IDs, which doesn't include dynamically registered channel plugins like feishu, matrix, etc.

Solution

Change the schema from a static enum to dynamic string validation:

  • Allow "last" (special case)
  • Allow any non-empty string for channel plugin IDs
  • Runtime validation still enforced via isDeliverableMessageChannel() in delivery code paths

Changes

  • src/config/zod-schema.hooks.ts: Changed channel field from static union to dynamic string validation
  • Added comment explaining runtime validation

Testing

  • Type check: ✅ Passed
  • Lint: ✅ Passed
  • Config validation now accepts any channel plugin id

Branch Info

  • Created from: upstream/main (2026-03-28)
  • Files changed: 1 (src/config/zod-schema.hooks.ts)
  • Lines: +3, -8

Changed files

  • src/cli/skills-cli.test.ts (modified, +40/-1)
  • src/config/zod-schema.hooks.ts (modified, +4/-8)

PR #56251: fix: add feishu to hooks.mappings[].channel allowed values

Description (problem / solution / changelog)

Problem

hooks.mappings[].channel rejects valid runtime channel plugins like feishu during config parsing (#56226). Even when the feishu channel plugin is properly configured under channels, adding "channel": "feishu" to a hook mapping causes a config validation error.

Root Cause

The channel field in HookMappingSchema (src/config/zod-schema.hooks.ts) uses a zod union of string literals to define valid channels. The list includes whatsapp, telegram, discord, irc, slack, signal, imessage, msteams, but omits feishu (and likely other newer channel plugins like googlechat, matrix, etc.).

Fix

Added z.literal("feishu") to the channel union in HookMappingSchema. Regenerated schema.base.generated.ts via the project's schema generator script.

Changes: 2 files, 12 lines added.

Testing

  • Config with "hooks.mappings[].channel": "feishu" no longer triggers validation error
  • Other channel values continue to work as before

Fixes #56226

Changed files

  • src/config/schema.base.generated.ts (modified, +11/-0)
  • src/config/zod-schema.hooks.ts (modified, +1/-0)

PR #56281: fix: accept plugin channel ids in hook mappings

Description (problem / solution / changelog)

Summary

  • allow non-empty string channel ids in hook mapping schema so plugin-owned channels can parse
  • validate hook mapping channels against bundled and runtime-discovered plugin channels
  • add regression coverage for feishu and unknown channel ids

Fixes #56226

Changed files

  • src/config/config.hook-mapping-channels.test.ts (added, +52/-0)
  • src/config/validation.ts (modified, +35/-0)
  • src/config/zod-schema.hooks.ts (modified, +1/-13)
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

hooks.mappings[].channel rejects valid channel values such as "feishu" during config parsing even when the channel plugin is configured.

Steps to reproduce

  1. Configure a channel plugin in ~/.openclaw/openclaw.json:

{ "channels": { "feishu": { "enabled": true, "appId": "...", "appSecret": "..." } } }

  1. Add a hooks mapping:

{ "hooks": { "mappings": [ { "deliver": true, "channel": "feishu", "to": "test" } ] } }

  1. Start OpenClaw.

Expected behavior

Configuration should be accepted when the channel plugin is defined under channels and available at runtime.

Actual behavior

Startup fails with config validation error:

hooks.mappings.0.channel: Invalid input (allowed: "last", "whatsapp", "telegram", "discord", "irc", "slack", "signal", "imessage", "msteams")

OpenClaw version

2026.3.24

Operating system

Docker container

Install method

docker

Model

NOT_RELEVANT

Provider / routing chain

NOT_RELEVANT

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

There appears to be an inconsistency between config validation and runtime behavior.

Runtime channel resolution supports dynamically registered plugins, but config parsing enforces a static enum for hooks.mappings[].channel.

This prevents valid plugins such as "feishu" from being used in hooks mappings.

extent analysis

Fix Plan

To fix the issue, we need to update the config validation to support dynamically registered plugins. Here are the steps:

  • Update the hooks.mappings[].channel validation to use a dynamic list of available channels instead of a static enum.
  • Use the channels configuration to validate the hooks.mappings[].channel field.

Example code:

# Get the list of available channels from the channels configuration
available_channels = list(config['channels'].keys())

# Update the validation for hooks.mappings[].channel
validation_rules = {
    'hooks': {
        'mappings': {
            'channel': {'type': 'string', 'allowed': available_channels}
        }
    }
}
  • Update the config parsing code to use the new validation rules.

Verification

To verify that the fix worked, follow these steps:

  • Configure a channel plugin in ~/.openclaw/openclaw.json with a valid channel value such as "feishu".
  • Add a hooks mapping with the same channel value.
  • Start OpenClaw and check that the configuration is accepted without any validation errors.

Extra Tips

  • Make sure to update the documentation to reflect the changes in the config validation.
  • Consider adding a test case to ensure that the config validation works correctly with dynamically registered plugins.

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

Configuration should be accepted when the channel plugin is defined under channels and available at runtime.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING