惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
MongoDB | Blog
MongoDB | Blog
GbyAI
GbyAI
L
LangChain Blog
B
Blog
博客园 - 三生石上(FineUI控件)
Martin Fowler
Martin Fowler
博客园 - 【当耐特】
Recent Announcements
Recent Announcements
P
Proofpoint News Feed
U
Unit 42
Last Week in AI
Last Week in AI
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
雷峰网
雷峰网
Microsoft Security Blog
Microsoft Security Blog
T
The Blog of Author Tim Ferriss
爱范儿
爱范儿
小众软件
小众软件
I
InfoQ
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
人人都是产品经理
人人都是产品经理
C
Check Point Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(plugins): avoid source rebuilds for policy toggles · ...
vincentkoc · 2026-05-02 · via Recent Commits to openclaw:main

@@ -32,9 +32,10 @@ vi.mock("../plugins/install.js", () => ({

3232

}));

33333434

const enablePluginInConfig = vi.hoisted(() =>

35-

vi.fn<(cfg: OpenClawConfig, pluginId: string) => PluginEnableResult>((cfg) => ({

35+

vi.fn<(cfg: OpenClawConfig, pluginId: string) => PluginEnableResult>((cfg, pluginId) => ({

3636

config: cfg,

3737

enabled: true,

38+

pluginId,

3839

})),

3940

);

4041

vi.mock("../plugins/enable.js", () => ({

@@ -342,6 +343,7 @@ describe("ensureOnboardingPluginInstalled", () => {

342343

enablePluginInConfig.mockReturnValueOnce({

343344

config: {},

344345

enabled: false,

346+

pluginId: "demo",

345347

reason: "blocked by allowlist",

346348

});

347349

const note = vi.fn(async () => {});

@@ -484,65 +486,62 @@ describe("ensureOnboardingPluginInstalled", () => {

484486

});

485487486488

it("hides the npm download option for bundled plugins so the menu matches non-npm channels", async () => {

487-

await withTempDir(

488-

{ prefix: "openclaw-onboarding-install-bundled-prompt-" },

489-

async (temp) => {

490-

const bundledDir = path.join(temp, "dist", "extensions", "tlon");

491-

await fs.mkdir(bundledDir, { recursive: true });

492-

const realBundledDir = await fs.realpath(bundledDir);

493-

// Both code paths that surface a bundled plugin to the install

494-

// pipeline must agree on the local path: the catalog-driven

495-

// resolver (used when an npm spec is present) and the pluginId

496-

// fallback. We stub both so the prompt sees a stable bundled path.

497-

resolveBundledInstallPlanForCatalogEntry.mockReturnValue({

498-

bundledSource: { localPath: realBundledDir },

499-

});

500-

findBundledPluginSourceInMap.mockReturnValue({ localPath: realBundledDir });

489+

await withTempDir({ prefix: "openclaw-onboarding-install-bundled-prompt-" }, async (temp) => {

490+

const bundledDir = path.join(temp, "dist", "extensions", "tlon");

491+

await fs.mkdir(bundledDir, { recursive: true });

492+

const realBundledDir = await fs.realpath(bundledDir);

493+

// Both code paths that surface a bundled plugin to the install

494+

// pipeline must agree on the local path: the catalog-driven

495+

// resolver (used when an npm spec is present) and the pluginId

496+

// fallback. We stub both so the prompt sees a stable bundled path.

497+

resolveBundledInstallPlanForCatalogEntry.mockReturnValue({

498+

bundledSource: { localPath: realBundledDir },

499+

});

500+

findBundledPluginSourceInMap.mockReturnValue({ localPath: realBundledDir });

501501502-

let captured:

503-

| {

504-

message: string;

505-

options: Array<{ value: "npm" | "local" | "skip"; label: string; hint?: string }>;

506-

initialValue: "npm" | "local" | "skip";

507-

}

508-

| undefined;

502+

let captured:

503+

| {

504+

message: string;

505+

options: Array<{ value: "npm" | "local" | "skip"; label: string; hint?: string }>;

506+

initialValue: "npm" | "local" | "skip";

507+

}

508+

| undefined;

509509510-

await ensureOnboardingPluginInstalled({

511-

cfg: {},

512-

entry: {

513-

pluginId: "tlon",

514-

label: "Tlon",

515-

install: {

516-

npmSpec: "@openclaw/tlon",

517-

defaultChoice: "npm",

518-

},

510+

await ensureOnboardingPluginInstalled({

511+

cfg: {},

512+

entry: {

513+

pluginId: "tlon",

514+

label: "Tlon",

515+

install: {

516+

npmSpec: "@openclaw/tlon",

517+

defaultChoice: "npm",

519518

},

520-

prompter: {

521-

select: vi.fn(async (input) => {

522-

captured = input;

523-

return "skip";

524-

}),

525-

} as never,

526-

runtime: {} as never,

527-

});

519+

},

520+

prompter: {

521+

select: vi.fn(async (input) => {

522+

captured = input;

523+

return "skip";

524+

}),

525+

} as never,

526+

runtime: {} as never,

527+

});

528528529-

expect(captured).toBeDefined();

530-

// "Download from npm (@openclaw/tlon)" must NOT appear: the bundled

531-

// copy is what gets enabled, so the npm hint would only confuse

532-

// users into thinking the plugin is missing.

533-

expect(captured?.options).toEqual([

534-

{

535-

value: "local",

536-

label: "Use local plugin path",

537-

hint: realBundledDir,

538-

},

539-

{ value: "skip", label: "Skip for now" },

540-

]);

541-

expect(captured?.initialValue).toBe("local");

542-

findBundledPluginSourceInMap.mockReset();

543-

resolveBundledInstallPlanForCatalogEntry.mockReset();

544-

},

545-

);

529+

expect(captured).toBeDefined();

530+

// "Download from npm (@openclaw/tlon)" must NOT appear: the bundled

531+

// copy is what gets enabled, so the npm hint would only confuse

532+

// users into thinking the plugin is missing.

533+

expect(captured?.options).toEqual([

534+

{

535+

value: "local",

536+

label: "Use local plugin path",

537+

hint: realBundledDir,

538+

},

539+

{ value: "skip", label: "Skip for now" },

540+

]);

541+

expect(captured?.initialValue).toBe("local");

542+

findBundledPluginSourceInMap.mockReset();

543+

resolveBundledInstallPlanForCatalogEntry.mockReset();

544+

});

546545

});

547546548547

it("enables bundled plugins without adding their bundled directory as a local install", async () => {

@@ -564,6 +563,7 @@ describe("ensureOnboardingPluginInstalled", () => {

564563

},

565564

},

566565

enabled: true,

566+

pluginId: "discord",

567567

});

568568569569

const result = await ensureOnboardingPluginInstalled({