Lazy-load document conversion dependencies#19
Open
fortybyte wants to merge 1 commit intoVRSEN:mainfrom
Open
Conversation
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
Root Cause
ConvertDocumentimported WeasyPrint and other conversion stacks at module load. On systems missing WeasyPrint native libraries such as Pango, Agency Swarm skipped the conversion tool during startup. The same document tools also treated user-provided names as filesystem path components without rejecting path traversal patterns.Impact
The Docs Agent keeps non-PDF conversion capability even when PDF native dependencies are not installed, PDF failures are actionable, and document tools stay inside the managed
mnt/<project>/documentstree. Markdown and TXT exports avoid unnecessary render-time image processing.Validation
python3 -m pytest tests/test_convert_document_pdf_dependency.py -q-> 7 passedpython3 -m pytest -q-> 7 passedpython3 -m py_compile docs_agent/tools/ConvertDocument.py docs_agent/tools/CreateDocument.py docs_agent/tools/ModifyDocument.py docs_agent/tools/ViewDocument.py docs_agent/tools/RestoreDocument.py docs_agent/tools/utils/doc_file_utils.py tests/test_convert_document_pdf_dependency.pycreate_agency()startup smoke verified Docs Agent still registersConvertDocumentgit diff --check