openclaw/openclaw · warning · Error
BytePlus video status response returned unknown task status:
Error message
BytePlus video status response returned unknown task status: ${status} What it means
Thrown by readBytePlusTaskStatus when payload.status is a recognized string type but does not match any of running/failed/queued/succeeded/cancelled. The switch default catches novel or malformed status values so the runtime does not silently misinterpret them.
Source
Thrown at extensions/byteplus/video-generation-provider.ts:85
if (!isRecord(payload)) {
throw new Error(`${label}: malformed JSON response`);
}
return payload as T;
}
function readBytePlusTaskStatus(payload: BytePlusTaskResponse): BytePlusTaskStatus {
const status = normalizeOptionalString(payload.status);
switch (status) {
case "running":
case "failed":
case "queued":
case "succeeded":
case "cancelled":
return status;
case undefined:
throw new Error("BytePlus video status response missing task status");
default:
throw new Error(`BytePlus video status response returned unknown task status: ${status}`);
}
}
function readBytePlusErrorMessage(error: unknown): string | undefined {
return isRecord(error) ? normalizeOptionalString(error.message) : undefined;
}
function readBytePlusVideoUrl(payload: BytePlusTaskResponse): string {
const content = payload.content;
if (content !== undefined && !isRecord(content)) {
throw new Error("BytePlus video generation completed with malformed content");
}
const videoUrl = normalizeOptionalString(content?.video_url);
if (!videoUrl) {
throw new Error("BytePlus video generation completed without a video URL");
}
return videoUrl;
}View on GitHub (pinned to 01804a7531)
Solutions
- Log the unknown status value to determine what BytePlus returned.
- Update readBytePlusTaskStatus to handle the new status if it is a legitimate addition.
- Normalize status to lowercase/trimmed before comparison if casing is the issue.
- Report the case if it indicates an API contract change requiring a provider update.
Example fix
// before
const status = normalizeOptionalString(payload.status);
// after - normalize casing/whitespace before matching
const status = normalizeOptionalString(payload.status)?.trim().toLowerCase();
if (status && !KNOWN_STATUSES.has(status)) {
reportUnknownBytePlusStatus(status);
} Defensive patterns
Strategy: try-catch
Validate before calling
const KNOWN_BYTEPLUS_STATUSES = new Set(['running', 'failed', 'queued', 'succeeded', 'cancelled']);
function isKnownBytePlusStatus(payload: unknown): boolean {
const status = isRecord(payload) ? normalizeOptionalString(payload.status) : undefined;
return typeof status === 'string' && KNOWN_BYTEPLUS_STATUSES.has(status);
} Type guard
function isKnownBytePlusStatus(value: string): boolean {
return new Set(['running', 'failed', 'queued', 'succeeded', 'cancelled']).has(value);
} Try / catch
try {
const status = readBytePlusTaskStatus(payload);
} catch (error) {
if (/unknown task status/.test(String(error))) {
// log and report; possibly a new status from BytePlus
reportUnknownBytePlusStatus(payload.status);
throw error;
}
throw error;
} Prevention
- Normalize status strings (trim/lowercase) before comparison.
- Subscribe to BytePlus API changelogs for new lifecycle states.
- Log unknown statuses so provider updates can be issued promptly.
When it happens
Trigger: BytePlus introducing a new status string (e.g. 'paused', 'pending'), returning an uppercase variant, or a typo/whitespace in the status value.
Common situations: BytePlus API update adding a new lifecycle status, case-sensitivity mismatch, or an unexpected locale-specific value.
Related errors
- ${label}: malformed JSON response
- BytePlus video status response missing task status
- BytePlus video generation completed with malformed content
- BytePlus video generation completed without a video URL
- BytePlus reference image is missing image data.
AI-assisted analysis of openclaw/openclaw@01804a7531 (2026-08-12).
Data as JSON: /api/errors/c4d3993aa6ec3b1c.
Report an issue: GitHub.