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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
U
Unit 42
GbyAI
GbyAI
M
MIT News - Artificial intelligence
美团技术团队
罗磊的独立博客
雷峰网
雷峰网
量子位
博客园 - 【当耐特】
Last Week in AI
Last Week in AI
D
Docker
小众软件
小众软件
S
SegmentFault 最新的问题
Blog — PlanetScale
Blog — PlanetScale
阮一峰的网络日志
阮一峰的网络日志
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
WordPress大学
WordPress大学
V
V2EX
博客园_首页
腾讯CDC
The Cloudflare Blog
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

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
test: stabilize tts fast-lane guard · openclaw/openclaw@5...
steipete · 2026-04-28 · via Recent Commits to openclaw:main

@@ -1,53 +1,21 @@

1-

import { beforeEach, describe, expect, it, vi } from "vitest";

1+

import { readFileSync } from "node:fs";

2+

import { describe, expect, it } from "vitest";

233-

const loadBundledPluginPublicSurfaceModuleSync = vi.hoisted(() => vi.fn());

4-

const loadActivatedBundledPluginPublicSurfaceModuleSync = vi.hoisted(() => vi.fn());

5-

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

6-

return <T extends object>(load: () => T): T =>

7-

new Proxy(

8-

{},

9-

{

10-

get(_target, property, receiver) {

11-

return Reflect.get(load(), property, receiver);

12-

},

13-

},

14-

) as T;

15-

});

16-

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

17-

return <T extends object, K extends keyof T>(load: () => T, key: K): T[K] =>

18-

((...args: unknown[]) => {

19-

const value = load()[key];

20-

if (typeof value !== "function") {

21-

return value;

22-

}

23-

return (value as (...innerArgs: unknown[]) => unknown)(...args);

24-

}) as T[K];

25-

});

26-27-

vi.mock("../plugin-sdk/facade-runtime.js", () => ({

28-

createLazyFacadeObjectValue,

29-

createLazyFacadeValue,

30-

loadActivatedBundledPluginPublicSurfaceModuleSync,

31-

loadBundledPluginPublicSurfaceModuleSync,

32-

}));

33-34-

const tts = await import("./tts.js");

4+

function readSource(relativePath: string): string {

5+

return readFileSync(new URL(relativePath, import.meta.url), "utf8");

6+

}

357368

describe("tts runtime facade", () => {

37-

beforeEach(() => {

38-

loadActivatedBundledPluginPublicSurfaceModuleSync.mockReset();

39-

loadBundledPluginPublicSurfaceModuleSync.mockReset();

40-

});

41-42-

it("loads speech-core lazily after module import", () => {

43-

const buildTtsSystemPromptHint = vi.fn().mockReturnValue("hint");

44-

loadActivatedBundledPluginPublicSurfaceModuleSync.mockReturnValue({

45-

buildTtsSystemPromptHint,

46-

});

9+

it("keeps speech-core behind the lazy runtime facade", () => {

10+

const publicFacadeSource = readSource("./tts.ts");

11+

const runtimeFacadeSource = readSource("../plugin-sdk/tts-runtime.ts");

471248-

expect(loadActivatedBundledPluginPublicSurfaceModuleSync).not.toHaveBeenCalled();

49-

expect(tts.buildTtsSystemPromptHint({} as never)).toBe("hint");

50-

expect(loadActivatedBundledPluginPublicSurfaceModuleSync).toHaveBeenCalledTimes(1);

51-

expect(buildTtsSystemPromptHint).toHaveBeenCalledTimes(1);

13+

expect(publicFacadeSource).toContain('} from "../plugin-sdk/tts-runtime.js";');

14+

expect(publicFacadeSource).not.toContain("speech-core");

15+

expect(runtimeFacadeSource).toContain("function loadFacadeModule()");

16+

expect(runtimeFacadeSource).toContain('dirName: "speech-core"');

17+

expect(runtimeFacadeSource).toContain(

18+

'createLazyFacadeRuntimeValue(loadFacadeModule, "buildTtsSystemPromptHint")',

19+

);

5220

});

5321

});