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

推荐订阅源

Recent Announcements
Recent Announcements
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 聂微东
爱范儿
爱范儿
Jina AI
Jina AI
博客园 - Franky
IT之家
IT之家
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tailwind CSS Blog
博客园 - 三生石上(FineUI控件)
The Cloudflare Blog
M
MIT News - Artificial intelligence
aimingoo的专栏
aimingoo的专栏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
J
Java Code Geeks
人人都是产品经理
人人都是产品经理
腾讯CDC
博客园_首页
月光博客
月光博客
有赞技术团队
有赞技术团队
C
Check Point Blog
Microsoft Security Blog
Microsoft Security Blog
MyScale Blog
MyScale 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(imessage): WARN-log when private API bridge is unavai...
omarshahine · 2026-05-10 · via Recent Commits to openclaw:main

@@ -3,6 +3,7 @@ import { beforeEach, describe, expect, it, vi } from "vitest";

3344

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

55

getCachedIMessagePrivateApiStatus: vi.fn(),

6+

probeIMessagePrivateApi: vi.fn(),

67

}));

7889

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

@@ -13,8 +14,28 @@ const runtimeMock = vi.hoisted(() => ({

1314

sendAttachment: vi.fn(),

1415

}));

151617+

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

18+

warn: vi.fn(),

19+

info: vi.fn(),

20+

error: vi.fn(),

21+

debug: vi.fn(),

22+

trace: vi.fn(),

23+

fatal: vi.fn(),

24+

}));

25+26+

vi.mock("openclaw/plugin-sdk/runtime-env", async () => {

27+

const actual = await vi.importActual<typeof import("openclaw/plugin-sdk/runtime-env")>(

28+

"openclaw/plugin-sdk/runtime-env",

29+

);

30+

return {

31+

...actual,

32+

createSubsystemLogger: () => loggerMock,

33+

};

34+

});

35+1636

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

1737

getCachedIMessagePrivateApiStatus: probeMock.getCachedIMessagePrivateApiStatus,

38+

probeIMessagePrivateApi: probeMock.probeIMessagePrivateApi,

1839

}));

19402041

vi.mock("./private-api-status.js", () => ({

@@ -48,6 +69,8 @@ describe("imessage message actions", () => {

4869

runtimeMock.sendRichMessage.mockReset();

4970

runtimeMock.sendAttachment.mockReset();

5071

probeMock.getCachedIMessagePrivateApiStatus.mockReset();

72+

probeMock.probeIMessagePrivateApi.mockReset();

73+

loggerMock.warn.mockReset();

5174

});

52755376

it("does not advertise private API actions when the bridge is known unavailable", () => {

@@ -130,6 +153,33 @@ describe("imessage message actions", () => {

130153

expect(described?.actions).toContain("edit");

131154

});

132155156+

it("emits a channels/imessage WARN when the private API bridge is unavailable", async () => {

157+

probeMock.getCachedIMessagePrivateApiStatus.mockReturnValue(undefined);

158+

probeMock.probeIMessagePrivateApi.mockResolvedValue({

159+

available: false,

160+

v2Ready: false,

161+

selectors: {},

162+

});

163+164+

await expect(

165+

imessageMessageActions.handleAction?.({

166+

action: "react",

167+

cfg: cfg(),

168+

params: {

169+

chatGuid: "iMessage;+;chat0000",

170+

messageId: "message-guid",

171+

emoji: "👍",

172+

},

173+

} as never),

174+

).rejects.toThrow(/imsg private API bridge/);

175+176+

expect(loggerMock.warn).toHaveBeenCalledTimes(1);

177+

const warnArg = String(loggerMock.warn.mock.calls[0][0]);

178+

expect(warnArg).toMatch(/iMessage react blocked: private API bridge unavailable/);

179+

expect(warnArg).toMatch(/imsg launch/);

180+

expect(runtimeMock.sendReaction).not.toHaveBeenCalled();

181+

});

182+133183

it("rejects configured-off actions at execution time", async () => {

134184

probeMock.getCachedIMessagePrivateApiStatus.mockReturnValue({

135185

available: true,