fix(config): strip legacy installs/plugins from channel configs before validation#2189
Open
BingqingLyu wants to merge 1 commit into
Open
fix(config): strip legacy installs/plugins from channel configs before validation#2189BingqingLyu wants to merge 1 commit into
BingqingLyu wants to merge 1 commit into
Conversation
…e validation (openclaw#63101) After upgrading from v4.5 to v4.8, gateway restart fails with "channels.feishu: invalid config: must NOT have additional properties" when legacy `installs` and `plugins` fields are present under a channel config block. These fields were never valid channel-level properties but could appear in v4.5-era configs due to top-level key nesting. Add a legacy config migration that auto-strips `installs` and `plugins` from every `channels.*` entry (including nested `accounts.*`) before schema validation runs. The migration logs a clear change message so the operator knows the fields were removed. - Add migration `channels.*.stale-top-level-keys` with legacy rule for `channels.feishu` - Add 6 regression tests for the migration in legacy-migrate.test.ts - Add 3 schema-level rejection tests in config-schema.test.ts Closes openclaw#63101 Co-authored-by: Copilot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes openclaw#63101
After upgrading from v4.5 to v4.8,
openclaw gateway restartfails with:when legacy
installsandpluginsfields are present underchannels.feishu.Root Cause
The Feishu channel config schema (
FeishuConfigSchema) uses Zod.strict()mode, which rejects any properties not explicitly declared in the schema. Theinstallsandpluginsfields were never valid channel-level properties but could appear in v4.5-era configs due to top-level key nesting.Fix
Add a legacy config migration (
channels.*.stale-top-level-keys) that auto-stripsinstallsandpluginsfrom everychannels.*entry (including nestedaccounts.*) before schema validation runs. The migration:channels.feishuspecificallyTests
src/config/legacy-migrate.test.tsextensions/feishu/src/config-schema.test.tsAll 51 tests pass.