mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-06 15:18:58 +00:00
test(ci): fix msteams and heartbeat red lanes
This commit is contained in:
@@ -39,6 +39,8 @@ export function installMSTeamsTestRuntime(options: MSTeamsTestRuntimeOptions = {
|
||||
},
|
||||
text: {
|
||||
hasControlCommand: () => false,
|
||||
resolveChunkMode: () => "length",
|
||||
resolveMarkdownTableMode: () => "code",
|
||||
...(options.resolveTextChunkLimit
|
||||
? { resolveTextChunkLimit: options.resolveTextChunkLimit }
|
||||
: {}),
|
||||
@@ -53,8 +55,14 @@ export function installMSTeamsTestRuntime(options: MSTeamsTestRuntimeOptions = {
|
||||
})),
|
||||
},
|
||||
reply: {
|
||||
createReplyDispatcherWithTyping: () => ({
|
||||
dispatcher: {},
|
||||
replyOptions: {},
|
||||
markDispatchIdle: vi.fn(),
|
||||
}),
|
||||
formatAgentEnvelope: ({ body }: { body: string }) => body,
|
||||
finalizeInboundContext: <T extends Record<string, unknown>>(ctx: T) => ctx,
|
||||
resolveHumanDelayConfig: () => undefined,
|
||||
},
|
||||
session: {
|
||||
recordInboundSession: options.recordInboundSession ?? vi.fn(async () => undefined),
|
||||
|
||||
@@ -2,8 +2,8 @@ import { describe, expect, it, vi } from "vitest";
|
||||
import type { OpenClawConfig } from "../../runtime-api.js";
|
||||
import type { GraphThreadMessage } from "../graph-thread.js";
|
||||
import { _resetThreadParentContextCachesForTest } from "../thread-parent-context.js";
|
||||
import { getRuntimeApiMockState } from "./message-handler-mock-support.test-support.js";
|
||||
import { createMSTeamsMessageHandler } from "./message-handler.js";
|
||||
import { getRuntimeApiMockState } from "./message-handler.mock-support.js";
|
||||
import { createMessageHandlerDeps } from "./message-handler.test-support.js";
|
||||
|
||||
type HandlerInput = Parameters<ReturnType<typeof createMSTeamsMessageHandler>>[0];
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { OpenClawConfig } from "../../runtime-api.js";
|
||||
import { _resetThreadParentContextCachesForTest } from "../thread-parent-context.js";
|
||||
import { getRuntimeApiMockState } from "./message-handler-mock-support.test-support.js";
|
||||
import { createMSTeamsMessageHandler } from "./message-handler.js";
|
||||
import { getRuntimeApiMockState } from "./message-handler.mock-support.js";
|
||||
import {
|
||||
buildChannelActivity,
|
||||
channelConversationId,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import type { OpenClawConfig } from "../../runtime-api.js";
|
||||
import "./message-handler.mock-support.js";
|
||||
import "./message-handler-mock-support.test-support.js";
|
||||
import { createMSTeamsMessageHandler } from "./message-handler.js";
|
||||
import {
|
||||
buildChannelActivity,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type {
|
||||
ChannelId,
|
||||
ChannelMessagingAdapter,
|
||||
ChannelOutboundAdapter,
|
||||
ChannelPlugin,
|
||||
} from "../../../src/channels/plugins/types.js";
|
||||
@@ -52,6 +53,7 @@ function createHeartbeatChannelPlugin(params: {
|
||||
label: string;
|
||||
docsPath: string;
|
||||
heartbeat?: ChannelPlugin["heartbeat"];
|
||||
messaging?: ChannelMessagingAdapter;
|
||||
}): ChannelPlugin {
|
||||
return {
|
||||
...createOutboundTestPlugin({
|
||||
@@ -59,6 +61,7 @@ function createHeartbeatChannelPlugin(params: {
|
||||
label: params.label,
|
||||
docsPath: params.docsPath,
|
||||
outbound: createHeartbeatOutboundAdapter(params.id),
|
||||
...(params.messaging ? { messaging: params.messaging } : {}),
|
||||
}),
|
||||
...(params.heartbeat ? { heartbeat: params.heartbeat } : {}),
|
||||
};
|
||||
@@ -74,6 +77,9 @@ export const heartbeatRunnerTelegramPlugin = createHeartbeatChannelPlugin({
|
||||
id: "telegram",
|
||||
label: "Telegram",
|
||||
docsPath: "/channels/telegram",
|
||||
messaging: {
|
||||
preserveHeartbeatThreadIdForGroupRoute: true,
|
||||
},
|
||||
});
|
||||
|
||||
export const heartbeatRunnerWhatsAppPlugin = createHeartbeatChannelPlugin({
|
||||
|
||||
Reference in New Issue
Block a user