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

推荐订阅源

GbyAI
GbyAI
阮一峰的网络日志
阮一峰的网络日志
G
Google Developers Blog
J
Java Code Geeks
Blog — PlanetScale
Blog — PlanetScale
大猫的无限游戏
大猫的无限游戏
云风的 BLOG
云风的 BLOG
Vercel News
Vercel News
L
LangChain Blog
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Stack Overflow Blog
Stack Overflow Blog
P
Proofpoint News Feed
腾讯CDC
博客园_首页
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
M
MIT News - Artificial intelligence
WordPress大学
WordPress大学
D
DataBreaches.Net
Microsoft Security Blog
Microsoft Security 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: tighten feishu card action lifecycle assertions · o...
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -115,6 +115,30 @@ async function setupLifecycleMonitor() {

115115

});

116116

}

117117118+

function latestReplyDispatcherParams() {

119+

const call = createFeishuReplyDispatcherMock.mock.calls.at(-1);

120+

if (!call) {

121+

throw new Error("expected Feishu reply dispatcher call");

122+

}

123+

return call[0] as {

124+

accountId?: string;

125+

chatId?: string;

126+

replyToMessageId?: string;

127+

};

128+

}

129+130+

function latestFinalizedContext() {

131+

const call = finalizeInboundContextMock.mock.calls.at(-1);

132+

if (!call) {

133+

throw new Error("expected finalized inbound context call");

134+

}

135+

return call[0] as {

136+

AccountId?: string;

137+

SessionKey?: string;

138+

MessageSid?: string;

139+

};

140+

}

141+118142

describe("Feishu card-action lifecycle", () => {

119143

beforeEach(() => {

120144

vi.useRealTimers();

@@ -180,20 +204,14 @@ describe("Feishu card-action lifecycle", () => {

180204

expect(lastRuntime?.error).not.toHaveBeenCalled();

181205

expect(dispatchReplyFromConfigMock).toHaveBeenCalledTimes(1);

182206

expect(createFeishuReplyDispatcherMock).toHaveBeenCalledTimes(1);

183-

expect(createFeishuReplyDispatcherMock).toHaveBeenCalledWith(

184-

expect.objectContaining({

185-

accountId: "acct-card",

186-

chatId: "p2p:ou_user1",

187-

replyToMessageId: undefined,

188-

}),

189-

);

190-

expect(finalizeInboundContextMock).toHaveBeenCalledWith(

191-

expect.objectContaining({

192-

AccountId: "acct-card",

193-

SessionKey: "agent:bound-agent:feishu:direct:ou_user1",

194-

MessageSid: "card-action-tok-card-once",

195-

}),

196-

);

207+

const dispatcherParams = latestReplyDispatcherParams();

208+

expect(dispatcherParams.accountId).toBe("acct-card");

209+

expect(dispatcherParams.chatId).toBe("p2p:ou_user1");

210+

expect(dispatcherParams.replyToMessageId).toBeUndefined();

211+

const finalized = latestFinalizedContext();

212+

expect(finalized.AccountId).toBe("acct-card");

213+

expect(finalized.SessionKey).toBe("agent:bound-agent:feishu:direct:ou_user1");

214+

expect(finalized.MessageSid).toBe("card-action-tok-card-once");

197215

expect(touchBindingMock).toHaveBeenCalledWith("binding-card");

198216199217

expectFeishuReplyDispatcherSentFinalReplyOnce({ createFeishuReplyDispatcherMock });

@@ -232,18 +250,11 @@ describe("Feishu card-action lifecycle", () => {

232250233251

expect(lastRuntime?.error).not.toHaveBeenCalled();

234252

expect(dispatchReplyFromConfigMock).toHaveBeenCalledTimes(1);

235-

expect(createFeishuReplyDispatcherMock).toHaveBeenCalledWith(

236-

expect.objectContaining({

237-

accountId: "acct-card",

238-

chatId,

239-

replyToMessageId: "om_card_v2",

240-

}),

241-

);

242-

expect(finalizeInboundContextMock).toHaveBeenCalledWith(

243-

expect.objectContaining({

244-

MessageSid: "card-action-tok-card-v2-context",

245-

}),

246-

);

253+

const dispatcherParams = latestReplyDispatcherParams();

254+

expect(dispatcherParams.accountId).toBe("acct-card");

255+

expect(dispatcherParams.chatId).toBe(chatId);

256+

expect(dispatcherParams.replyToMessageId).toBe("om_card_v2");

257+

expect(latestFinalizedContext().MessageSid).toBe("card-action-tok-card-v2-context");

247258

});

248259249260

it("routes SDK-style card callbacks without context as direct callbacks", async () => {

@@ -265,18 +276,11 @@ describe("Feishu card-action lifecycle", () => {

265276266277

expect(lastRuntime?.error).not.toHaveBeenCalled();

267278

expect(dispatchReplyFromConfigMock).toHaveBeenCalledTimes(1);

268-

expect(createFeishuReplyDispatcherMock).toHaveBeenCalledWith(

269-

expect.objectContaining({

270-

accountId: "acct-card",

271-

chatId: "ou_user1",

272-

replyToMessageId: "om_sdk_card",

273-

}),

274-

);

275-

expect(finalizeInboundContextMock).toHaveBeenCalledWith(

276-

expect.objectContaining({

277-

MessageSid: "card-action-tok-card-sdk-flat",

278-

}),

279-

);

279+

const dispatcherParams = latestReplyDispatcherParams();

280+

expect(dispatcherParams.accountId).toBe("acct-card");

281+

expect(dispatcherParams.chatId).toBe("ou_user1");

282+

expect(dispatcherParams.replyToMessageId).toBe("om_sdk_card");

283+

expect(latestFinalizedContext().MessageSid).toBe("card-action-tok-card-sdk-flat");

280284

});

281285282286

it("plain-sends card action replies when Feishu provides no real message id", async () => {

@@ -295,18 +299,11 @@ describe("Feishu card-action lifecycle", () => {

295299296300

expect(lastRuntime?.error).not.toHaveBeenCalled();

297301

expect(dispatchReplyFromConfigMock).toHaveBeenCalledTimes(1);

298-

expect(createFeishuReplyDispatcherMock).toHaveBeenCalledWith(

299-

expect.objectContaining({

300-

accountId: "acct-card",

301-

chatId: "ou_user1",

302-

replyToMessageId: undefined,

303-

}),

304-

);

305-

expect(finalizeInboundContextMock).toHaveBeenCalledWith(

306-

expect.objectContaining({

307-

MessageSid: "card-action-tok-card-no-reply-target",

308-

}),

309-

);

302+

const dispatcherParams = latestReplyDispatcherParams();

303+

expect(dispatcherParams.accountId).toBe("acct-card");

304+

expect(dispatcherParams.chatId).toBe("ou_user1");

305+

expect(dispatcherParams.replyToMessageId).toBeUndefined();

306+

expect(latestFinalizedContext().MessageSid).toBe("card-action-tok-card-no-reply-target");

310307

});

311308312309

it("does not duplicate delivery when retrying after a post-send failure", async () => {