Config: add support for per-provider blockStreaming override

This commit is contained in:
Jake
2026-01-09 11:57:43 +13:00
committed by Peter Steinberger
parent 91a6f721a3
commit a05916bee8
10 changed files with 68 additions and 5 deletions

View File

@@ -23,6 +23,7 @@ export type ResolvedWhatsAppAccount = {
groupPolicy?: GroupPolicy;
dmPolicy?: DmPolicy;
textChunkLimit?: number;
blockStreaming?: boolean;
groups?: WhatsAppAccountConfig["groups"];
};
@@ -119,6 +120,8 @@ export function resolveWhatsAppAccount(params: {
groupPolicy: accountCfg?.groupPolicy ?? params.cfg.whatsapp?.groupPolicy,
textChunkLimit:
accountCfg?.textChunkLimit ?? params.cfg.whatsapp?.textChunkLimit,
blockStreaming:
accountCfg?.blockStreaming ?? params.cfg.whatsapp?.blockStreaming,
groups: accountCfg?.groups ?? params.cfg.whatsapp?.groups,
};
}

View File

@@ -788,6 +788,7 @@ export async function monitorWebProvider(
groupAllowFrom: account.groupAllowFrom,
groupPolicy: account.groupPolicy,
textChunkLimit: account.textChunkLimit,
blockStreaming: account.blockStreaming,
groups: account.groups,
},
} satisfies ReturnType<typeof loadConfig>;
@@ -1276,7 +1277,13 @@ export async function monitorWebProvider(
cfg,
dispatcher,
replyResolver,
replyOptions,
replyOptions: {
...replyOptions,
disableBlockStreaming:
typeof cfg.whatsapp?.blockStreaming === "boolean"
? !cfg.whatsapp.blockStreaming
: undefined,
},
});
markDispatchIdle();
if (!queuedFinal) {