diff --git a/CHANGELOG.md b/CHANGELOG.md index a34e5ff14bf..1cd6f3189ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,7 @@ Docs: https://docs.openclaw.ai - Providers/Z.AI: map OpenClaw thinking controls to Z.AI's `thinking` payload and add opt-in preserved thinking replay via `params.preserveThinking`, so GLM 5.x can keep prior `reasoning_content` when requested. Fixes #58680. Thanks @xuanmingguo. - Channels/status: keep read-only channel lists on manifest and package metadata by default, loading setup runtime only for explicit fallback callers. Thanks @shakkernerd. +- Plugins/onboarding: defer onboarding install-record index writes until the guarded config commit so setup failures cannot leave the plugin index ahead of `openclaw.json`. Thanks @shakkernerd. - Plugins/registry: resolve web provider ownership from the installed plugin index instead of broad manifest scans on secret, tool, and pricing paths. Thanks @shakkernerd. - TTS: strip model-emitted TTS directives from streamed block text before channel delivery, including directives split across adjacent blocks, while preserving diff --git a/src/commands/channel-setup/plugin-install.ts b/src/commands/channel-setup/plugin-install.ts index ed78318b5be..293441a4fee 100644 --- a/src/commands/channel-setup/plugin-install.ts +++ b/src/commands/channel-setup/plugin-install.ts @@ -46,7 +46,6 @@ export async function ensureChannelSetupPluginInstalled(params: { cfg: params.cfg, entry: toOnboardingPluginInstallEntry(params.entry), prompter: params.prompter, - refreshRegistry: false, runtime: params.runtime, workspaceDir: params.workspaceDir, }); diff --git a/src/commands/onboarding-plugin-install.test.ts b/src/commands/onboarding-plugin-install.test.ts index 4105c870e0c..8df2d4a2a28 100644 --- a/src/commands/onboarding-plugin-install.test.ts +++ b/src/commands/onboarding-plugin-install.test.ts @@ -147,12 +147,7 @@ describe("ensureOnboardingPluginInstalled", () => { spec: "@wecom/wecom-openclaw-plugin@1.2.3", }), }); - expect(refreshPluginRegistryAfterConfigMutation).toHaveBeenCalledWith( - expect.objectContaining({ - config: result.cfg, - reason: "source-changed", - }), - ); + expect(refreshPluginRegistryAfterConfigMutation).not.toHaveBeenCalled(); }); it("returns a timed out status and notes the retry path when npm install hangs", async () => { diff --git a/src/commands/onboarding-plugin-install.ts b/src/commands/onboarding-plugin-install.ts index 82f90bbd967..d273fef3cf1 100644 --- a/src/commands/onboarding-plugin-install.ts +++ b/src/commands/onboarding-plugin-install.ts @@ -1,7 +1,6 @@ import fs from "node:fs"; import path from "node:path"; import { resolveBundledInstallPlanForCatalogEntry } from "../cli/plugin-install-plan.js"; -import { refreshPluginRegistryAfterConfigMutation } from "../cli/plugins-registry-refresh.js"; import type { OpenClawConfig } from "../config/types.openclaw.js"; import { parseRegistryNpmSpec } from "../infra/npm-registry-spec.js"; import { @@ -136,23 +135,6 @@ function formatPortableLocalPath(localPath: string, workspaceDir?: string): stri return undefined; } -async function refreshRegistryAfterOnboardingPluginInstall(params: { - cfg: OpenClawConfig; - refreshRegistry?: boolean; - runtime: RuntimeEnv; - workspaceDir?: string; -}) { - if (params.refreshRegistry === false) { - return; - } - await refreshPluginRegistryAfterConfigMutation({ - config: params.cfg, - reason: "source-changed", - ...(params.workspaceDir ? { workspaceDir: params.workspaceDir } : {}), - logger: { warn: (message) => params.runtime.log(message) }, - }); -} - async function recordLocalPluginInstall(params: { cfg: OpenClawConfig; entry: OnboardingPluginInstallEntry; @@ -438,7 +420,6 @@ export async function ensureOnboardingPluginInstalled(params: { cfg: OpenClawConfig; entry: OnboardingPluginInstallEntry; prompter: WizardPrompter; - refreshRegistry?: boolean; runtime: RuntimeEnv; workspaceDir?: string; }): Promise { @@ -495,12 +476,6 @@ export async function ensureOnboardingPluginInstalled(params: { } next = addPluginLoadPath(enableResult.config, localPath); next = await recordLocalPluginInstall({ cfg: next, entry, localPath, npmSpec, workspaceDir }); - await refreshRegistryAfterOnboardingPluginInstall({ - cfg: next, - refreshRegistry: params.refreshRegistry, - runtime, - workspaceDir, - }); return { cfg: next, installed: true, @@ -579,12 +554,6 @@ export async function ensureOnboardingPluginInstalled(params: { ...buildNpmResolutionInstallFields(result.npmResolution), } as const; next = recordPluginInstall(next, install); - await refreshRegistryAfterOnboardingPluginInstall({ - cfg: next, - refreshRegistry: params.refreshRegistry, - runtime, - workspaceDir, - }); return { cfg: next, installed: true, @@ -624,12 +593,6 @@ export async function ensureOnboardingPluginInstalled(params: { } next = addPluginLoadPath(enableResult.config, localPath); next = await recordLocalPluginInstall({ cfg: next, entry, localPath, npmSpec, workspaceDir }); - await refreshRegistryAfterOnboardingPluginInstall({ - cfg: next, - refreshRegistry: params.refreshRegistry, - runtime, - workspaceDir, - }); return { cfg: next, installed: true,