{"record":{"id":"344dc2482c6f56af","repo":"calesthio/OpenMontage","slug":"model-must-be-a-non-empty-ark-model-endpoint-id","errorCode":null,"errorMessage":"model must be a non-empty Ark Model/Endpoint ID","messagePattern":"model must be a non-empty Ark Model/Endpoint ID","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/video/seedance_ark.py","lineNumber":919,"sourceCode":"                payload[key] = inputs[key]\n        if inputs.get(\"web_search\"):\n            payload[\"tools\"] = [{\"type\": \"web_search\"}]\n\n        self._validate_optional_parameters(payload)\n        self._validate_request_size(payload)\n        return payload\n\n    def _resolve_model(self, inputs: dict[str, Any]) -> tuple[str, str | None]:\n        variant = str(inputs.get(\"model_variant\", \"standard\")).lower()\n        if variant not in self.MODEL_IDS:\n            raise ValueError(\"model_variant must be 2.5, standard, fast, or mini\")\n        model = str(\n            inputs.get(\"model\")\n            or os.environ.get(\"ARK_SEEDANCE_MODEL\")\n            or self.MODEL_IDS[variant]\n        )\n        if not model or any(char.isspace() for char in model):\n            raise ValueError(\"model must be a non-empty Ark Model/Endpoint ID\")\n        for known_variant, known_model in self.MODEL_IDS.items():\n            if model == known_model:\n                return model, known_variant\n        # Endpoint IDs and future model IDs can have account-specific pricing.\n        # Keep the caller's requested model, but never pretend its price is the\n        # public price of model_variant.\n        return model, None\n\n    @staticmethod\n    def _normalize_duration(value: Any, max_seconds: int = 15) -> int:\n        if value == \"auto\":\n            return -1\n        if isinstance(value, bool):\n            raise ValueError(\n                f\"duration must be an integer from 4 to {max_seconds} or -1\"\n            )\n        try:\n            duration = int(value)","sourceCodeStart":901,"sourceCodeEnd":937,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/seedance_ark.py#L901-L937","documentation":"Raised when the resolved model identifier is empty or contains whitespace. Resolution order is inputs['model'], then ARK_SEEDANCE_MODEL env var, then MODEL_IDS[variant]; an empty string, a 'default' placeholder that resolves to blank, or an endpoint ID with spaces/newlines all fail. Ark Model IDs and Endpoint IDs (e.g. 'ep-2024...') never contain whitespace.","triggerScenarios":"model set to '' or ' ', an ARK_SEEDANCE_MODEL env var containing a trailing newline or spaces, or a model string copied with a line break in the middle.","commonSituations":"Env var set via a script that appends a newline; copy-pasting an endpoint ID across lines; secrets managers returning padded values.","solutions":["Set model to the exact Ark Model ID or Endpoint ID with no surrounding spaces","Strip the ARK_SEEDANCE_MODEL env value: export ARK_SEEDANCE_MODEL=$(echo \"$ARK_SEEDANCE_MODEL\" | tr -d '[:space:]')","Omit model and model_variant-derived default is used"],"exampleFix":"# before: env contains \"seedance-1.0-pro\\n\"\ninputs = {\"model\": os.environ[\"ARK_SEEDANCE_MODEL\"]}\n\n# after\ninputs = {\"model\": os.environ[\"ARK_SEEDANCE_MODEL\"].strip()}  # or fix the env var","handlingStrategy":"validation","validationCode":"model = str(inputs.get(\"model\") or os.environ.get(\"ARK_SEEDANCE_MODEL\") or \"\").strip()\nassert model and not any(c.isspace() for c in model), \"model ID has whitespace or is empty\"","typeGuard":"def is_clean_model_id(model: str) -> bool:\n    return bool(model) and not any(c.isspace() for c in model)","tryCatchPattern":null,"preventionTips":["Strip env-derived IDs before use","Copy endpoint IDs as single tokens; never across line breaks"],"tags":["validation","seedance","ark","model-id","environment","config"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}