fix(update): allow plugin convergence after package doctor repairs · openclaw/openclaw@81d1424
vincentkoc
·
2026-05-16
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1053,6 +1053,11 @@ describe("update-cli", () => {
|
1053 | 1053 | vi.mocked(runCommandWithTimeout).mock.calls as unknown as Array<[string[], unknown]> |
1054 | 1054 | ).find(([argv]) => argv[0] === "npm" && argv[1] === "i" && argv[2] === "-g"); |
1055 | 1055 | expect(installCall).toBeUndefined(); |
| 1056 | +expect( |
| 1057 | +vi |
| 1058 | +.mocked(readConfigFileSnapshot) |
| 1059 | +.mock.calls.some(([options]) => options?.skipPluginValidation === true), |
| 1060 | +).toBe(true); |
1056 | 1061 | expect(defaultRuntime.exit).toHaveBeenCalledWith(0); |
1057 | 1062 | expect(syncPluginsForUpdateChannel).toHaveBeenCalledTimes(1); |
1058 | 1063 | expect(updateNpmInstalledPlugins).toHaveBeenCalledTimes(1); |
@@ -3829,6 +3834,11 @@ describe("update-cli", () => {
|
3829 | 3834 | }); |
3830 | 3835 | expect(syncPluginCall()?.channel).toBe("stable"); |
3831 | 3836 | expect(lastNpmPluginUpdateCall()?.timeoutMs).toBe(9_000); |
| 3837 | +expect( |
| 3838 | +vi |
| 3839 | +.mocked(readConfigFileSnapshot) |
| 3840 | +.mock.calls.some(([options]) => options?.skipPluginValidation === true), |
| 3841 | +).toBe(true); |
3832 | 3842 | const output = lastWriteJsonCall() as |
3833 | 3843 | | { |
3834 | 3844 | status?: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1850,7 +1850,7 @@ export async function updateFinalizeCommand(opts: UpdateFinalizeOptions): Promis
|
1850 | 1850 | repair: true, |
1851 | 1851 | yes: opts.yes === true, |
1852 | 1852 | }); |
1853 | | -configSnapshot = await readConfigFileSnapshot(); |
| 1853 | +configSnapshot = await readConfigFileSnapshot({ skipPluginValidation: true }); |
1854 | 1854 | if (requestedChannel) { |
1855 | 1855 | configSnapshot = await persistRequestedUpdateChannel({ |
1856 | 1856 | configSnapshot, |
@@ -2287,7 +2287,7 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
|
2287 | 2287 | } |
2288 | 2288 | |
2289 | 2289 | const postCoreConfigSnapshot = await persistRequestedUpdateChannel({ |
2290 | | -configSnapshot: await readConfigFileSnapshot(), |
| 2290 | +configSnapshot: await readConfigFileSnapshot({ skipPluginValidation: true }), |
2291 | 2291 | requestedChannel: postCoreRequestedChannel, |
2292 | 2292 | }); |
2293 | 2293 | |
@@ -2670,7 +2670,9 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
|
2670 | 2670 | }); |
2671 | 2671 | |
2672 | 2672 | let postUpdateConfigSnapshot = |
2673 | | -result.status === "ok" && !opts.dryRun ? await readConfigFileSnapshot() : configSnapshot; |
| 2673 | +result.status === "ok" && !opts.dryRun |
| 2674 | + ? await readConfigFileSnapshot({ skipPluginValidation: true }) |
| 2675 | + : configSnapshot; |
2674 | 2676 | if (!shouldResumePostCoreInFreshProcess) { |
2675 | 2677 | postUpdateConfigSnapshot = await persistRequestedUpdateChannel({ |
2676 | 2678 | configSnapshot: postUpdateConfigSnapshot, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2368,10 +2368,12 @@ export async function readSourceConfigBestEffort(): Promise<OpenClawConfig> {
|
2368 | 2368 | |
2369 | 2369 | export async function readConfigFileSnapshot(options?: { |
2370 | 2370 | measure?: ConfigSnapshotReadMeasure; |
| 2371 | +skipPluginValidation?: boolean; |
2371 | 2372 | }): Promise<ConfigFileSnapshot> { |
2372 | | -return await createConfigIO( |
2373 | | -options?.measure ? { measure: options.measure } : {}, |
2374 | | -).readConfigFileSnapshot(); |
| 2373 | +return await createConfigIO({ |
| 2374 | + ...(options?.measure ? { measure: options.measure } : {}), |
| 2375 | + ...(options?.skipPluginValidation ? { pluginValidation: "skip" } : {}), |
| 2376 | +}).readConfigFileSnapshot(); |
2375 | 2377 | } |
2376 | 2378 | |
2377 | 2379 | export async function readConfigFileSnapshotWithPluginMetadata(options?: { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。