fix(doctor): drop stale bundled install records · openclaw/openclaw@6b7f9ea
vincentkoc
·
2026-05-04
·
via Recent Commits to openclaw:main
File tree
src/commands/doctor/shared
| Original file line number | Diff line number | Diff line change |
|---|
@@ -66,6 +66,7 @@ Docs: https://docs.openclaw.ai
|
66 | 66 | - fix: harden backend message action gateway routing [AI]. (#76374) Thanks @pgondhi987. |
67 | 67 | - Gate QQBot streaming command auth [AI]. (#76375) Thanks @pgondhi987. |
68 | 68 | - Plugins/release: make the published npm runtime verifier reject blank `openclaw.runtimeExtensions` entries instead of treating them as absent and passing via inferred outputs. Thanks @vincentkoc. |
| 69 | +- Doctor/plugins: remove stale managed install records for bundled plugins even when the bundled plugin is not explicitly configured, so doctor cleanup cannot leave orphaned install metadata behind. Thanks @vincentkoc. |
69 | 70 | - Web fetch: scope provider fallback cache entries by the selected fetch provider so config reloads cannot reuse another provider's cached fallback payload. Thanks @vincentkoc. |
70 | 71 | - Web search: honor late-bound `tools.web.search.enabled: false` during tool execution so config reloads cannot leave an already-created `web_search` tool runnable. Thanks @vincentkoc. |
71 | 72 | - Plugins/packages: reject inferred built runtime entries that exist but fail package-boundary checks instead of falling back to TypeScript source for installed packages. Thanks @vincentkoc. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -743,6 +743,52 @@ describe("repairMissingConfiguredPluginInstalls", () => {
|
743 | 743 | }); |
744 | 744 | }); |
745 | 745 | |
| 746 | +it("removes stale bundled install records even when the plugin is not configured", async () => { |
| 747 | +const records = { |
| 748 | +"google-meet": { |
| 749 | +source: "npm", |
| 750 | +spec: "@openclaw/google-meet", |
| 751 | +resolvedName: "@openclaw/google-meet", |
| 752 | +installPath: "/missing/google-meet", |
| 753 | +}, |
| 754 | +}; |
| 755 | +mocks.loadInstalledPluginIndexInstallRecords.mockResolvedValue(records); |
| 756 | +mocks.loadPluginMetadataSnapshot.mockReturnValue({ |
| 757 | +plugins: [], |
| 758 | +diagnostics: [], |
| 759 | +}); |
| 760 | +mocks.loadInstalledPluginIndex.mockReturnValue({ |
| 761 | +plugins: [ |
| 762 | +{ |
| 763 | +pluginId: "google-meet", |
| 764 | +origin: "bundled", |
| 765 | +packageName: "@openclaw/google-meet", |
| 766 | +}, |
| 767 | +], |
| 768 | +diagnostics: [], |
| 769 | +installRecords: {}, |
| 770 | +}); |
| 771 | + |
| 772 | +const { repairMissingConfiguredPluginInstalls } = |
| 773 | +await import("./missing-configured-plugin-install.js"); |
| 774 | +const result = await repairMissingConfiguredPluginInstalls({ |
| 775 | +cfg: {}, |
| 776 | +env: {}, |
| 777 | +}); |
| 778 | + |
| 779 | +expect(mocks.installPluginFromNpmSpec).not.toHaveBeenCalled(); |
| 780 | +expect(mocks.writePersistedInstalledPluginIndexInstallRecords).toHaveBeenCalledWith( |
| 781 | +{}, |
| 782 | +{ |
| 783 | +env: {}, |
| 784 | +}, |
| 785 | +); |
| 786 | +expect(result).toEqual({ |
| 787 | +changes: ['Removed stale managed install record for bundled plugin "google-meet".'], |
| 788 | +warnings: [], |
| 789 | +}); |
| 790 | +}); |
| 791 | + |
746 | 792 | it.each([ |
747 | 793 | [ |
748 | 794 | "npm", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -646,11 +646,7 @@ async function repairMissingPluginInstalls(params: {
|
646 | 646 | |
647 | 647 | for (const [pluginId, record] of Object.entries(records)) { |
648 | 648 | const bundled = bundledPluginsById.get(pluginId); |
649 | | -if ( |
650 | | -!bundled || |
651 | | -!params.pluginIds.has(pluginId) || |
652 | | -!recordMatchesBundledPackage(record, bundled) |
653 | | -) { |
| 649 | +if (!bundled || !recordMatchesBundledPackage(record, bundled)) { |
654 | 650 | continue; |
655 | 651 | } |
656 | 652 | if (nextRecords === records) { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。