{"record":{"id":"46fc02a9a13738c7","repo":"HKUDS/DeepTutor","slug":"animation-generation-failed-exc","errorCode":null,"errorMessage":"animation generation failed: {exc}","messagePattern":"animation generation failed: (.+?)","errorType":"exception","errorClass":"GenerationFailure","httpStatus":null,"severity":"error","filePath":"deeptutor/book/blocks/animation.py","lineNumber":100,"sourceCode":"                style_hint=style_hint,\n            )\n            pipeline = MathAnimatorPipeline(\n                api_key=primary_api_key(llm_config.api_key),\n                base_url=llm_config.base_url,\n                api_version=llm_config.api_version,\n                language=ctx.language,\n            )\n            turn_id = f\"book-{ctx.book_id}-{ctx.block.id}\"\n            result = await pipeline.run(\n                turn_id=turn_id,\n                user_input=user_input,\n                history_context=history_context,\n                request_config=request_config,\n                attachments=[],\n            )\n        except Exception as exc:\n            logger.warning(f\"AnimationGenerator failed: {exc}\", exc_info=True)\n            raise GenerationFailure(f\"animation generation failed: {exc}\") from exc\n\n        render_result = result[\"render_result\"]\n        summary_payload = result[\"summary\"]\n        analysis = result[\"analysis\"]\n        artifacts = [artifact.model_dump() for artifact in render_result.artifacts]\n        primary = next(\n            (\n                a\n                for a in artifacts\n                if a.get(\"type\") == \"video\" or \"video\" in (a.get(\"content_type\") or \"\")\n            ),\n            artifacts[0] if artifacts else None,\n        )\n\n        return (\n            {\n                \"render_type\": \"video\",\n                \"artifacts\": artifacts,","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/book/blocks/animation.py#L82-L118","documentation":"The animation block delegated to the math_animator pipeline and the pipeline raised an arbitrary exception; `_generate` wraps it in `GenerationFailure('animation generation failed: ...')` so the book compiler's retry/fallback machinery can handle it uniformly.","triggerScenarios":"Any failure inside the `math_animator` capability invoked from the animation block: LLM producing unrunnable Manim code, render-time errors, timeouts, or missing config — all surface here chained from the original exception.","commonSituations":"Flaky LLM output for Manim scripts; sandbox or LaTeX/font prerequisites missing for manim rendering; API rate limits during code_retry stages; overly complex animation requests.","solutions":["Read the chained cause (`__cause__`) and the logged warning traceback to find the real failure","Retry the block — compiler retry paths often succeed on transient LLM failures","Simplify the animation request (shorter concept, fewer scenes)","Ensure math-animator runtime prerequisites (LaTeX, ffmpeg, fonts) are installed"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"from deeptutor.book.compiler import GenerationFailure\nfor attempt in range(2):\n    try:\n        payload, anchors, meta = await anim_gen._generate(ctx)\n        break\n    except GenerationFailure as e:\n        if attempt == 1 or \"math-animator extras\" in str(e):\n            raise\n        logger.warning(\"retrying animation block: %s\", e)","preventionTips":["Keep animation requests small and focused","Ensure manim runtime prerequisites (LaTeX, ffmpeg) are installed","Log the chained __cause__ to diagnose the underlying pipeline failure"],"tags":["manim","generation","retry","llm-output"],"backgroundTag":"llm-generation-failed","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}