
























@@ -4526,6 +4526,44 @@ describe("deliverSubagentAnnouncement completion delivery", () => {
45264526expect(sendMessage).not.toHaveBeenCalled();
45274527});
452845284529+it("preserves pending completion announce delivery without media fallback", async () => {
4530+const callGateway = createGatewayMock({
4531+runId: "subagent:child:ok",
4532+status: "accepted",
4533+acceptedAt: Date.now(),
4534+});
4535+const sendMessage = createSendMessageMock();
4536+const result = await deliverSlackChannelAnnouncement({
4537+ callGateway,
4538+ sendMessage,
4539+sessionId: "requester-session-channel",
4540+isActive: false,
4541+expectsCompletionMessage: true,
4542+directIdempotencyKey: "announce-channel-completion-pending",
4543+internalEvents: [
4544+{
4545+type: "task_completion",
4546+source: "subagent",
4547+childSessionKey: "agent:worker:subagent:child",
4548+childSessionId: "child-session-id",
4549+announceType: "subagent task",
4550+taskLabel: "channel completion smoke",
4551+status: "ok",
4552+statusLabel: "completed successfully",
4553+result: "child completion output",
4554+replyInstruction: "Summarize the result.",
4555+},
4556+],
4557+});
4558+4559+expectRecordFields(result, {
4560+delivered: true,
4561+path: "direct",
4562+});
4563+expect(callGateway).toHaveBeenCalledTimes(1);
4564+expect(sendMessage).not.toHaveBeenCalled();
4565+});
4566+45294567it("does not fail stale channel subagent completions only because the parent stayed private", async () => {
45304568const callGateway = createGatewayMock({
45314569result: {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。