Skip to content

Conversation

@Teagan42
Copy link
Contributor

What

  • add HTTP error handling to IMDb/TMDb lookups
  • batch Qdrant upserts with logging
  • test upsert batching and HTTP failure paths

Why

  • large media loads previously failed on a single network error
  • batching ensures progress even when a request fails

Affects

  • loader
  • tests

Testing

  • uv run ruff check .
  • uv run pytest

Documentation

  • added architecture note in AGENTS.md

https://chatgpt.com/codex/tasks/task_e_68c69412e424832897f8f440cc3a2aeb

Copilot AI review requested due to automatic review settings September 14, 2025 10:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the robustness of the media loading system by adding HTTP error handling for external API calls and implementing batched Qdrant upserts with proper error recovery. The changes ensure that large media loads can continue even when individual network requests fail.

  • Wraps all external API calls (IMDb and TMDb) in try-catch blocks to handle HTTP errors gracefully
  • Replaces single large Qdrant upserts with batched processing that logs failures but continues processing
  • Adds comprehensive test coverage for both HTTP error scenarios and batch processing

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
mcp_plex/loader.py Added HTTP error handling to API fetch functions and implemented batched Qdrant upserts
tests/test_loader_unit.py Added unit tests for HTTP error handling and batch upsert error scenarios
tests/test_loader_integration.py Enhanced integration tests to verify batching behavior
pyproject.toml Version bump to 0.26.25
AGENTS.md Updated architecture documentation to describe batching strategy

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link

Coverage

Coverage Report
FileStmtsMissCoverMissing
mcp_plex
   loader.py3862494%95, 124–128, 130–139, 150, 152–154, 190, 592–594
   server.py2982293%59–60, 102–103, 226, 454, 458, 480–486, 518, 528, 559–560, 577–578, 601, 604–605, 663
TOTAL8654695% 

Tests Skipped Failures Errors Time
59 0 💤 0 ❌ 0 🔥 33.688s ⏱️

@Teagan42 Teagan42 merged commit c7afd12 into main Sep 14, 2025
4 checks passed
@Teagan42 Teagan42 deleted the codex/handle-http-connection-errors-in-loader branch September 14, 2025 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants