Skip to content

test(feishu): cover legacy dual-plugin migration#990

Merged
ashione merged 4 commits intomainfrom
codex/issue-971-feishu-regression
May 7, 2026
Merged

test(feishu): cover legacy dual-plugin migration#990
ashione merged 4 commits intomainfrom
codex/issue-971-feishu-regression

Conversation

@ashione
Copy link
Copy Markdown
Contributor

@ashione ashione commented May 7, 2026

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 main already normalizes the legacy conflicting state correctly:

  • sanitizeOpenClawConfig() collapses legacy feishu + openclaw-lark registrations into a single external Feishu plugin and explicitly disables the built-in feishu plugin.
  • sanitizeOpenClawConfig() removes residual Feishu plugin registrations when the Feishu channel is no longer configured.
  • saveChannelConfig('feishu', ...) rewrites stale plugin registration state to openclaw-lark and disables the built-in feishu plugin on save.

It also adds first-stage plugin lifecycle spec support so future bundled/external plugin changes have reusable guardrails:

  • plugin-lifecycle-management scenario spec
  • capability-owner-resolution rule spec
  • active-config-guards rule spec
  • guard-plugin-resolution task spec
  • plugin-validation task spec
  • plugin-recovery-and-rollback task spec

Review 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-management tasks 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-lark plugin and the bundled built-in feishu plugin active at the same time.

The current codebase appears to already contain the intended fix logic in:

  • electron/utils/openclaw-auth.ts
  • electron/utils/channel-config.ts
  • electron/gateway/config-sync.ts

What 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.ts
  • pnpm exec vitest run tests/unit/harness-specs.test.ts
  • pnpm exec vitest run tests/unit/openclaw-auth.test.ts tests/unit/channel-config.test.ts tests/unit/harness-specs.test.ts
  • pnpm run ext:bridge && pnpm run typecheck
  • pnpm run typecheck
  • pnpm harness validate --spec harness/specs/tasks/guard-feishu-dual-plugin-migration.md
  • pnpm harness validate --spec harness/specs/tasks/guard-plugin-resolution.md
  • pnpm harness validate --spec harness/specs/tasks/plugin-validation.md
  • pnpm harness validate --spec harness/specs/tasks/plugin-recovery-and-rollback.md
  • pnpm harness list
  • pnpm run harness:ci

Related

@ashione ashione merged commit c6adf36 into main May 7, 2026
6 checks passed
@ashione ashione deleted the codex/issue-971-feishu-regression branch May 7, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant