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

推荐订阅源

V
Visual Studio Blog
I
InfoQ
H
Help Net Security
GbyAI
GbyAI
博客园 - 叶小钗
Recent Announcements
Recent Announcements
Engineering at Meta
Engineering at Meta
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
爱范儿
爱范儿
Y
Y Combinator Blog
L
LangChain Blog
腾讯CDC
酷 壳 – CoolShell
酷 壳 – CoolShell
WordPress大学
WordPress大学
Stack Overflow Blog
Stack Overflow Blog
F
Fortinet All Blogs
G
Google Developers Blog
Apple Machine Learning Research
Apple Machine Learning Research
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
博客园 - Franky
D
Docker
Jina AI
Jina AI
罗磊的独立博客

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: deliver subagent completions via external requester ...
steipete · 2026-04-25 · via Recent Commits to openclaw:main

@@ -113,6 +113,58 @@ async function deliverDiscordDirectMessageCompletion(params: {

113113

});

114114

}

115115116+

async function deliverSlackChannelAnnouncement(params: {

117+

callGateway: typeof runtimeCallGateway;

118+

isActive: boolean;

119+

sessionId: string;

120+

expectsCompletionMessage: boolean;

121+

directIdempotencyKey: string;

122+

completionDirectOrigin?: {

123+

channel?: string;

124+

to?: string;

125+

accountId?: string;

126+

threadId?: string | number;

127+

};

128+

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

129+

sendMessage?: typeof runtimeSendMessage;

130+

internalEvents?: AgentInternalEvent[];

131+

}) {

132+

const origin = {

133+

channel: "slack",

134+

to: "channel:C123",

135+

accountId: "acct-1",

136+

} as const;

137+138+

__testing.setDepsForTest({

139+

callGateway: params.callGateway,

140+

getRequesterSessionActivity: () => ({

141+

sessionId: params.sessionId,

142+

isActive: params.isActive,

143+

}),

144+

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

145+

...(params.queueEmbeddedPiMessage

146+

? { queueEmbeddedPiMessage: params.queueEmbeddedPiMessage }

147+

: {}),

148+

...(params.sendMessage ? { sendMessage: params.sendMessage } : {}),

149+

});

150+151+

return deliverSubagentAnnouncement({

152+

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

153+

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

154+

triggerMessage: "child done",

155+

steerMessage: "child done",

156+

requesterOrigin: origin,

157+

requesterSessionOrigin: origin,

158+

completionDirectOrigin: params.completionDirectOrigin ?? origin,

159+

directOrigin: origin,

160+

requesterIsSubagent: false,

161+

expectsCompletionMessage: params.expectsCompletionMessage,

162+

bestEffortDeliver: true,

163+

directIdempotencyKey: params.directIdempotencyKey,

164+

internalEvents: params.internalEvents,

165+

});

166+

}

167+116168

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

117169

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

118170

expect(

@@ -399,7 +451,7 @@ describe("deliverSubagentAnnouncement completion delivery", () => {

399451

expect(result).toEqual(

400452

expect.objectContaining({

401453

delivered: true,

402-

path: "direct-thread-fallback",

454+

path: "direct-fallback",

403455

}),

404456

);

405457

expect(callGateway).toHaveBeenCalledWith(

@@ -428,6 +480,106 @@ describe("deliverSubagentAnnouncement completion delivery", () => {

428480

);

429481

});

430482483+

it("uses a direct channel fallback when announce-agent returns no visible output", async () => {

484+

const callGateway = createGatewayMock({

485+

result: {

486+

payloads: [],

487+

},

488+

});

489+

const sendMessage = createSendMessageMock();

490+

const result = await deliverSlackChannelAnnouncement({

491+

callGateway,

492+

sendMessage,

493+

sessionId: "requester-session-channel",

494+

isActive: false,

495+

expectsCompletionMessage: true,

496+

directIdempotencyKey: "announce-channel-fallback-empty",

497+

internalEvents: [

498+

{

499+

type: "task_completion",

500+

source: "subagent",

501+

childSessionKey: "agent:worker:subagent:child",

502+

childSessionId: "child-session-id",

503+

announceType: "subagent task",

504+

taskLabel: "channel completion smoke",

505+

status: "ok",

506+

statusLabel: "completed successfully",

507+

result: "child completion output",

508+

replyInstruction: "Summarize the result.",

509+

},

510+

],

511+

});

512+513+

expect(result).toEqual(

514+

expect.objectContaining({

515+

delivered: true,

516+

path: "direct-fallback",

517+

}),

518+

);

519+

expect(callGateway).toHaveBeenCalled();

520+

expect(sendMessage).toHaveBeenCalledWith(

521+

expect.objectContaining({

522+

channel: "slack",

523+

accountId: "acct-1",

524+

to: "channel:C123",

525+

threadId: undefined,

526+

content: "child completion output",

527+

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

528+

bestEffort: true,

529+

idempotencyKey: "announce-channel-fallback-empty",

530+

}),

531+

);

532+

});

533+534+

it("falls back to the external requester route when completion origin is internal", async () => {

535+

const callGateway = createGatewayMock({

536+

result: {

537+

payloads: [{ text: "child completion output" }],

538+

},

539+

});

540+

const result = await deliverSlackChannelAnnouncement({

541+

callGateway,

542+

sessionId: "requester-session-channel",

543+

isActive: false,

544+

expectsCompletionMessage: true,

545+

directIdempotencyKey: "announce-channel-internal-origin",

546+

completionDirectOrigin: {

547+

channel: "webchat",

548+

},

549+

internalEvents: [

550+

{

551+

type: "task_completion",

552+

source: "subagent",

553+

childSessionKey: "agent:worker:subagent:child",

554+

childSessionId: "child-session-id",

555+

announceType: "subagent task",

556+

taskLabel: "channel completion smoke",

557+

status: "ok",

558+

statusLabel: "completed successfully",

559+

result: "child completion output",

560+

replyInstruction: "Summarize the result.",

561+

},

562+

],

563+

});

564+565+

expect(result).toEqual(

566+

expect.objectContaining({

567+

delivered: true,

568+

path: "direct",

569+

}),

570+

);

571+

expect(callGateway).toHaveBeenCalledWith(

572+

expect.objectContaining({

573+

params: expect.objectContaining({

574+

deliver: true,

575+

channel: "slack",

576+

accountId: "acct-1",

577+

to: "channel:C123",

578+

}),

579+

}),

580+

);

581+

});

582+431583

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

432584

const callGateway = createGatewayMock();

433585

await deliverSlackThreadAnnouncement({