Bug Description
The WhatsApp channel plugin fails to load with the error Unsupported channel: whatsapp because the Zod validation schema rejects the enabled key that the gateway automatically injects into channel configs.
Steps to Reproduce
- Fresh install of OpenClaw (v2026.2.23, built from source)
- Enable WhatsApp channel:
openclaw channels enable whatsapp
- Restart the gateway
- Attempt to use WhatsApp channel → Dashboard shows "Config unavailable"
- Gateway logs show:
Config validation failed: channels.whatsapp: Unrecognized key: "enabled"
Root Cause
In src/config/zod-schema.providers-whatsapp.ts:
WhatsAppAccountSchema correctly includes enabled: z.boolean().optional()
WhatsAppConfigSchema does NOT include the enabled field
WhatsAppConfigSchema uses .strict() which rejects any unrecognized keys
When the gateway auto-enables a plugin, it writes "enabled": true at the top-level channel config object. Since WhatsAppConfigSchema doesn't declare enabled but uses .strict(), validation fails silently (logged as WARNING), and the plugin never registers — resulting in "Unsupported channel: whatsapp".
Fix
Add enabled: z.boolean().optional() to WhatsAppConfigSchema:
export const WhatsAppConfigSchema = WhatsAppSharedSchema.extend({
enabled: z.boolean().optional(), // ← Add this line
accounts: z.record(z.string(), WhatsAppAccountSchema.optional()).optional(),
mediaMaxMb: z.number().int().positive().optional().default(50),
// ... rest of schema
})
.strict()
.superRefine(/* ... */);
Impact
- Severity: High — WhatsApp channel is completely broken on fresh installs
- Affected versions: v2026.2.23 (likely earlier versions too)
- Workaround: Manually patch the source file and rebuild
Notes
- This bug may also affect other channel plugins that use
.strict() Zod schemas without declaring the enabled field
- The error appears as a WARNING in logs but has a cascading effect of preventing the entire plugin from loading
- The
WhatsAppAccountSchema already has enabled — this was just missed at the WhatsAppConfigSchema level
Bug Description
The WhatsApp channel plugin fails to load with the error
Unsupported channel: whatsappbecause the Zod validation schema rejects theenabledkey that the gateway automatically injects into channel configs.Steps to Reproduce
openclaw channels enable whatsappConfig validation failed: channels.whatsapp: Unrecognized key: "enabled"Root Cause
In
src/config/zod-schema.providers-whatsapp.ts:WhatsAppAccountSchemacorrectly includesenabled: z.boolean().optional()WhatsAppConfigSchemadoes NOT include theenabledfieldWhatsAppConfigSchemauses.strict()which rejects any unrecognized keysWhen the gateway auto-enables a plugin, it writes
"enabled": trueat the top-level channel config object. SinceWhatsAppConfigSchemadoesn't declareenabledbut uses.strict(), validation fails silently (logged as WARNING), and the plugin never registers — resulting in "Unsupported channel: whatsapp".Fix
Add
enabled: z.boolean().optional()toWhatsAppConfigSchema:Impact
Notes
.strict()Zod schemas without declaring theenabledfieldWhatsAppAccountSchemaalready hasenabled— this was just missed at theWhatsAppConfigSchemalevel