@@ -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" ;
3844import { describe , expect , it } from "vitest" ;
39- import { resolveLiveVideoSkipReason } from "../test/helpers/media-generation/live-video-skip-reason.js" ;
4045import alibabaPlugin from "./alibaba/index.js" ;
4146import byteplusPlugin from "./byteplus/index.js" ;
4247import 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+ / d i d n o t f i n i s h i n t i m e / i. test ( message ) ||
246+ / l a s t s t a t u s : \s * i n _ p r o g r e s s / i. test ( message )
247+ ) {
248+ return "provider timeout" ;
249+ }
250+ if ( isOverloadedErrorMessage ( message ) || isServerErrorMessage ( message ) ) {
251+ return "provider outage" ;
252+ }
253+ if (
254+ / H T T P \s + 4 0 4 / i. test ( message ) &&
255+ / I n v a l i d U R L / i. test ( message ) &&
256+ / \/ p l a t f o r m \/ v i d e o _ g e n / i. test ( message )
257+ ) {
258+ return "provider endpoint drift" ;
259+ }
260+ if ( / a c c e s s d e n i e d | n o t a u t h o r i z e d | n o t e n a b l e d | p e r m i s s i o n d e n i e d / i. test ( message ) ) {
261+ return "provider/model drift" ;
262+ }
263+ if ( / b l o c k e d b y (?: o u r ) ? m o d e r a t i o n s y s t e m | c o n t e n t p o l i c y | p o l i c y v i o l a t i o n / i. test ( message ) ) {
264+ return "provider policy drift" ;
265+ }
266+ return null ;
267+ }
268+
228269async function runLiveVideoAttempt ( params : {
229270 authLabel : string ;
230271 attempted : string [ ] ;
0 commit comments