{"record":{"id":"8faa84cb6a8a6eb1","repo":"HKUDS/DeepTutor","slug":"visual-quality-review-timed-out-after-int-self-re","errorCode":null,"errorMessage":"Visual quality review timed out after {int(self.review_timeout_seconds)}s.","messagePattern":"Visual quality review timed out after (.+?)s\\.","errorType":"exception","errorClass":"ManimRenderError","httpStatus":null,"severity":"error","filePath":"deeptutor/agents/math_animator/retry_manager.py","lineNumber":75,"sourceCode":"                        f\"Starting render attempt {attempt + 1}/{self.max_retries + 1}.\"\n                    )\n                render_result = await self.renderer.render(\n                    code=code,\n                    output_mode=output_mode,\n                    quality=quality,\n                )\n                if self.review_callback is not None:\n                    if self.on_status is not None:\n                        await self.on_status(\n                            \"Reviewing rendered visuals for overlap, readability, and framing.\"\n                        )\n                    try:\n                        review_result = await asyncio.wait_for(\n                            self.review_callback(code, render_result),\n                            timeout=self.review_timeout_seconds,\n                        )\n                    except asyncio.TimeoutError as timeout_exc:\n                        raise ManimRenderError(\n                            f\"Visual quality review timed out after {int(self.review_timeout_seconds)}s.\"\n                        ) from timeout_exc\n                    render_result.visual_review = review_result\n                    if not review_result.passed:\n                        if attempt >= self.max_retries:\n                            if self.on_status is not None:\n                                await self.on_status(\n                                    \"Visual review still found issues after all retries. Returning the best available result with a warning.\"\n                                )\n                            render_result.retry_attempts = len(retry_history)\n                            render_result.retry_history = retry_history\n                            return code, render_result\n                        retry_attempt = RetryAttempt(\n                            attempt=attempt + 1,\n                            error=(\n                                \"Visual review failed: \"\n                                + (\n                                    review_result.summary","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/agents/math_animator/retry_manager.py#L57-L93","documentation":"Raised by _open_ooxml when zipfile.ZipFile cannot parse the bytes as a ZIP archive (BadZipFile). This helper backs EPUB and all raw-OOXML fallback paths, so it fires when the package is not a zip at all despite its extension.","triggerScenarios":"Passing a .docx/.xlsx/.pptx/.epub whose bytes are actually plain binary, OLE2 (legacy .doc/.xls), or truncated; a fallback path invoked after the primary parser already failed on non-zip data.","commonSituations":"Renamed legacy Office files, mislabeled downloads, HTML error pages saved with document extensions.","solutions":["Verify magic bytes before extraction (the module's _check_magic should catch most; ensure callers use it)","Convert legacy formats to OOXML with LibreOffice","Re-download the authentic file if it's an HTML error page in disguise"],"exampleFix":"// before\ntext = _extract_docx_ooxml(data, \"notazip.docx\")  # raises\n\n// after\nif not data.startswith(b\"PK\"):\n    raise ValueError(\"not an OOXML package\")\ntext = _extract_docx_ooxml(data, \"ok.docx\")","handlingStrategy":"type-guard","validationCode":"def is_zip_package(data: bytes) -> bool:\n    return data[:2] == b\"PK\"","typeGuard":"def is_zip_package(data: bytes) -> bool:\n    return data[:2] == b\"PK\"","tryCatchPattern":"except CorruptDocumentError as e:\n    if \"failed to open Office ZIP package\" in str(e):\n        convert_legacy_format(fn) and retry","preventionTips":["Always magic-byte check before OOXML parsing","Never trust extensions alone; legacy renames are the top cause"],"tags":["ooxml","zip","badzipfile","document-extraction"],"backgroundTag":"not-a-zip-archive","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}