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

推荐订阅源

F
Fortinet All Blogs
爱范儿
爱范儿
P
Proofpoint News Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tailwind CSS Blog
J
Java Code Geeks
宝玉的分享
宝玉的分享
Jina AI
Jina AI
B
Blog
N
Netflix TechBlog - Medium
Recent Announcements
Recent Announcements
aimingoo的专栏
aimingoo的专栏
腾讯CDC
C
Check Point Blog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
博客园 - Franky
罗磊的独立博客
B
Blog RSS Feed
WordPress大学
WordPress大学
小众软件
小众软件
博客园 - 叶小钗
M
MIT News - Artificial intelligence
GbyAI
GbyAI

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(channels): preserve Telegram ordering without blockin...
vincentkoc · 2026-05-14 · via Recent Commits to openclaw:main

@@ -9,6 +9,22 @@ function createHarness(config: Record<string, unknown>) {

99

config: {

1010

current: vi.fn(() => config),

1111

loadConfig: vi.fn(() => config),

12+

mutateConfigFile: vi.fn(

13+

async ({ mutate }: { mutate: (draft: Record<string, unknown>) => void }) => {

14+

const draft = structuredClone(config);

15+

mutate(draft);

16+

config = draft;

17+

return {

18+

path: "/tmp/openclaw.json",

19+

previousHash: null,

20+

snapshot: {},

21+

nextConfig: config,

22+

afterWrite: { mode: "auto" },

23+

followUp: { mode: "auto", requiresRestart: false },

24+

result: undefined,

25+

};

26+

},

27+

),

1228

replaceConfigFile: vi.fn(async ({ nextConfig }: { nextConfig: Record<string, unknown> }) => {

1329

config = nextConfig;

1430

}),

@@ -187,19 +203,20 @@ describe("talk-voice plugin", () => {

187203

createCommandContext("set Claudia", "webchat", ["operator.admin"]),

188204

);

189205190-

expect(runtime.config.replaceConfigFile).toHaveBeenCalledWith({

206+

expect(runtime.config.mutateConfigFile).toHaveBeenCalledWith({

191207

afterWrite: { mode: "auto" },

192-

nextConfig: {

193-

talk: {

194-

provider: "elevenlabs",

195-

providers: {

196-

elevenlabs: {

197-

apiKey: "sk-eleven",

198-

voiceId: "voice-a",

199-

},

208+

mutate: expect.any(Function),

209+

});

210+

expect(runtime.config.current()).toEqual({

211+

talk: {

212+

provider: "elevenlabs",

213+

providers: {

214+

elevenlabs: {

215+

apiKey: "sk-eleven",

216+

voiceId: "voice-a",

200217

},

201-

voiceId: "voice-a",

202218

},

219+

voiceId: "voice-a",

203220

},

204221

});

205222

expect(result).toEqual({

@@ -220,15 +237,16 @@ describe("talk-voice plugin", () => {

220237221238

await command.handler(createCommandContext("set Ava", "webchat", ["operator.admin"]));

222239223-

expect(runtime.config.replaceConfigFile).toHaveBeenCalledWith({

240+

expect(runtime.config.mutateConfigFile).toHaveBeenCalledWith({

224241

afterWrite: { mode: "auto" },

225-

nextConfig: {

226-

talk: {

227-

provider: "microsoft",

228-

providers: {

229-

microsoft: {

230-

voiceId: "en-US-AvaNeural",

231-

},

242+

mutate: expect.any(Function),

243+

});

244+

expect(runtime.config.current()).toEqual({

245+

talk: {

246+

provider: "microsoft",

247+

providers: {

248+

microsoft: {

249+

voiceId: "en-US-AvaNeural",

232250

},

233251

},

234252

},

@@ -240,22 +258,22 @@ describe("talk-voice plugin", () => {

240258

const result = await run();

241259242260

expect(result.text).toContain("requires operator.admin");

243-

expect(runtime.config.replaceConfigFile).not.toHaveBeenCalled();

261+

expect(runtime.config.mutateConfigFile).not.toHaveBeenCalled();

244262

});

245263246264

it("rejects /voice set from non-webchat gateway callers missing operator.admin", async () => {

247265

const { runtime, run } = createElevenlabsVoiceSetHarness("telegram", ["operator.write"]);

248266

const result = await run();

249267250268

expect(result.text).toContain("requires operator.admin");

251-

expect(runtime.config.replaceConfigFile).not.toHaveBeenCalled();

269+

expect(runtime.config.mutateConfigFile).not.toHaveBeenCalled();

252270

});

253271254272

it("allows /voice set from gateway client with operator.admin scope", async () => {

255273

const { runtime, run } = createElevenlabsVoiceSetHarness("webchat", ["operator.admin"]);

256274

const result = await run();

257275258-

expect(runtime.config.replaceConfigFile).toHaveBeenCalled();

276+

expect(runtime.config.mutateConfigFile).toHaveBeenCalled();

259277

expect(result.text).toContain("voice-a");

260278

});

261279

@@ -264,22 +282,22 @@ describe("talk-voice plugin", () => {

264282

const result = await run();

265283266284

expect(result.text).toContain("requires operator.admin");

267-

expect(runtime.config.replaceConfigFile).not.toHaveBeenCalled();

285+

expect(runtime.config.mutateConfigFile).not.toHaveBeenCalled();

268286

});

269287270288

it("allows /voice set from non-gateway channels without operator.admin", async () => {

271289

const { runtime, run } = createElevenlabsVoiceSetHarness("telegram");

272290

const result = await run();

273291274-

expect(runtime.config.replaceConfigFile).toHaveBeenCalled();

292+

expect(runtime.config.mutateConfigFile).toHaveBeenCalled();

275293

expect(result.text).toContain("voice-a");

276294

});

277295278296

it("allows /voice set when operator.admin is present on a non-webchat channel", async () => {

279297

const { runtime, run } = createElevenlabsVoiceSetHarness("telegram", ["operator.admin"]);

280298

const result = await run();

281299282-

expect(runtime.config.replaceConfigFile).toHaveBeenCalled();

300+

expect(runtime.config.mutateConfigFile).toHaveBeenCalled();

283301

expect(result.text).toContain("voice-a");

284302

});

285303