Skip to content

Commit ef58307

Browse files
committed
fix(ci): keep video live helper within plugin boundary
1 parent b04c938 commit ef58307

3 files changed

Lines changed: 42 additions & 59 deletions

File tree

extensions/video-generation-providers.live.test.ts

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@ import {
1616
encodePngRgba,
1717
fillPixel,
1818
getShellEnvAppliedKeys,
19+
isAuthErrorMessage,
20+
isBillingErrorMessage,
1921
isLiveProfileKeyModeEnabled,
2022
isLiveTestEnabled,
23+
isModelNotFoundErrorMessage,
24+
isOverloadedErrorMessage,
25+
isServerErrorMessage,
26+
isTimeoutErrorMessage,
2127
isTruthyEnvValue,
2228
normalizeVideoGenerationDuration,
2329
parseCsvFilter,
@@ -36,7 +42,6 @@ import type {
3642
VideoGenerationRequest,
3743
} from "openclaw/plugin-sdk/test-env";
3844
import { describe, expect, it } from "vitest";
39-
import { resolveLiveVideoSkipReason } from "../test/helpers/media-generation/live-video-skip-reason.js";
4045
import alibabaPlugin from "./alibaba/index.js";
4146
import byteplusPlugin from "./byteplus/index.js";
4247
import deepinfraPlugin from "./deepinfra/index.js";
@@ -225,6 +230,42 @@ function buildLiveCapabilityOverrides(params: {
225230
};
226231
}
227232

233+
function resolveLiveVideoSkipReason(message: string): string | null {
234+
if (isAuthErrorMessage(message)) {
235+
return "auth drift";
236+
}
237+
if (isModelNotFoundErrorMessage(message)) {
238+
return "model drift";
239+
}
240+
if (isBillingErrorMessage(message)) {
241+
return "billing drift";
242+
}
243+
if (
244+
isTimeoutErrorMessage(message) ||
245+
/did not finish in time/i.test(message) ||
246+
/last status:\s*in_progress/i.test(message)
247+
) {
248+
return "provider timeout";
249+
}
250+
if (isOverloadedErrorMessage(message) || isServerErrorMessage(message)) {
251+
return "provider outage";
252+
}
253+
if (
254+
/HTTP\s+404/i.test(message) &&
255+
/Invalid URL/i.test(message) &&
256+
/\/platform\/video_gen/i.test(message)
257+
) {
258+
return "provider endpoint drift";
259+
}
260+
if (/access denied|not authorized|not enabled|permission denied/i.test(message)) {
261+
return "provider/model drift";
262+
}
263+
if (/blocked by (?:our )?moderation system|content policy|policy violation/i.test(message)) {
264+
return "provider policy drift";
265+
}
266+
return null;
267+
}
268+
228269
async function runLiveVideoAttempt(params: {
229270
authLabel: string;
230271
attempted: string[];

test/helpers/media-generation/live-video-skip-reason.test.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

test/helpers/media-generation/live-video-skip-reason.ts

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)