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

推荐订阅源

Last Week in AI
Last Week in AI
阮一峰的网络日志
阮一峰的网络日志
P
Proofpoint News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
MongoDB | Blog
MongoDB | Blog
云风的 BLOG
云风的 BLOG
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
J
Java Code Geeks
WordPress大学
WordPress大学
T
The Blog of Author Tim Ferriss
V
Visual Studio Blog
小众软件
小众软件
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
IT之家
IT之家
Vercel News
Vercel News
C
Check Point Blog
Google DeepMind News
Google DeepMind News
月光博客
月光博客
D
DataBreaches.Net
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
Y
Y Combinator Blog
Hugging Face - Blog
Hugging Face - 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
test: require zalouser outbound fixtures · openclaw/openc...
steipete · 2026-05-09 · via Recent Commits to openclaw:main

@@ -29,6 +29,47 @@ function baseCtx(payload: ReplyPayload) {

2929

};

3030

}

313132+

type ZalouserOutbound = NonNullable<typeof zalouserPlugin.outbound>;

33+

type ZalouserSendPayload = NonNullable<ZalouserOutbound["sendPayload"]>;

34+

type ZalouserMessageAdapter = NonNullable<typeof zalouserPlugin.message>;

35+

type ZalouserMessageSender = NonNullable<ZalouserMessageAdapter["send"]>;

36+37+

function requireZalouserSendPayload(): ZalouserSendPayload {

38+

const sendPayload = zalouserPlugin.outbound?.sendPayload;

39+

if (!sendPayload) {

40+

throw new Error("Expected Zalouser outbound sendPayload");

41+

}

42+

return sendPayload;

43+

}

44+45+

function requireZalouserMessageAdapter(): ZalouserMessageAdapter {

46+

const adapter = zalouserPlugin.message;

47+

if (!adapter) {

48+

throw new Error("Expected Zalouser message adapter");

49+

}

50+

return adapter;

51+

}

52+53+

function requireZalouserTextSender(

54+

adapter: ZalouserMessageAdapter,

55+

): NonNullable<ZalouserMessageSender["text"]> {

56+

const text = adapter.send?.text;

57+

if (!text) {

58+

throw new Error("Expected Zalouser message adapter text sender");

59+

}

60+

return text;

61+

}

62+63+

function requireZalouserMediaSender(

64+

adapter: ZalouserMessageAdapter,

65+

): NonNullable<ZalouserMessageSender["media"]> {

66+

const media = adapter.send?.media;

67+

if (!media) {

68+

throw new Error("Expected Zalouser message adapter media sender");

69+

}

70+

return media;

71+

}

72+3273

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

3374

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

3475

@@ -47,8 +88,9 @@ describe("zalouserPlugin outbound sendPayload", () => {

47884889

it("group target delegates with isGroup=true and stripped threadId", async () => {

4990

mockedSend.mockResolvedValue({ ok: true, messageId: "zlu-g1" } as never);

91+

const sendPayload = requireZalouserSendPayload();

509251-

const result = await zalouserPlugin.outbound!.sendPayload!({

93+

const result = await sendPayload({

5294

...baseCtx({ text: "hello group" }),

5395

to: "group:1471383327500481391",

5496

});

@@ -63,8 +105,9 @@ describe("zalouserPlugin outbound sendPayload", () => {

6310564106

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

65107

mockedSend.mockResolvedValue({ ok: true, messageId: "zlu-d1" } as never);

108+

const sendPayload = requireZalouserSendPayload();

6610967-

const result = await zalouserPlugin.outbound!.sendPayload!({

110+

const result = await sendPayload({

68111

...baseCtx({ text: "hello" }),

69112

to: "987654321",

70113

});

@@ -79,8 +122,9 @@ describe("zalouserPlugin outbound sendPayload", () => {

7912280123

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

81124

mockedSend.mockResolvedValue({ ok: true, messageId: "zlu-g-native" } as never);

125+

const sendPayload = requireZalouserSendPayload();

8212683-

const result = await zalouserPlugin.outbound!.sendPayload!({

127+

const result = await sendPayload({

84128

...baseCtx({ text: "hello native group" }),

85129

to: "g-1471383327500481391",

86130

});

@@ -96,8 +140,9 @@ describe("zalouserPlugin outbound sendPayload", () => {

96140

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

97141

const text = `**${"a".repeat(2501)}**`;

98142

mockedSend.mockResolvedValue({ ok: true, messageId: "zlu-code" } as never);

143+

const sendPayload = requireZalouserSendPayload();

99144100-

const result = await zalouserPlugin.outbound!.sendPayload!({

145+

const result = await sendPayload({

101146

...baseCtx({ text }),

102147

to: "987654321",

103148

});

@@ -136,33 +181,34 @@ describe("zalouserPlugin outbound sendPayload", () => {

136181

}),

137182

},

138183

);

184+

const adapter = requireZalouserMessageAdapter();

185+

const sendText = requireZalouserTextSender(adapter);

186+

const sendMedia = requireZalouserMediaSender(adapter);

139187140188

await expect(

141189

verifyChannelMessageAdapterCapabilityProofs({

142190

adapterName: "zalouser",

143-

adapter: zalouserPlugin.message!,

191+

adapter,

144192

proofs: {

145193

text: async () => {

146-

const result = await zalouserPlugin.message?.send?.text?.({

194+

const result = await sendText({

147195

cfg: {},

148196

to: "user:987654321",

149197

text: "hello",

150198

});

151-

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

199+

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

152200

},

153201

media: async () => {

154-

const result = await zalouserPlugin.message?.send?.media?.({

202+

const result = await sendMedia({

155203

cfg: {},

156204

to: "user:987654321",

157205

text: "image",

158206

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

159207

});

160-

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

208+

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

161209

},

162210

messageSendingHooks: () => {

163-

expect(zalouserPlugin.message?.durableFinal?.capabilities?.messageSendingHooks).toBe(

164-

true,

165-

);

211+

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

166212

},

167213

},

168214

}),

@@ -194,8 +240,9 @@ describe("zalouserPlugin outbound payload contract", () => {

194240

text: "",

195241

payload: params.payload,

196242

};

243+

const sendPayload = requireZalouserSendPayload();

197244

return {

198-

run: async () => await zalouserPlugin.outbound!.sendPayload!(ctx),

245+

run: async () => await sendPayload(ctx),

199246

sendMock: mockedSend,

200247

to: "987654321",

201248

};