





















@@ -317,7 +317,7 @@ describe("ensureOnboardingPluginInstalled", () => {
317317expect(installPluginFromNpmSpec).not.toHaveBeenCalled();
318318});
319319320-it("offers ClawHub as the default remote source when package metadata provides it", async () => {
320+it("defaults dual-source remote installs to npm unless ClawHub is explicit", async () => {
321321let captured:
322322| {
323323options: Array<{
@@ -353,11 +353,41 @@ describe("ensureOnboardingPluginInstalled", () => {
353353{ value: "npm", label: "Download from npm (@openclaw/demo-plugin@2026.5.2)" },
354354{ value: "skip", label: "Skip for now" },
355355]);
356-expect(captured?.initialValue).toBe("clawhub");
356+expect(captured?.initialValue).toBe("npm");
357357expect(installPluginFromClawHub).not.toHaveBeenCalled();
358358expect(installPluginFromNpmSpec).not.toHaveBeenCalled();
359359});
360360361+it("honors explicit ClawHub defaults for dual-source remote installs", async () => {
362+let captured:
363+| {
364+initialValue: "clawhub" | "npm" | "local" | "skip";
365+}
366+| undefined;
367+368+await ensureOnboardingPluginInstalled({
369+cfg: { update: { channel: "stable" } },
370+entry: {
371+pluginId: "demo-plugin",
372+label: "Demo Plugin",
373+install: {
374+clawhubSpec: "clawhub:demo-plugin@2026.5.2",
375+npmSpec: "@openclaw/demo-plugin@2026.5.2",
376+defaultChoice: "clawhub",
377+},
378+},
379+prompter: {
380+select: vi.fn(async (input) => {
381+captured = input;
382+return "skip";
383+}),
384+} as never,
385+runtime: {} as never,
386+});
387+388+expect(captured?.initialValue).toBe("clawhub");
389+});
390+361391it("does not offer local installs when the workspace only has a spoofed .git marker", async () => {
362392await withTempDir({ prefix: "openclaw-onboarding-install-spoofed-git-" }, async (temp) => {
363393const workspaceDir = path.join(temp, "workspace");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。