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

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
G
Google Developers Blog
博客园 - 司徒正美
J
Java Code Geeks
aimingoo的专栏
aimingoo的专栏
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
T
The Blog of Author Tim Ferriss
D
Docker
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
腾讯CDC
V
Visual Studio Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Check Point Blog
M
MIT News - Artificial intelligence
Jina AI
Jina AI
I
InfoQ
雷峰网
雷峰网
The Cloudflare Blog
美团技术团队
Engineering at Meta
Engineering at Meta

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): preserve requested speech fallback · opencl...
vincentkoc · 2026-05-01 · via Recent Commits to openclaw:main

@@ -12,13 +12,26 @@ function createEmptyMockManifestRegistry(): MockManifestRegistry {

1212

}

13131414

const mocks = vi.hoisted(() => ({

15+

createMockRegistry: () => ({

16+

plugins: [],

17+

diagnostics: [],

18+

memoryEmbeddingProviders: [],

19+

speechProviders: [],

20+

realtimeTranscriptionProviders: [],

21+

realtimeVoiceProviders: [],

22+

mediaUnderstandingProviders: [],

23+

imageGenerationProviders: [],

24+

videoGenerationProviders: [],

25+

musicGenerationProviders: [],

26+

}),

1527

resolveRuntimePluginRegistry: vi.fn<

1628

(params?: unknown) => ReturnType<typeof createEmptyPluginRegistry> | undefined

1729

>(() => undefined),

1830

resolvePluginRegistryLoadCacheKey: vi.fn((options: unknown) => JSON.stringify(options)),

1931

loadPluginManifestRegistry: vi.fn<(params?: Record<string, unknown>) => MockManifestRegistry>(

2032

() => createEmptyMockManifestRegistry(),

2133

),

34+

loadBundledCapabilityRuntimeRegistry: vi.fn(),

2235

loadPluginRegistrySnapshot: vi.fn(() => ({ plugins: [] })),

2336

withBundledPluginAllowlistCompat: vi.fn(

2437

({ config, pluginIds }: { config?: OpenClawConfig; pluginIds: string[] }) =>

@@ -39,6 +52,10 @@ vi.mock("./loader.js", () => ({

3952

resolvePluginRegistryLoadCacheKey: mocks.resolvePluginRegistryLoadCacheKey,

4053

}));

415455+

vi.mock("./bundled-capability-runtime.js", () => ({

56+

loadBundledCapabilityRuntimeRegistry: mocks.loadBundledCapabilityRuntimeRegistry,

57+

}));

58+4259

vi.mock("./manifest-registry-installed.js", () => ({

4360

loadPluginManifestRegistryForInstalledIndex: mocks.loadPluginManifestRegistry,

4461

}));

@@ -191,6 +208,8 @@ describe("resolvePluginCapabilityProviders", () => {

191208

mocks.loadPluginRegistrySnapshot.mockReturnValue({ plugins: [] });

192209

mocks.loadPluginManifestRegistry.mockReset();

193210

mocks.loadPluginManifestRegistry.mockReturnValue(createEmptyMockManifestRegistry());

211+

mocks.loadBundledCapabilityRuntimeRegistry.mockReset();

212+

mocks.loadBundledCapabilityRuntimeRegistry.mockImplementation(() => mocks.createMockRegistry());

194213

mocks.withBundledPluginAllowlistCompat.mockClear();

195214

mocks.withBundledPluginAllowlistCompat.mockImplementation(

196215

({ config, pluginIds }: { config?: OpenClawConfig; pluginIds: string[] }) =>

@@ -490,6 +509,169 @@ describe("resolvePluginCapabilityProviders", () => {

490509

});

491510

});

492511512+

it("uses bundled capability capture when runtime snapshot is empty for a requested speech provider", () => {

513+

const active = createEmptyPluginRegistry();

514+

active.speechProviders.push({

515+

pluginId: "openai",

516+

pluginName: "openai",

517+

source: "test",

518+

provider: {

519+

id: "openai",

520+

label: "openai",

521+

isConfigured: () => true,

522+

synthesize: async () => ({

523+

audioBuffer: Buffer.from("x"),

524+

outputFormat: "mp3",

525+

voiceCompatible: false,

526+

fileExtension: ".mp3",

527+

}),

528+

},

529+

} as never);

530+

const captured = createEmptyPluginRegistry();

531+

captured.speechProviders.push({

532+

pluginId: "google",

533+

pluginName: "google",

534+

source: "test",

535+

provider: {

536+

id: "google",

537+

label: "google",

538+

isConfigured: () => true,

539+

synthesize: async () => ({

540+

audioBuffer: Buffer.from("x"),

541+

outputFormat: "mp3",

542+

voiceCompatible: false,

543+

fileExtension: ".mp3",

544+

}),

545+

},

546+

} as never);

547+

mocks.loadPluginManifestRegistry.mockReturnValue({

548+

plugins: [

549+

{

550+

id: "google",

551+

origin: "bundled",

552+

contracts: { speechProviders: ["google"] },

553+

},

554+

{

555+

id: "microsoft",

556+

origin: "bundled",

557+

contracts: { speechProviders: ["microsoft"] },

558+

},

559+

] as never,

560+

diagnostics: [],

561+

});

562+

mocks.resolveRuntimePluginRegistry.mockImplementation((params?: unknown) =>

563+

params === undefined ? active : createEmptyPluginRegistry(),

564+

);

565+

mocks.loadBundledCapabilityRuntimeRegistry.mockReturnValue(captured);

566+567+

const providers = resolvePluginCapabilityProviders({

568+

key: "speechProviders",

569+

cfg: {

570+

messages: { tts: { provider: "google" } },

571+

} as OpenClawConfig,

572+

});

573+574+

expectResolvedCapabilityProviderIds(providers, ["openai", "google"]);

575+

expect(mocks.resolveRuntimePluginRegistry).toHaveBeenCalledWith({

576+

config: expect.anything(),

577+

onlyPluginIds: ["google"],

578+

activate: false,

579+

installBundledRuntimeDeps: false,

580+

});

581+

expect(mocks.loadBundledCapabilityRuntimeRegistry).toHaveBeenCalledWith({

582+

pluginIds: ["google"],

583+

env: process.env,

584+

pluginSdkResolution: undefined,

585+

});

586+

});

587+588+

it("uses bundled capability capture when runtime snapshot misses a requested speech provider", () => {

589+

const active = createEmptyPluginRegistry();

590+

active.speechProviders.push({

591+

pluginId: "openai",

592+

pluginName: "openai",

593+

source: "test",

594+

provider: {

595+

id: "openai",

596+

label: "openai",

597+

isConfigured: () => true,

598+

synthesize: async () => ({

599+

audioBuffer: Buffer.from("x"),

600+

outputFormat: "mp3",

601+

voiceCompatible: false,

602+

fileExtension: ".mp3",

603+

}),

604+

},

605+

} as never);

606+

const loaded = createEmptyPluginRegistry();

607+

loaded.speechProviders.push({

608+

pluginId: "azure-speech",

609+

pluginName: "azure-speech",

610+

source: "test",

611+

provider: {

612+

id: "azure-speech",

613+

label: "Azure Speech",

614+

isConfigured: () => true,

615+

synthesize: async () => ({

616+

audioBuffer: Buffer.from("x"),

617+

outputFormat: "mp3",

618+

voiceCompatible: false,

619+

fileExtension: ".mp3",

620+

}),

621+

},

622+

} as never);

623+

const captured = createEmptyPluginRegistry();

624+

captured.speechProviders.push({

625+

pluginId: "google",

626+

pluginName: "google",

627+

source: "test",

628+

provider: {

629+

id: "google",

630+

label: "google",

631+

isConfigured: () => true,

632+

synthesize: async () => ({

633+

audioBuffer: Buffer.from("x"),

634+

outputFormat: "mp3",

635+

voiceCompatible: false,

636+

fileExtension: ".mp3",

637+

}),

638+

},

639+

} as never);

640+

mocks.loadPluginManifestRegistry.mockReturnValue({

641+

plugins: [

642+

{

643+

id: "azure-speech",

644+

origin: "bundled",

645+

contracts: { speechProviders: ["azure-speech"] },

646+

},

647+

{

648+

id: "google",

649+

origin: "bundled",

650+

contracts: { speechProviders: ["google"] },

651+

},

652+

] as never,

653+

diagnostics: [],

654+

});

655+

mocks.resolveRuntimePluginRegistry.mockImplementation((params?: unknown) =>

656+

params === undefined ? active : loaded,

657+

);

658+

mocks.loadBundledCapabilityRuntimeRegistry.mockReturnValue(captured);

659+660+

const providers = resolvePluginCapabilityProviders({

661+

key: "speechProviders",

662+

cfg: {

663+

messages: { tts: { provider: "google" } },

664+

} as OpenClawConfig,

665+

});

666+667+

expectResolvedCapabilityProviderIds(providers, ["openai", "google"]);

668+

expect(mocks.loadBundledCapabilityRuntimeRegistry).toHaveBeenCalledWith({

669+

pluginIds: ["google"],

670+

env: process.env,

671+

pluginSdkResolution: undefined,

672+

});

673+

});

674+493675

it("does not merge unrelated bundled capability providers when cfg requests one provider", () => {

494676

const active = createEmptyPluginRegistry();

495677

active.speechProviders.push({