diff --git a/extensions/feishu/src/reply-dispatcher.test.ts b/extensions/feishu/src/reply-dispatcher.test.ts index c7b2f9af28b..11905a3bbca 100644 --- a/extensions/feishu/src/reply-dispatcher.test.ts +++ b/extensions/feishu/src/reply-dispatcher.test.ts @@ -604,6 +604,28 @@ describe("createFeishuReplyDispatcher streaming behavior", () => { expect(streamingInstances).toHaveLength(1); }); + it("respects blockStreamingDefault: on from agents config", async () => { + const result = createFeishuReplyDispatcher({ + cfg: { agents: { defaults: { blockStreamingDefault: "on" } } } as never, + agentId: "agent", + runtime: createRuntimeLogger(), + chatId: "oc_chat", + }); + + expect(result.replyOptions.disableBlockStreaming).toBe(false); + }); + + it("disables block streaming by default when blockStreamingDefault is not set", async () => { + const result = createFeishuReplyDispatcher({ + cfg: { agents: { defaults: {} } } as never, + agentId: "agent", + runtime: createRuntimeLogger(), + chatId: "oc_chat", + }); + + expect(result.replyOptions.disableBlockStreaming).toBe(true); + }); + it("passes replyToMessageId and replyInThread to streaming.start()", async () => { const { options } = createDispatcherHarness({ runtime: createRuntimeLogger(), diff --git a/extensions/feishu/src/reply-dispatcher.ts b/extensions/feishu/src/reply-dispatcher.ts index 6ab7184c8e8..930ee50e094 100644 --- a/extensions/feishu/src/reply-dispatcher.ts +++ b/extensions/feishu/src/reply-dispatcher.ts @@ -479,7 +479,7 @@ export function createFeishuReplyDispatcher(params: CreateFeishuReplyDispatcherP replyOptions: { ...replyOptions, onModelSelected: prefixContext.onModelSelected, - disableBlockStreaming: true, + disableBlockStreaming: cfg.agents?.defaults?.blockStreamingDefault !== "on", onPartialReply: streamingEnabled ? (payload: ReplyPayload) => { if (!payload.text) {