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

推荐订阅源

GbyAI
GbyAI
Blog — PlanetScale
Blog — PlanetScale
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ
A
About on SuperTechFans
T
The Blog of Author Tim Ferriss
D
DataBreaches.Net
L
LangChain Blog
F
Fortinet All Blogs
C
Check Point Blog
Google DeepMind News
Google DeepMind News
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Help Net Security
J
Java Code Geeks
月光博客
月光博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
IT之家
IT之家
aimingoo的专栏
aimingoo的专栏
小众软件
小众软件
宝玉的分享
宝玉的分享
Jina AI
Jina AI

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: tighten zalouser outbound assertions · openclaw/ope...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -70,6 +70,19 @@ function requireZalouserMediaSender(

7070

return media;

7171

}

727273+

function requireRecord(value: unknown, label: string): Record<string, unknown> {

74+

if (value === null || typeof value !== "object" || Array.isArray(value)) {

75+

throw new Error(`expected ${label} to be a record`);

76+

}

77+

return value as Record<string, unknown>;

78+

}

79+80+

function requireSendOptions(

81+

mockedSend: ReturnType<typeof vi.mocked<(typeof import("./send.js"))["sendMessageZalouser"]>>,

82+

): Record<string, unknown> {

83+

return requireRecord(mockedSend.mock.calls[0]?.[2], "Zalouser send options");

84+

}

85+7386

describe("zalouserPlugin outbound sendPayload", () => {

7487

let mockedSend: ReturnType<typeof vi.mocked<(typeof import("./send.js"))["sendMessageZalouser"]>>;

7588

@@ -95,12 +108,14 @@ describe("zalouserPlugin outbound sendPayload", () => {

95108

to: "group:1471383327500481391",

96109

});

9711098-

expect(mockedSend).toHaveBeenCalledWith(

99-

"1471383327500481391",

100-

"hello group",

101-

expect.objectContaining({ isGroup: true, textMode: "markdown" }),

102-

);

103-

expect(result).toMatchObject({ channel: "zalouser", messageId: "zlu-g1" });

111+

expect(mockedSend).toHaveBeenCalledOnce();

112+

expect(mockedSend.mock.calls[0]?.[0]).toBe("1471383327500481391");

113+

expect(mockedSend.mock.calls[0]?.[1]).toBe("hello group");

114+

const options = requireSendOptions(mockedSend);

115+

expect(options.isGroup).toBe(true);

116+

expect(options.textMode).toBe("markdown");

117+

expect(result.channel).toBe("zalouser");

118+

expect(result.messageId).toBe("zlu-g1");

104119

});

105120106121

it("treats bare numeric targets as direct chats for backward compatibility", async () => {

@@ -112,12 +127,14 @@ describe("zalouserPlugin outbound sendPayload", () => {

112127

to: "987654321",

113128

});

114129115-

expect(mockedSend).toHaveBeenCalledWith(

116-

"987654321",

117-

"hello",

118-

expect.objectContaining({ isGroup: false, textMode: "markdown" }),

119-

);

120-

expect(result).toMatchObject({ channel: "zalouser", messageId: "zlu-d1" });

130+

expect(mockedSend).toHaveBeenCalledOnce();

131+

expect(mockedSend.mock.calls[0]?.[0]).toBe("987654321");

132+

expect(mockedSend.mock.calls[0]?.[1]).toBe("hello");

133+

const options = requireSendOptions(mockedSend);

134+

expect(options.isGroup).toBe(false);

135+

expect(options.textMode).toBe("markdown");

136+

expect(result.channel).toBe("zalouser");

137+

expect(result.messageId).toBe("zlu-d1");

121138

});

122139123140

it("preserves provider-native group ids when sending to raw g- targets", async () => {

@@ -129,12 +146,14 @@ describe("zalouserPlugin outbound sendPayload", () => {

129146

to: "g-1471383327500481391",

130147

});

131148132-

expect(mockedSend).toHaveBeenCalledWith(

133-

"g-1471383327500481391",

134-

"hello native group",

135-

expect.objectContaining({ isGroup: true, textMode: "markdown" }),

136-

);

137-

expect(result).toMatchObject({ channel: "zalouser", messageId: "zlu-g-native" });

149+

expect(mockedSend).toHaveBeenCalledOnce();

150+

expect(mockedSend.mock.calls[0]?.[0]).toBe("g-1471383327500481391");

151+

expect(mockedSend.mock.calls[0]?.[1]).toBe("hello native group");

152+

const options = requireSendOptions(mockedSend);

153+

expect(options.isGroup).toBe(true);

154+

expect(options.textMode).toBe("markdown");

155+

expect(result.channel).toBe("zalouser");

156+

expect(result.messageId).toBe("zlu-g-native");

138157

});

139158140159

it("passes long markdown through once so formatting happens before chunking", async () => {

@@ -148,17 +167,15 @@ describe("zalouserPlugin outbound sendPayload", () => {

148167

});

149168150169

expect(mockedSend).toHaveBeenCalledTimes(1);

151-

expect(mockedSend).toHaveBeenCalledWith(

152-

"987654321",

153-

text,

154-

expect.objectContaining({

155-

isGroup: false,

156-

textMode: "markdown",

157-

textChunkMode: "length",

158-

textChunkLimit: 1200,

159-

}),

160-

);

161-

expect(result).toMatchObject({ channel: "zalouser", messageId: "zlu-code" });

170+

expect(mockedSend.mock.calls[0]?.[0]).toBe("987654321");

171+

expect(mockedSend.mock.calls[0]?.[1]).toBe(text);

172+

const options = requireSendOptions(mockedSend);

173+

expect(options.isGroup).toBe(false);

174+

expect(options.textMode).toBe("markdown");

175+

expect(options.textChunkMode).toBe("length");

176+

expect(options.textChunkLimit).toBe(1200);

177+

expect(result.channel).toBe("zalouser");

178+

expect(result.messageId).toBe("zlu-code");

162179

});

163180164181

it("declares message adapter durable text and media with receipt proofs", async () => {

@@ -185,40 +202,38 @@ describe("zalouserPlugin outbound sendPayload", () => {

185202

const sendText = requireZalouserTextSender(adapter);

186203

const sendMedia = requireZalouserMediaSender(adapter);

187204188-

await expect(

189-

verifyChannelMessageAdapterCapabilityProofs({

190-

adapterName: "zalouser",

191-

adapter,

192-

proofs: {

193-

text: async () => {

194-

const result = await sendText({

195-

cfg: {},

196-

to: "user:987654321",

197-

text: "hello",

198-

});

199-

expect(result.receipt.platformMessageIds).toEqual(["zlu-text-1"]);

200-

},

201-

media: async () => {

202-

const result = await sendMedia({

203-

cfg: {},

204-

to: "user:987654321",

205-

text: "image",

206-

mediaUrl: "https://example.com/image.png",

207-

});

208-

expect(result.receipt.platformMessageIds).toEqual(["zlu-media-1"]);

209-

},

210-

messageSendingHooks: () => {

211-

expect(adapter.durableFinal?.capabilities?.messageSendingHooks).toBe(true);

212-

},

205+

const proofs = await verifyChannelMessageAdapterCapabilityProofs({

206+

adapterName: "zalouser",

207+

adapter,

208+

proofs: {

209+

text: async () => {

210+

const result = await sendText({

211+

cfg: {},

212+

to: "user:987654321",

213+

text: "hello",

214+

});

215+

expect(result.receipt.platformMessageIds).toEqual(["zlu-text-1"]);

213216

},

214-

}),

215-

).resolves.toEqual(

216-

expect.arrayContaining([

217-

{ capability: "text", status: "verified" },

218-

{ capability: "media", status: "verified" },

219-

{ capability: "messageSendingHooks", status: "verified" },

220-

]),

217+

media: async () => {

218+

const result = await sendMedia({

219+

cfg: {},

220+

to: "user:987654321",

221+

text: "image",

222+

mediaUrl: "https://example.com/image.png",

223+

});

224+

expect(result.receipt.platformMessageIds).toEqual(["zlu-media-1"]);

225+

},

226+

messageSendingHooks: () => {

227+

expect(adapter.durableFinal?.capabilities?.messageSendingHooks).toBe(true);

228+

},

229+

},

230+

});

231+

const proofStatusByCapability = new Map(

232+

proofs.map((proof) => [proof.capability, proof.status] as const),

221233

);

234+

expect(proofStatusByCapability.get("text")).toBe("verified");

235+

expect(proofStatusByCapability.get("media")).toBe("verified");

236+

expect(proofStatusByCapability.get("messageSendingHooks")).toBe("verified");

222237

});

223238

});

224239