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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
WordPress大学
WordPress大学
U
Unit 42
I
InfoQ
A
About on SuperTechFans
宝玉的分享
宝玉的分享
J
Java Code Geeks
博客园 - 司徒正美
爱范儿
爱范儿
Engineering at Meta
Engineering at Meta
G
Google Developers Blog
人人都是产品经理
人人都是产品经理
小众软件
小众软件
Microsoft Security Blog
Microsoft Security Blog
L
LangChain Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Hugging Face - Blog
Hugging Face - Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
aimingoo的专栏
aimingoo的专栏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Last Week in AI
Last Week in AI
腾讯CDC
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
test: dedupe subagent announcement fixtures · openclaw/op...
steipete · 2026-04-24 · via Recent Commits to openclaw:main

@@ -7,6 +7,53 @@ afterEach(() => {

77

__testing.setDepsForTest();

88

});

9910+

const slackThreadOrigin = {

11+

channel: "slack",

12+

to: "channel:C123",

13+

accountId: "acct-1",

14+

threadId: "171.222",

15+

} as const;

16+17+

function createGatewayMock() {

18+

return vi.fn(async () => ({}) as Record<string, unknown>) as unknown as typeof runtimeCallGateway;

19+

}

20+21+

async function deliverSlackThreadAnnouncement(params: {

22+

callGateway: typeof runtimeCallGateway;

23+

isActive: boolean;

24+

sessionId: string;

25+

expectsCompletionMessage: boolean;

26+

directIdempotencyKey: string;

27+

queueEmbeddedPiMessage?: (sessionId: string, message: string) => boolean;

28+

}) {

29+

__testing.setDepsForTest({

30+

callGateway: params.callGateway,

31+

getRequesterSessionActivity: () => ({

32+

sessionId: params.sessionId,

33+

isActive: params.isActive,

34+

}),

35+

loadConfig: () => ({}) as never,

36+

...(params.queueEmbeddedPiMessage

37+

? { queueEmbeddedPiMessage: params.queueEmbeddedPiMessage }

38+

: {}),

39+

});

40+41+

return deliverSubagentAnnouncement({

42+

requesterSessionKey: "agent:main:slack:channel:C123:thread:171.222",

43+

targetRequesterSessionKey: "agent:main:slack:channel:C123:thread:171.222",

44+

triggerMessage: "child done",

45+

steerMessage: "child done",

46+

requesterOrigin: slackThreadOrigin,

47+

requesterSessionOrigin: slackThreadOrigin,

48+

completionDirectOrigin: slackThreadOrigin,

49+

directOrigin: slackThreadOrigin,

50+

requesterIsSubagent: false,

51+

expectsCompletionMessage: params.expectsCompletionMessage,

52+

bestEffortDeliver: true,

53+

directIdempotencyKey: params.directIdempotencyKey,

54+

});

55+

}

56+1057

describe("resolveAnnounceOrigin threaded route targets", () => {

1158

it("preserves stored thread ids when requester origin omits one for the same chat", () => {

1259

expect(

@@ -70,53 +117,15 @@ describe("resolveAnnounceOrigin threaded route targets", () => {

7011771118

describe("deliverSubagentAnnouncement completion delivery", () => {

72119

it("keeps completion announces session-internal while preserving route context for active requesters", async () => {

73-

const callGateway = vi.fn(

74-

async () => ({}) as Record<string, unknown>,

75-

) as unknown as typeof runtimeCallGateway;

120+

const callGateway = createGatewayMock();

76121

const queueEmbeddedPiMessage = vi.fn(() => true);

77-

__testing.setDepsForTest({

122+

const result = await deliverSlackThreadAnnouncement({

78123

callGateway,

79-

getRequesterSessionActivity: () => ({

80-

sessionId: "requester-session-1",

81-

isActive: true,

82-

}),

83-

loadConfig: () => ({}) as never,

84-

queueEmbeddedPiMessage,

85-

});

86-87-

const result = await deliverSubagentAnnouncement({

88-

requesterSessionKey: "agent:main:slack:channel:C123:thread:171.222",

89-

targetRequesterSessionKey: "agent:main:slack:channel:C123:thread:171.222",

90-

triggerMessage: "child done",

91-

steerMessage: "child done",

92-

requesterOrigin: {

93-

channel: "slack",

94-

to: "channel:C123",

95-

accountId: "acct-1",

96-

threadId: "171.222",

97-

},

98-

requesterSessionOrigin: {

99-

channel: "slack",

100-

to: "channel:C123",

101-

accountId: "acct-1",

102-

threadId: "171.222",

103-

},

104-

completionDirectOrigin: {

105-

channel: "slack",

106-

to: "channel:C123",

107-

accountId: "acct-1",

108-

threadId: "171.222",

109-

},

110-

directOrigin: {

111-

channel: "slack",

112-

to: "channel:C123",

113-

accountId: "acct-1",

114-

threadId: "171.222",

115-

},

116-

requesterIsSubagent: false,

124+

sessionId: "requester-session-1",

125+

isActive: true,

117126

expectsCompletionMessage: true,

118-

bestEffortDeliver: true,

119127

directIdempotencyKey: "announce-1",

128+

queueEmbeddedPiMessage,

120129

});

121130122131

expect(result).toEqual(

@@ -130,50 +139,12 @@ describe("deliverSubagentAnnouncement completion delivery", () => {

130139

});

131140132141

it("keeps direct external delivery for dormant completion requesters", async () => {

133-

const callGateway = vi.fn(

134-

async () => ({}) as Record<string, unknown>,

135-

) as unknown as typeof runtimeCallGateway;

136-

__testing.setDepsForTest({

142+

const callGateway = createGatewayMock();

143+

await deliverSlackThreadAnnouncement({

137144

callGateway,

138-

getRequesterSessionActivity: () => ({

139-

sessionId: "requester-session-2",

140-

isActive: false,

141-

}),

142-

loadConfig: () => ({}) as never,

143-

});

144-145-

await deliverSubagentAnnouncement({

146-

requesterSessionKey: "agent:main:slack:channel:C123:thread:171.222",

147-

targetRequesterSessionKey: "agent:main:slack:channel:C123:thread:171.222",

148-

triggerMessage: "child done",

149-

steerMessage: "child done",

150-

requesterOrigin: {

151-

channel: "slack",

152-

to: "channel:C123",

153-

accountId: "acct-1",

154-

threadId: "171.222",

155-

},

156-

requesterSessionOrigin: {

157-

channel: "slack",

158-

to: "channel:C123",

159-

accountId: "acct-1",

160-

threadId: "171.222",

161-

},

162-

completionDirectOrigin: {

163-

channel: "slack",

164-

to: "channel:C123",

165-

accountId: "acct-1",

166-

threadId: "171.222",

167-

},

168-

directOrigin: {

169-

channel: "slack",

170-

to: "channel:C123",

171-

accountId: "acct-1",

172-

threadId: "171.222",

173-

},

174-

requesterIsSubagent: false,

145+

sessionId: "requester-session-2",

146+

isActive: false,

175147

expectsCompletionMessage: true,

176-

bestEffortDeliver: true,

177148

directIdempotencyKey: "announce-1b",

178149

});

179150

@@ -193,50 +164,12 @@ describe("deliverSubagentAnnouncement completion delivery", () => {

193164

});

194165195166

it("keeps direct external delivery for non-completion announces", async () => {

196-

const callGateway = vi.fn(

197-

async () => ({}) as Record<string, unknown>,

198-

) as unknown as typeof runtimeCallGateway;

199-

__testing.setDepsForTest({

167+

const callGateway = createGatewayMock();

168+

await deliverSlackThreadAnnouncement({

200169

callGateway,

201-

getRequesterSessionActivity: () => ({

202-

sessionId: "requester-session-3",

203-

isActive: false,

204-

}),

205-

loadConfig: () => ({}) as never,

206-

});

207-208-

await deliverSubagentAnnouncement({

209-

requesterSessionKey: "agent:main:slack:channel:C123:thread:171.222",

210-

targetRequesterSessionKey: "agent:main:slack:channel:C123:thread:171.222",

211-

triggerMessage: "child done",

212-

steerMessage: "child done",

213-

requesterOrigin: {

214-

channel: "slack",

215-

to: "channel:C123",

216-

accountId: "acct-1",

217-

threadId: "171.222",

218-

},

219-

requesterSessionOrigin: {

220-

channel: "slack",

221-

to: "channel:C123",

222-

accountId: "acct-1",

223-

threadId: "171.222",

224-

},

225-

completionDirectOrigin: {

226-

channel: "slack",

227-

to: "channel:C123",

228-

accountId: "acct-1",

229-

threadId: "171.222",

230-

},

231-

directOrigin: {

232-

channel: "slack",

233-

to: "channel:C123",

234-

accountId: "acct-1",

235-

threadId: "171.222",

236-

},

237-

requesterIsSubagent: false,

170+

sessionId: "requester-session-3",

171+

isActive: false,

238172

expectsCompletionMessage: false,

239-

bestEffortDeliver: true,

240173

directIdempotencyKey: "announce-2",

241174

});

242175