




















@@ -1387,7 +1387,7 @@ describe("deliverSubagentAnnouncement completion delivery", () => {
13871387expect(sendMessage).not.toHaveBeenCalled();
13881388});
138913891390-it("accepts failed generated media completion notices through the message tool", async () => {
1390+it("accepts failed generated media completion notices without requiring message-tool delivery", async () => {
13911391const callGateway = createGatewayMock({
13921392result: {
13931393payloads: [],
@@ -1428,12 +1428,11 @@ describe("deliverSubagentAnnouncement completion delivery", () => {
14281428path: "direct",
14291429});
14301430expectGatewayAgentParams(callGateway, {
1431-deliver: false,
1431+deliver: true,
14321432channel: "discord",
14331433accountId: "acct-1",
14341434to: "dm:U123",
14351435threadId: undefined,
1436-sourceReplyDeliveryMode: "message_tool_only",
14371436});
14381437expect(sendMessage).not.toHaveBeenCalled();
14391438});
@@ -1485,6 +1484,44 @@ describe("deliverSubagentAnnouncement completion delivery", () => {
14851484expect(sendMessage).not.toHaveBeenCalled();
14861485});
148714861487+it("allows visible direct delivery for media generation failure summaries without generated media", async () => {
1488+const callGateway = createGatewayMock({
1489+result: {
1490+payloads: [{ text: "Music generation failed. Provider timed out." }],
1491+},
1492+});
1493+const result = await deliverDiscordDirectMessageCompletion({
1494+ callGateway,
1495+sourceTool: "music_generate",
1496+internalEvents: [
1497+{
1498+type: "task_completion",
1499+source: "music_generation",
1500+childSessionKey: "music_generate:task-123",
1501+childSessionId: "task-123",
1502+announceType: "music generation task",
1503+taskLabel: "night-drive synthwave",
1504+status: "error",
1505+statusLabel: "failed",
1506+result: "All music generation models failed.",
1507+replyInstruction: "Tell the user music generation failed.",
1508+},
1509+],
1510+});
1511+1512+expectRecordFields(result, {
1513+delivered: true,
1514+path: "direct",
1515+});
1516+expectGatewayAgentParams(callGateway, {
1517+deliver: true,
1518+channel: "discord",
1519+accountId: "acct-1",
1520+to: "dm:U123",
1521+threadId: undefined,
1522+});
1523+});
1524+14881525it("reports generated media group completions that miss required message-tool delivery", async () => {
14891526const callGateway = createGatewayMock({
14901527result: {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。