calesthio/OpenMontage · error · Error

${res.status} ${url}

Error message

${res.status} ${url}

What it means

Thrown by SeedanceArkTool._normalize_duration when the duration input is a Python bool. Because bool is a subclass of int in Python, the tool explicitly rejects True/False before the int conversion, treating a boolean as an invalid duration type. Valid inputs are the string "auto" (mapped to -1), -1, or an integer from 4 to max_seconds (default 15).

Source

Thrown at backlot/ui/lib.js:5

// Shared helpers for the Backlot UI.

export async function getJSON(url) {
  const res = await fetch(url);
  if (!res.ok) throw new Error(`${res.status} ${url}`);
  return res.json();
}

export function el(tag, attrs = {}, ...children) {
  const node = document.createElement(tag);
  for (const [k, v] of Object.entries(attrs)) {
    if (v == null) continue;
    if (k === "class") node.className = v;
    else if (k.startsWith("on")) node.addEventListener(k.slice(2), v);
    else node.setAttribute(k, v);
  }
  for (const child of children.flat()) {
    if (child == null) continue;
    node.append(child.nodeType ? child : document.createTextNode(String(child)));
  }
  return node;
}

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Pass an integer between 4 and 15, or -1, or the string "auto" for duration.
  2. If the value comes from user input or an LLM, sanitize booleans to None before the call and let the default apply.
  3. Check the code path that produces the duration argument for a boolean-returning expression (e.g. `duration: use_default` style flags).

Example fix

// before
{"duration": true}
// after
{"duration": "auto"}
Defensive patterns

Strategy: type-guard

Validate before calling

def ok_duration(v):
    return v == "auto" or v == -1 or (isinstance(v, int) and not isinstance(v, bool) and 4 <= v <= 15)

Type guard

def is_valid_duration(v) -> bool:
    if isinstance(v, bool):
        return False
    if v == "auto" or v == -1:
        return True
    return isinstance(v, int) and 4 <= v <= 15 or (isinstance(v, str) and v.strip().lstrip('-').isdigit() and (int(v) == -1 or 4 <= int(v) <= 15))

Try / catch

try:
    result = tool.run(inputs)
except ValueError as e:
    if "duration must be" in str(e):
        inputs["duration"] = "auto"
        result = tool.run(inputs)
    else:
        raise

Prevention

When it happens

Trigger: Calling the seedance_ark tool with duration=true or duration=false (e.g. from JSON tool input where a toggle/flag value was wired into the duration field, or a template variable that evaluates to a boolean).

Common situations: LLM tool-call arguments generated with a boolean where a number was intended; config files reusing a feature-flag key as duration; YAML/JSON coercion turning 'on'/'off' into true/false.

Related errors


AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15). Data as JSON: /api/errors/43d495acf6c19c67. Report an issue: GitHub.