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

推荐订阅源

D
DataBreaches.Net
小众软件
小众软件
腾讯CDC
Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Cloudflare Blog
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
Y
Y Combinator Blog
Engineering at Meta
Engineering at Meta
美团技术团队
U
Unit 42
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
WordPress大学
WordPress大学
N
Netflix TechBlog - Medium
Microsoft Security Blog
Microsoft Security Blog
L
LangChain Blog
罗磊的独立博客
aimingoo的专栏
aimingoo的专栏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
G
Google Developers Blog
C
Check Point Blog
大猫的无限游戏
大猫的无限游戏
Recent Announcements
Recent Announcements

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: preserve discord announce account routing · openclaw...
steipete · 2026-05-02 · via Recent Commits to openclaw:main

@@ -3,8 +3,15 @@ import type { CallGatewayOptions } from "../../gateway/call.js";

33

import { setActivePluginRegistry } from "../../plugins/runtime.js";

44

import { createSessionConversationTestRegistry } from "../../test-utils/session-conversation-registry.js";

55

import { runAgentStep } from "./agent-step.js";

6+

import type { SessionListRow } from "./sessions-helpers.js";

67

import { runSessionsSendA2AFlow, __testing } from "./sessions-send-tool.a2a.js";

789+

const callGatewayMock = vi.hoisted(() => vi.fn());

10+11+

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

12+

callGateway: (opts: unknown) => callGatewayMock(opts),

13+

}));

14+815

vi.mock("../run-wait.js", () => ({

916

waitForAgentRun: vi.fn().mockResolvedValue({ status: "ok" }),

1017

readLatestAssistantReply: vi.fn().mockResolvedValue("Test announce reply"),

@@ -16,17 +23,25 @@ vi.mock("./agent-step.js", () => ({

16231724

describe("runSessionsSendA2AFlow announce delivery", () => {

1825

let gatewayCalls: CallGatewayOptions[];

26+

let sessionListRows: SessionListRow[];

19272028

beforeEach(() => {

2129

setActivePluginRegistry(createSessionConversationTestRegistry());

2230

gatewayCalls = [];

31+

sessionListRows = [];

32+

callGatewayMock.mockReset();

33+

const callGateway = async <T = Record<string, unknown>>(opts: CallGatewayOptions) => {

34+

gatewayCalls.push(opts);

35+

if (opts.method === "sessions.list") {

36+

return { sessions: sessionListRows } as T;

37+

}

38+

return {} as T;

39+

};

40+

callGatewayMock.mockImplementation(callGateway);

2341

vi.clearAllMocks();

2442

vi.mocked(runAgentStep).mockResolvedValue("Test announce reply");

2543

__testing.setDepsForTest({

26-

callGateway: async <T = Record<string, unknown>>(opts: CallGatewayOptions) => {

27-

gatewayCalls.push(opts);

28-

return {} as T;

29-

},

44+

callGateway,

3045

});

3146

});

3247

@@ -70,6 +85,55 @@ describe("runSessionsSendA2AFlow announce delivery", () => {

7085

expect(sendParams.threadId).toBeUndefined();

7186

});

728788+

it.each([

89+

{

90+

source: "deliveryContext.accountId",

91+

accountId: "thinker",

92+

session: {

93+

key: "agent:main:discord:channel:target-room",

94+

kind: "group",

95+

channel: "discord",

96+

deliveryContext: {

97+

channel: "discord",

98+

to: "channel:target-room",

99+

accountId: "thinker",

100+

},

101+

} satisfies SessionListRow,

102+

},

103+

{

104+

source: "lastAccountId",

105+

accountId: "scout",

106+

session: {

107+

key: "agent:main:discord:channel:target-room",

108+

kind: "group",

109+

channel: "discord",

110+

lastChannel: "discord",

111+

lastTo: "channel:target-room",

112+

lastAccountId: "scout",

113+

} satisfies SessionListRow,

114+

},

115+

])("uses Discord session $source for announce accountId", async ({ accountId, session }) => {

116+

sessionListRows = [session];

117+118+

await runSessionsSendA2AFlow({

119+

targetSessionKey: session.key,

120+

displayKey: session.key,

121+

message: "Test message",

122+

announceTimeoutMs: 10_000,

123+

maxPingPongTurns: 0,

124+

roundOneReply: "Worker completed successfully",

125+

});

126+127+

expect(gatewayCalls.some((call) => call.method === "sessions.list")).toBe(true);

128+

const sendCall = gatewayCalls.find((call) => call.method === "send");

129+

expect(sendCall).toBeDefined();

130+

expect(sendCall?.params).toMatchObject({

131+

channel: "discord",

132+

to: "channel:target-room",

133+

accountId,

134+

});

135+

});

136+73137

it.each(["NO_REPLY", "HEARTBEAT_OK", "ANNOUNCE_SKIP", "REPLY_SKIP"])(

74138

"does not re-inject exact control reply %s into agent-to-agent flow",

75139

async (roundOneReply) => {