Skip to content

Conversation

@Teagan42
Copy link
Contributor

@Teagan42 Teagan42 commented Oct 7, 2025

What

  • tighten loader runtime configuration typing by adding typed IMDb throttles and Qdrant payload definitions
  • update pipeline stages to rely on concrete protocols and forward-referenced Qdrant payloads while refining loader ingestion helpers
  • refresh enrichment-stage tests and loader agent guidance to cover the stricter typing contracts

Why

  • removing Any fallbacks and clarifying runtime protocols makes the staged loader easier to reason about and safer to extend

Affects

  • loader orchestration helpers, pipeline stages, and enrichment-stage tests

Testing

  • uv run pytest tests/test_enrichment_stage.py tests/test_loader_orchestrator.py tests/test_loader_integration.py

Documentation

  • updated mcp_plex/loader/AGENTS.md typing guidance

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

@github-actions
Copy link

github-actions bot commented Oct 7, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
mcp_plex/loader
   __init__.py4071896%84–91, 165, 255–260, 662, 777–779, 781, 867–886, 1251
   imdb_cache.py45296%64, 68
mcp_plex/loader/pipeline
   channels.py64297%134–135
   enrichment.py5167585%237, 259–265, 318, 323, 354, 356, 363, 367, 471, 492, 512, 520–522, 525–527, 530–532, 540–545, 553, 607–608, 632, 692–693, 709, 738, 745, 747, 751, 803, 821, 833, 862, 868, 871–879, 905, 908–910, 927–929, 949–952, 956, 970–976, 998, 1000, 1003–1005
   ingestion.py1551392%81, 130–150, 185, 222, 238, 331, 337, 357
   orchestrator.py95595%63, 141, 170, 193–194
   persistence.py130993%122, 164–165, 175, 186, 190–192, 245
mcp_plex/server
   __init__.py6453195%52–53, 133–134, 162, 231, 237–238, 304, 325–328, 345, 410, 413, 450, 468–469, 506, 1157, 1179–1185, 1221, 1239, 1244, 1262, 1386, 1423
   __main__.py440%3–8
   config.py48785%50, 52–55, 65, 76
TOTAL232416693% 

Tests Skipped Failures Errors Time
145 0 💤 0 ❌ 0 🔥 1m 9s ⏱️

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Comment on lines 174 to 180
def _log_discovered_count(
*, section: object, descriptor: str
*, section: LibrarySection, descriptor: str
) -> int | None:
try:
total = getattr(section, "totalSize") # type: ignore[assignment]
except Exception: # pragma: no cover - defensive guard
total = None
total = getattr(section, "totalSize", None)
if isinstance(total, int):
logger.info(
"Discovered %d Plex %s(s) for ingestion.",

Choose a reason for hiding this comment

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

P1 Badge Restore defensive guard around Plex section totalSize access

The new _log_discovered_count helper now calls getattr(section, "totalSize", None) without the previous try/except guard. In PlexAPI, section.totalSize performs a network lookup and can raise plexapi.exceptions.PlexApiException or other IO errors when the server is unreachable. Because this call is only for logging, allowing the exception to propagate will abort the entire ingestion run before any items are queued. The prior implementation swallowed these failures and continued. Please reintroduce the exception handling so that transient Plex errors only skip the log rather than crash ingestion.

Useful? React with 👍 / 👎.

@Teagan42 Teagan42 merged commit fb48546 into main Oct 7, 2025
4 checks passed
@Teagan42 Teagan42 deleted the codex/introduce-precise-types-in-imdb-throttle-and-payloads branch October 7, 2025 04: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