Improve PDF and Office translation robustness#4
Merged
Conversation
…ashboard-docs # Conflicts: # src/doc_agent/docx_delivery.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR brings the current local DocHarbor translation robustness work into a reviewable branch.
Root Cause / Impact
Several production-like files exposed two weak spots: digital-text PDFs were still falling back to the scan/MinerU path when the external inspector was unavailable, and small tightly-cropped Office image snippets with source-language text were skipped by OCR. The changes keep the existing conservative paths but add safer fallbacks and better logs so the translation agent can continue without silently skipping important content.
Validation
python -m pytest tests/test_image_text_gate.py tests/test_image_translation_workflow.py tests/test_pdf_gate.py tests/test_office_delivery.py::test_run_office_delivery_translations_impl_routes_pdf tests/test_office_delivery.py::test_run_office_delivery_translations_impl_routes_digital_pdf_through_acrobat_bridge tests/test_office_delivery.py::test_run_office_delivery_translations_impl_falls_back_when_acrobat_bridge_fails tests/test_pdf_delivery.py::test_translate_pdf_document_translates_output_file_title tests/test_providers.py::test_anthropic_provider_supports_translation_thinking_effort tests/test_providers.py::test_anthropic_provider_does_not_mix_thinking_into_text -q-> 34 passedmain:python -m pytest tests/test_docx_delivery.py tests/test_image_text_gate.py tests/test_image_translation_workflow.py tests/test_pdf_gate.py tests/test_office_delivery.py::test_run_office_delivery_translations_impl_routes_digital_pdf_through_acrobat_bridge tests/test_pdf_delivery.py::test_translate_pdf_document_translates_output_file_title tests/test_providers.py::test_anthropic_provider_does_not_mix_thinking_into_text -q-> 37 passedNotes
Two unrelated local script edits remain unstaged locally and are not part of this PR.