mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-07 07:58:36 +00:00
test(agents): align direct media block delivery coverage
This commit is contained in:
@@ -268,7 +268,8 @@ describe("runReplyAgent media path normalization", () => {
|
||||
}),
|
||||
);
|
||||
|
||||
expect(result).toMatchObject({
|
||||
expect(result).toBeUndefined();
|
||||
expect(onBlockReply).toHaveBeenCalledWith({
|
||||
text: "here is the chart",
|
||||
mediaUrl: "/tmp/outbound-media/1-chart.png",
|
||||
mediaUrls: ["/tmp/outbound-media/1-chart.png"],
|
||||
@@ -277,7 +278,6 @@ describe("runReplyAgent media path normalization", () => {
|
||||
audioAsVoice: false,
|
||||
});
|
||||
expect(resolveOutboundAttachmentFromUrlMock).toHaveBeenCalledTimes(1);
|
||||
expect(onBlockReply).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("does not create a second media context inside runAgentTurnWithFallback when onBlockReply is provided", async () => {
|
||||
|
||||
@@ -158,8 +158,6 @@ export function createBlockReplyDeliveryHandler(params: {
|
||||
payload: blockPayload,
|
||||
});
|
||||
} else if (blockHasMedia) {
|
||||
// Media-bearing block replies (including text+media tool attachments) are not reliably
|
||||
// reconstructible from the assistant's final text, so send them directly when streaming is off.
|
||||
await sendDirectBlockReply({
|
||||
onBlockReply: params.onBlockReply,
|
||||
directlySentBlockKeys: params.directlySentBlockKeys,
|
||||
|
||||
Reference in New Issue
Block a user