fix(discord): add batched reply mode

This commit is contained in:
Peter Steinberger
2026-04-05 20:55:26 +01:00
parent 8206328a94
commit 6b627d4707
47 changed files with 300 additions and 56 deletions

View File

@@ -85,7 +85,7 @@ export const MatrixConfigSchema = z.object({
contextVisibility: ContextVisibilityModeSchema.optional(),
blockStreaming: z.boolean().optional(),
streaming: z.union([z.enum(["partial", "off"]), z.boolean()]).optional(),
replyToMode: z.enum(["off", "first", "all"]).optional(),
replyToMode: z.enum(["off", "first", "all", "batched"]).optional(),
threadReplies: z.enum(["off", "inbound", "always"]).optional(),
textChunkLimit: z.number().optional(),
chunkMode: z.enum(["length", "newline"]).optional(),

View File

@@ -1986,7 +1986,7 @@ describe("matrix monitor handler draft streaming", () => {
};
function createStreamingHarness(opts?: {
replyToMode?: "off" | "first" | "all";
replyToMode?: "off" | "first" | "all" | "batched";
blockStreamingEnabled?: boolean;
}) {
let capturedDeliver: DeliverFn | undefined;

View File

@@ -35,7 +35,7 @@ export async function deliverMatrixReplies(params: {
client: MatrixClient;
runtime: RuntimeEnv;
textLimit: number;
replyToMode: "off" | "first" | "all";
replyToMode: "off" | "first" | "all" | "batched";
threadId?: string;
accountId?: string;
mediaLocalRoots?: readonly string[];

View File

@@ -7,7 +7,7 @@ import type {
} from "./runtime-api.js";
export type { ContextVisibilityMode, DmPolicy, GroupPolicy };
export type ReplyToMode = "off" | "first" | "all";
export type ReplyToMode = "off" | "first" | "all" | "batched";
export type MatrixDmConfig = {
/** If false, ignore all incoming Matrix DMs. Default: true. */