@@ -1665,29 +1665,30 @@ export async function sanitizeOpenClawConfig(): Promise<void> {
16651665 }
16661666
16671667
1668- // ── Remove bare 'feishu' when canonical feishu plugin is present ──
1669- // The Gateway binary automatically adds bare 'feishu' to plugins.allow
1670- // because the official plugin registers the 'feishu' channel.
1671- // However, there's no plugin with id='feishu', so Gateway validation
1672- // fails with "plugin not found: feishu". Remove it from allow[] and
1673- // disable the entries.feishu entry to prevent Gateway from re-adding it.
1668+ // ── Disable built-in 'feishu' when official openclaw-lark plugin is active ──
1669+ // OpenClaw ships a built-in 'feishu' extension in dist/extensions/feishu/
1670+ // that conflicts with the official @larksuite /openclaw-lark plugin
1671+ // (id: 'openclaw-lark'). When the canonical feishu plugin is NOT the
1672+ // built-in 'feishu' itself, we must:
1673+ // 1. Remove bare 'feishu' from plugins.allow
1674+ // 2. Always set plugins.entries.feishu = { enabled: false } to explicitly
1675+ // disable the built-in — it loads automatically unless disabled.
16741676 const allowArr2 = Array . isArray ( pluginsObj . allow ) ? pluginsObj . allow as string [ ] : [ ] ;
16751677 const hasCanonicalFeishu = allowArr2 . includes ( canonicalFeishuId ) || ! ! pEntries [ canonicalFeishuId ] ;
1676- if ( hasCanonicalFeishu ) {
1678+ if ( hasCanonicalFeishu && canonicalFeishuId !== 'feishu' ) {
16771679 // Remove bare 'feishu' from plugins.allow
16781680 const bareFeishuIdx = allowArr2 . indexOf ( 'feishu' ) ;
16791681 if ( bareFeishuIdx !== - 1 ) {
16801682 allowArr2 . splice ( bareFeishuIdx , 1 ) ;
1681- console . log ( '[sanitize] Removed bare "feishu" from plugins.allow (feishu plugin is configured)' ) ;
1683+ console . log ( '[sanitize] Removed bare "feishu" from plugins.allow (openclaw-lark plugin is configured)' ) ;
16821684 modified = true ;
16831685 }
1684- // Disable bare 'feishu' in plugins.entries so Gateway won't re-add it
1685- if ( pEntries . feishu ) {
1686- if ( pEntries . feishu . enabled !== false ) {
1687- pEntries . feishu . enabled = false ;
1688- console . log ( '[sanitize] Disabled bare plugins.entries.feishu (feishu plugin is configured)' ) ;
1689- modified = true ;
1690- }
1686+ // Always ensure the built-in feishu plugin is explicitly disabled.
1687+ // Built-in extensions load automatically unless plugins.entries.<id>.enabled = false.
1688+ if ( ! pEntries . feishu || pEntries . feishu . enabled !== false ) {
1689+ pEntries . feishu = { ...( pEntries . feishu || { } ) , enabled : false } ;
1690+ console . log ( '[sanitize] Disabled built-in feishu plugin (openclaw-lark plugin is configured)' ) ;
1691+ modified = true ;
16911692 }
16921693 }
16931694
0 commit comments