mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:40:44 +00:00
fix(ci): keep video live helper within plugin boundary
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { resolveLiveVideoSkipReason } from "./live-video-skip-reason.js";
|
||||
|
||||
describe("resolveLiveVideoSkipReason", () => {
|
||||
it("classifies provider policy moderation blocks as skip-worthy drift", () => {
|
||||
expect(resolveLiveVideoSkipReason("Your request was blocked by our moderation system.")).toBe(
|
||||
"provider policy drift",
|
||||
);
|
||||
});
|
||||
|
||||
it("does not hide ordinary provider failures", () => {
|
||||
expect(resolveLiveVideoSkipReason("video generation returned an empty asset")).toBeNull();
|
||||
});
|
||||
});
|
||||
@@ -1,44 +0,0 @@
|
||||
import {
|
||||
isAuthErrorMessage,
|
||||
isBillingErrorMessage,
|
||||
isModelNotFoundErrorMessage,
|
||||
isOverloadedErrorMessage,
|
||||
isServerErrorMessage,
|
||||
isTimeoutErrorMessage,
|
||||
} from "openclaw/plugin-sdk/test-env";
|
||||
|
||||
export function resolveLiveVideoSkipReason(message: string): string | null {
|
||||
if (isAuthErrorMessage(message)) {
|
||||
return "auth drift";
|
||||
}
|
||||
if (isModelNotFoundErrorMessage(message)) {
|
||||
return "model drift";
|
||||
}
|
||||
if (isBillingErrorMessage(message)) {
|
||||
return "billing drift";
|
||||
}
|
||||
if (
|
||||
isTimeoutErrorMessage(message) ||
|
||||
/did not finish in time/i.test(message) ||
|
||||
/last status:\s*in_progress/i.test(message)
|
||||
) {
|
||||
return "provider timeout";
|
||||
}
|
||||
if (isOverloadedErrorMessage(message) || isServerErrorMessage(message)) {
|
||||
return "provider outage";
|
||||
}
|
||||
if (
|
||||
/HTTP\s+404/i.test(message) &&
|
||||
/Invalid URL/i.test(message) &&
|
||||
/\/platform\/video_gen/i.test(message)
|
||||
) {
|
||||
return "provider endpoint drift";
|
||||
}
|
||||
if (/access denied|not authorized|not enabled|permission denied/i.test(message)) {
|
||||
return "provider/model drift";
|
||||
}
|
||||
if (/blocked by (?:our )?moderation system|content policy|policy violation/i.test(message)) {
|
||||
return "provider policy drift";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user