{"record":{"id":"6ae7b42a595586e4","repo":"calesthio/OpenMontage","slug":"artifact-artifact-name-r-failed-schema-validatio","errorCode":null,"errorMessage":"Artifact {artifact_name!r} failed schema validation: {exc}","messagePattern":"Artifact (.+?) failed schema validation: (.+?)","errorType":"validation","errorClass":"CheckpointValidationError","httpStatus":null,"severity":"error","filePath":"lib/checkpoint.py","lineNumber":155,"sourceCode":"        and status in {\"completed\", \"awaiting_human\"}\n        and required_artifact not in artifacts\n    ):\n        raise CheckpointValidationError(\n            f\"Stage {stage!r} with status {status!r} must include \"\n            f\"canonical artifact {required_artifact!r}\"\n        )\n\n    for artifact_name, artifact_data in artifacts.items():\n        if artifact_name not in ARTIFACT_NAMES:\n            continue\n        if not isinstance(artifact_data, dict):\n            raise CheckpointValidationError(\n                f\"Artifact {artifact_name!r} must be a JSON object matching its schema\"\n            )\n        try:\n            validate_artifact(artifact_name, artifact_data)\n        except Exception as exc:\n            raise CheckpointValidationError(\n                f\"Artifact {artifact_name!r} failed schema validation: {exc}\"\n            ) from exc\n\n\ndef validate_checkpoint(checkpoint: dict[str, Any]) -> None:\n    \"\"\"Validate checkpoint structure and canonical artifact payloads.\n\n    Uses pipeline_type (if present) to resolve the valid stage list.\n    Falls back to ALL_KNOWN_STAGES when pipeline_type is absent.\n    \"\"\"\n    stage = checkpoint.get(\"stage\")\n    status = checkpoint.get(\"status\")\n    artifacts = checkpoint.get(\"artifacts\")\n    pipeline_type = checkpoint.get(\"pipeline_type\")\n\n    valid_stages = (\n        set(get_pipeline_stages(pipeline_type)) if pipeline_type\n        else ALL_KNOWN_STAGES","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/lib/checkpoint.py#L137-L173","documentation":"The base64 payload decoded successfully but the decoded byte count is >= max_bytes, so the tool refuses to inline it. This mirrors the local-file size cap but measures the actual decoded media size rather than the file on disk (base64 inflates ~33%, so both checks use the decoded size consistently).","triggerScenarios":"Inlining a 20MB WAV as a data:audio URI; a data URI for a large TIFF/PNG photo exceeding the MB cap shown in the message.","commonSituations":"Client-side previews exported as lossless PNG data URIs; uncompressed audio pasted inline; treating data URIs as a way to dodge the local-file size check (they are not — decoded size is checked).","solutions":["Compress the media (JPEG q85, AAC/MP3 audio) before base64-encoding.","Host the asset at a public https URL and pass the URL instead of a data URI.","Split very long audio references into separate <=15s clips within the size cap."],"exampleFix":"# before\nref = \"data:audio/wav;base64,\" + b64(wav_20mb)\n# after\n# run: ffmpeg -i in.wav -b:a 128k in.mp3\nref = \"https://cdn.example.com/in.mp3\"","handlingStrategy":"validation","validationCode":"import base64\nsize = len(base64.b64decode(payload, validate=True))\nassert size < MAX_BYTES, f\"decoded {size} bytes exceeds cap\"","typeGuard":null,"tryCatchPattern":"try:\n    tool.run(inputs)\nexcept ValueError as e:\n    if \"must be smaller than\" in str(e):\n        switch_to_https_url(ref)  # host the asset, pass URL, retry\n    else:\n        raise","preventionTips":["Compress media before inlining; lossless formats blow past byte caps quickly.","Prefer URL references for anything above a few MB."],"tags":["python","validation","file-size","data-uri","base64","seedance"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}