fix(feishu): honor blockStreamingDefault config instead of hardcoding disable

Feishu was hardcoding disableBlockStreaming: true, ignoring the user's
agents.defaults.blockStreamingDefault setting. Now respects the config:

- blockStreamingDefault: "on" -> disableBlockStreaming: false
- blockStreamingDefault: "off" or unset -> disableBlockStreaming: true

Fixes #51117.
This commit is contained in:
Simple 2026-03-21 00:04:36 +08:00
parent f187c38810
commit bed758da83
2 changed files with 23 additions and 1 deletions

View File

@ -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(),

View File

@ -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) {