Repository navigation
fix: ImageConverter gracefully handles LLM API failures (fixes #1942) - #1948
Merged
Adam Fourney (afourney) merged 2 commits intoSep 3, 2026
Merged
Adam Fourney (afourney) merged 2 commits into
Adam Fourney (afourney) merged 2 commits into
Conversation
This was referenced Sep 3, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new failure-handling path needs regression test coverage.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Makes image conversion resilient to LLM API failures while preserving extracted metadata.
Changes:
- Catches LLM request/response exceptions.
- Skips unavailable image descriptions gracefully.
File summaries
| File | Description |
|---|---|
_image_converter.py |
Adds LLM failure handling. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+137
to
+140
| try: | ||
| response = client.chat.completions.create(model=model, messages=messages) | ||
| return response.choices[0].message.content | ||
| except Exception: |
This was referenced Sep 6, 2026
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
ImageConverter._get_llm_description()crashes the entire conversion pipeline when the LLM API call fails (auth error, rate limit, network timeout). The API call at_image_converter.py:137had no error handling.This fix wraps the API call in a try/except block, matching the pattern already used by
PptxConverter(lines 119-129). On failure, it returnsNoneand the converter gracefully skips the LLM description while still returning extracted metadata.Issue
Fixes #1942
Verification