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:
parent
f187c38810
commit
bed758da83
@ -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(),
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user