test: fix cron and binding stability

This commit is contained in:
Peter Steinberger
2026-04-11 02:09:43 +01:00
parent 70cfdc890b
commit 60b61288c4
4 changed files with 8 additions and 4 deletions

View File

@@ -1,5 +1,8 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { getSessionBindingService } from "openclaw/plugin-sdk/conversation-runtime";
import {
__testing as sessionBindingTesting,
getSessionBindingService,
} from "openclaw/plugin-sdk/conversation-runtime";
import { beforeEach, describe, expect, it } from "vitest";
import { __testing, createBlueBubblesConversationBindingManager } from "./conversation-bindings.js";
@@ -9,6 +12,7 @@ const baseCfg = {
describe("BlueBubbles conversation bindings", () => {
beforeEach(() => {
sessionBindingTesting.resetSessionBindingAdaptersForTests();
__testing.resetBlueBubblesConversationBindingsForTests();
});

View File

@@ -28,7 +28,7 @@ export const DeliveryThreadIdFieldSchema = z.union([
export const TimeoutSecondsFieldSchema = z
.number()
.finite()
.transform((value) => Math.max(0, Math.floor(value)));
.transform((value) => Math.max(0, value));
export type ParsedDeliveryInput = {
mode?: "announce" | "none" | "webhook";

View File

@@ -1301,7 +1301,7 @@ export async function executeJob(
} & CronRunOutcome &
CronRunTelemetry;
try {
coreResult = await executeJobCore(state, job);
coreResult = await executeJobCoreWithTimeout(state, job);
} catch (err) {
coreResult = { status: "error", error: String(err) };
}

View File

@@ -9,7 +9,7 @@ function cronAgentTurnPayloadSchema(params: { message: TSchema; toolsAllow: TSch
model: Type.Optional(Type.String()),
fallbacks: Type.Optional(Type.Array(Type.String())),
thinking: Type.Optional(Type.String()),
timeoutSeconds: Type.Optional(Type.Integer({ minimum: 0 })),
timeoutSeconds: Type.Optional(Type.Number({ minimum: 0 })),
allowUnsafeExternalContent: Type.Optional(Type.Boolean()),
lightContext: Type.Optional(Type.Boolean()),
toolsAllow: Type.Optional(params.toolsAllow),