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

推荐订阅源

Jina AI
Jina AI
S
SegmentFault 最新的问题
D
DataBreaches.Net
H
Help Net Security
有赞技术团队
有赞技术团队
M
MIT News - Artificial intelligence
Martin Fowler
Martin Fowler
IT之家
IT之家
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
罗磊的独立博客
Y
Y Combinator Blog
阮一峰的网络日志
阮一峰的网络日志
云风的 BLOG
云风的 BLOG
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
Vercel News
Vercel News
Hugging Face - Blog
Hugging Face - Blog
aimingoo的专栏
aimingoo的专栏
Stack Overflow Blog
Stack Overflow Blog
Recent Announcements
Recent Announcements
博客园 - 三生石上(FineUI控件)

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(discord): deliver same-session channel replies · open...
stevenepalme · 2026-05-31 · via Recent Commits to openclaw:main

@@ -111,6 +111,134 @@ describe("runSessionsSendA2AFlow announce delivery", () => {

111111

expect(sendParams.threadId).toBeUndefined();

112112

});

113113114+

it("bypasses the announce decider for same-session channel replies", async () => {

115+

await runSessionsSendA2AFlow({

116+

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

117+

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

118+

message: "Test message",

119+

announceTimeoutMs: 10_000,

120+

maxPingPongTurns: 2,

121+

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

122+

requesterChannel: "discord",

123+

roundOneReply: "Substantive channel reply",

124+

});

125+126+

expect(runAgentStep).not.toHaveBeenCalled();

127+

const sendCall = requireGatewayCall("send");

128+

const sendParams = sendCall.params as Record<string, unknown>;

129+

expect(sendParams.channel).toBe("discord");

130+

expect(sendParams.to).toBe("channel:target-room");

131+

expect(sendParams.message).toBe("Substantive channel reply");

132+

});

133+134+

it("bypasses the announce decider for delayed same-session channel replies", async () => {

135+

vi.mocked(readLatestAssistantReplySnapshot).mockResolvedValueOnce({

136+

text: "Delayed channel reply",

137+

fingerprint: "delayed-channel-reply",

138+

});

139+140+

await runSessionsSendA2AFlow({

141+

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

142+

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

143+

message: "Test message",

144+

announceTimeoutMs: 10_000,

145+

maxPingPongTurns: 2,

146+

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

147+

requesterChannel: "discord",

148+

baseline: {

149+

text: "Previous channel reply",

150+

fingerprint: "previous-channel-reply",

151+

},

152+

waitRunId: "run-delayed-channel",

153+

});

154+155+

expect(firstMockArg(vi.mocked(waitForAgentRun), "agent run wait").runId).toBe(

156+

"run-delayed-channel",

157+

);

158+

expect(

159+

firstMockArg(vi.mocked(readLatestAssistantReplySnapshot), "assistant reply snapshot")

160+

.sessionKey,

161+

).toBe("agent:main:discord:channel:target-room");

162+

expect(runAgentStep).not.toHaveBeenCalled();

163+

const sendCall = requireGatewayCall("send");

164+

const sendParams = sendCall.params as Record<string, unknown>;

165+

expect(sendParams.channel).toBe("discord");

166+

expect(sendParams.to).toBe("channel:target-room");

167+

expect(sendParams.message).toBe("Delayed channel reply");

168+

});

169+170+

it("does not direct-deliver a delayed same-session reply that matches the baseline", async () => {

171+

vi.mocked(readLatestAssistantReplySnapshot).mockResolvedValueOnce({

172+

text: "Previous channel reply",

173+

fingerprint: "previous-channel-reply",

174+

});

175+176+

await runSessionsSendA2AFlow({

177+

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

178+

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

179+

message: "Test message",

180+

announceTimeoutMs: 10_000,

181+

maxPingPongTurns: 2,

182+

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

183+

requesterChannel: "discord",

184+

baseline: {

185+

text: "Previous channel reply",

186+

fingerprint: "previous-channel-reply",

187+

},

188+

waitRunId: "run-delayed-channel",

189+

});

190+191+

expect(firstMockArg(vi.mocked(waitForAgentRun), "agent run wait").runId).toBe(

192+

"run-delayed-channel",

193+

);

194+

expect(runAgentStep).not.toHaveBeenCalled();

195+

expect(gatewayCalls.find((call) => call.method === "send")).toBeUndefined();

196+

});

197+198+

it("does not direct-deliver a delayed same-session reply without a baseline", async () => {

199+

vi.mocked(readLatestAssistantReplySnapshot).mockResolvedValueOnce({

200+

text: "Maybe stale channel reply",

201+

fingerprint: "maybe-stale-channel-reply",

202+

});

203+204+

await runSessionsSendA2AFlow({

205+

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

206+

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

207+

message: "Test message",

208+

announceTimeoutMs: 10_000,

209+

maxPingPongTurns: 2,

210+

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

211+

requesterChannel: "discord",

212+

waitRunId: "run-delayed-channel",

213+

});

214+215+

expect(firstMockArg(vi.mocked(waitForAgentRun), "agent run wait").runId).toBe(

216+

"run-delayed-channel",

217+

);

218+

expect(runAgentStep).not.toHaveBeenCalled();

219+

expect(gatewayCalls.find((call) => call.method === "send")).toBeUndefined();

220+

});

221+222+

it("keeps the announce decider for same-session sends from a different channel", async () => {

223+

vi.mocked(runAgentStep).mockResolvedValueOnce("ANNOUNCE_SKIP");

224+225+

await runSessionsSendA2AFlow({

226+

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

227+

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

228+

message: "Test message",

229+

announceTimeoutMs: 10_000,

230+

maxPingPongTurns: 2,

231+

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

232+

requesterChannel: "webchat",

233+

roundOneReply: "Substantive channel reply",

234+

});

235+236+

expect(runAgentStep).toHaveBeenCalledTimes(1);

237+

const stepInput = firstMockArg(vi.mocked(runAgentStep), "agent step");

238+

expect(stepInput.message).toBe("Agent-to-agent announce step.");

239+

expect(gatewayCalls.find((call) => call.method === "send")).toBeUndefined();

240+

});

241+114242

it.each([

115243

{

116244

source: "deliveryContext.accountId",

@@ -207,7 +335,7 @@ describe("runSessionsSendA2AFlow announce delivery", () => {

207335

expect(gatewayCalls.find((call) => call.method === "send")).toBeUndefined();

208336

});

209337210-

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

338+

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

211339

"suppresses exact announce control reply %s before channel delivery",

212340

async (announceReply) => {

213341

vi.mocked(runAgentStep).mockResolvedValueOnce(announceReply);