Skip to content

Conversation

@Teagan42
Copy link
Contributor

@Teagan42 Teagan42 commented Oct 4, 2025

What

  • add Qdrant payload indices for show titles, season numbers, and episode numbers and expose them via query-media filters
  • capture index creation in the loader integration test and assert episode filtering works through the server tool suite

Why

  • ensure episode context can be filtered efficiently during retrieval

Affects

  • loader Qdrant setup, structured query handling, and associated tests

Testing

  • uv run ruff check .
  • uv run pytest

Documentation

  • not needed

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

Copilot AI review requested due to automatic review settings October 4, 2025 08:21
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 adds comprehensive Qdrant payload indices for show metadata fields to enable efficient filtering of episodes by show title, season number, and episode number during media retrieval.

  • Adds new fields (show_title, season_title, season_number, episode_number, genres, collections) to the PlexItem model
  • Creates payload indices for show metadata and other fields with proper data types (KEYWORD for titles, INTEGER for numbers)
  • Implements a new query_media tool with structured filtering capabilities and updates all existing tools to use flattened payload data

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
mcp_plex/types.py Adds show/season/episode fields and genres/collections to PlexItem model
mcp_plex/loader.py Extracts show metadata from Plex items and creates comprehensive payload indices
mcp_plex/server.py Implements new query_media tool and updates all tools to use flattened payload structure
tests/test_loader_integration.py Captures index creation and validates episode metadata extraction
tests/test_server.py Tests episode filtering through query_media and validates metadata fields
pyproject.toml Version bump to 0.26.38
docker/pyproject.deps.toml Version bump to 0.26.38

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

@github-actions
Copy link

github-actions bot commented Oct 4, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
mcp_plex
   loader.py5063194%70, 73–74, 150, 179–183, 185–194, 205, 207–209, 225, 251, 440, 443, 693–695, 764
   server.py4786686%107, 124, 142–143, 278, 299–302, 304–306, 467, 479, 497–504, 524, 526–531, 533–538, 541, 547, 551, 553, 579, 581, 583, 585, 587, 590, 597, 603, 832, 836, 858–864, 896–897, 900, 918, 923, 941, 972–973, 990–991, 1014, 1017–1018, 1065, 1102
TOTAL11719792% 

Tests Skipped Failures Errors Time
66 0 💤 0 ❌ 0 🔥 39.321s ⏱️

@Teagan42 Teagan42 merged commit 7e46fca into main Oct 4, 2025
4 checks passed
@Teagan42 Teagan42 deleted the codex/update-vectors-for-semantic-correctness branch October 4, 2025 08:23
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 827 to +830
if created_collection:
text_index = models.TextIndexParams(
type=models.PayloadSchemaType.TEXT,
tokenizer=models.TokenizerType.WORD,

Choose a reason for hiding this comment

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

P1 Badge Backfill new payload indexes for existing Qdrant collections

The new episode and text filters rely on payload indexes for fields like show_title, season_number, summary, overview, plot, tagline, and reviews, but index creation still occurs only when the collection is first created (if created_collection:). Upgrading an installation that already has a media-items collection will skip this block, leaving those fields unindexed. Text filters then raise InvalidArgument errors in Qdrant because MatchText requires a text index, and keyword filters stay slow. Consider creating the indexes unconditionally and ignoring AlreadyExists errors so the loader can migrate existing collections before query_media is used.

Useful? React with 👍 / 👎.

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