test(feishu): cover legacy dual-plugin migration#990
Merged
Conversation
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
Adds direct regression coverage for the Feishu/Lark dual-plugin migration path behind issue #971 and expands the harness spec guardrails for plugin lifecycle work.
This PR does not change production behavior. It verifies that current
mainalready normalizes the legacy conflicting state correctly:sanitizeOpenClawConfig()collapses legacyfeishu+openclaw-larkregistrations into a single external Feishu plugin and explicitly disables the built-infeishuplugin.sanitizeOpenClawConfig()removes residual Feishu plugin registrations when the Feishu channel is no longer configured.saveChannelConfig('feishu', ...)rewrites stale plugin registration state toopenclaw-larkand disables the built-infeishuplugin on save.It also adds first-stage plugin lifecycle spec support so future bundled/external plugin changes have reusable guardrails:
plugin-lifecycle-managementscenario speccapability-owner-resolutionrule specactive-config-guardsrule specguard-plugin-resolutiontask specplugin-validationtask specplugin-recovery-and-rollbacktask specReview follow-up: plugin lifecycle task specs are now strictly validated by the harness instead of falling back to id/title-only validation. The CLI detects
plugin-lifecycle-managementtasks and enforces scenario, task type, profiles, touched areas, expected behavior, acceptance, docs metadata, and changed-file coverage.Why
Issue #971 reports duplicate Feishu message handling and stuck chats when a migrated config leaves both the legacy
openclaw-larkplugin and the bundled built-infeishuplugin active at the same time.The current codebase appears to already contain the intended fix logic in:
electron/utils/openclaw-auth.tselectron/utils/channel-config.tselectron/gateway/config-sync.tsWhat was missing was a direct regression harness for the exact migration shape described in the issue, plus broader spec guardrails so future plugin lifecycle changes do not reintroduce duplicate active capability owners.
Tests
pnpm exec vitest run tests/unit/openclaw-auth.test.ts tests/unit/channel-config.test.tspnpm exec vitest run tests/unit/harness-specs.test.tspnpm exec vitest run tests/unit/openclaw-auth.test.ts tests/unit/channel-config.test.ts tests/unit/harness-specs.test.tspnpm run ext:bridge && pnpm run typecheckpnpm run typecheckpnpm harness validate --spec harness/specs/tasks/guard-feishu-dual-plugin-migration.mdpnpm harness validate --spec harness/specs/tasks/guard-plugin-resolution.mdpnpm harness validate --spec harness/specs/tasks/plugin-validation.mdpnpm harness validate --spec harness/specs/tasks/plugin-recovery-and-rollback.mdpnpm harness listpnpm run harness:ciRelated