mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-29 10:02:04 +00:00
test: fix cron and binding stability
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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) };
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user