Skip to content

Commit f9c8cb7

Browse files
committed
fix(feishu): refresh inbound session routes
1 parent 3c6ec52 commit f9c8cb7

5 files changed

Lines changed: 432 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Docs: https://docs.openclaw.ai
2323

2424
### Fixes
2525

26+
- Feishu: refresh inbound session delivery context for DM, group, and broadcast turns so later replies do not inherit stale WebChat routing. Fixes #78274.
2627
- Agents/OpenAI streams: yield via `setTimeout(0)` instead of `setImmediate` between bursty Responses chunks so abort timers can fire during the yield, keeping cancel-on-timeout responsive on hot streams. Refs #82462.
2728
- Feishu: detect SecretRef top-level credentials as a configured default account instead of treating object-backed app secrets as missing.
2829
- CLI/completion: resolve concrete PowerShell profile paths and reload commands during setup and doctor completion installation. Fixes #44296. (#83059) Thanks @yu-xin-c.

extensions/feishu/src/bot.broadcast.test.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,43 @@ describe("broadcast dispatch", () => {
284284
const sessionKeys = finalizeInboundContextCalls.map((call) => call.SessionKey);
285285
expect(sessionKeys).toContain("agent:susan:feishu:group:oc-broadcast-group");
286286
expect(sessionKeys).toContain("agent:main:feishu:group:oc-broadcast-group");
287+
const recordCalls = (
288+
runtimeStub.channel.session.recordInboundSession as unknown as {
289+
mock: {
290+
calls: Array<
291+
[
292+
{
293+
updateLastRoute?: {
294+
sessionKey?: unknown;
295+
channel?: unknown;
296+
to?: unknown;
297+
};
298+
},
299+
]
300+
>;
301+
};
302+
}
303+
).mock.calls;
304+
expect(
305+
recordCalls
306+
.map(([call]) => ({
307+
sessionKey: call.updateLastRoute?.["sessionKey"],
308+
channel: call.updateLastRoute?.["channel"],
309+
to: call.updateLastRoute?.["to"],
310+
}))
311+
.toSorted((left, right) => String(left.sessionKey).localeCompare(String(right.sessionKey))),
312+
).toEqual([
313+
{
314+
sessionKey: "agent:main:feishu:group:oc-broadcast-group",
315+
channel: "feishu",
316+
to: "chat:oc-broadcast-group",
317+
},
318+
{
319+
sessionKey: "agent:susan:feishu:group:oc-broadcast-group",
320+
channel: "feishu",
321+
to: "chat:oc-broadcast-group",
322+
},
323+
]);
287324
expect(mockGetChatInfo).toHaveBeenCalledTimes(1);
288325
expect(
289326
finalizeInboundContextCalls

0 commit comments

Comments
 (0)