Skip to content

Conversation

@Teagan42
Copy link
Contributor

@Teagan42 Teagan42 commented Oct 9, 2025

What

  • ensure the Plex server lazily rebuilds its default Qdrant client when the FastMCP lifespan closes
  • guard against misconfiguration with an explicit error and keep the configurable setter semantics
  • add regression coverage that verifies the client is recreated after a close and bump the package version metadata

Why

  • the FastMCP tool manager invokes the server lifespan per tool call, which closed the shared Qdrant client and left later requests unable to execute searches
  • restoring the client lazily prevents RuntimeError: Cannot send a request, as the client has been closed while preserving existing customization hooks

Affects

  • Plex server startup, shutdown, and tool execution paths that rely on the default Qdrant client
  • server internal tests covering Qdrant client lifecycle
  • project version metadata and dependency lock file

Testing

  • uv run ruff check .
  • uv run pytest

Documentation

  • not required

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

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
mcp_plex/loader
   __init__.py1821194%139, 209, 323–325, 327, 416–435
   qdrant.py198299%338–343
   samples.py41393%55–57
mcp_plex/loader/pipeline
   enrichment.py5207586%234, 255–261, 314, 319, 350, 352, 359, 361, 461, 482, 502, 510–512, 515–519, 522–524, 532–537, 545, 596–597, 621, 679–680, 696, 723, 730, 732, 736, 788, 806, 818, 847, 853, 856–864, 890, 893–895, 912–914, 934–937, 941, 955–959, 981, 983, 986–988
   ingestion.py1551392%82, 133–153, 188, 225, 241, 334, 340, 358
   orchestrator.py95595%60, 136, 165, 188–189
   persistence.py130993%123, 165–166, 174, 185, 189–191, 240
mcp_plex/server
   __init__.py3741795%121, 127–130, 230, 292, 310–311, 319, 394, 488, 518, 537, 544, 563, 676
   cli.py62198%73
   config.py82199%59
   media.py2232191%159–165, 174–177, 215–222, 245, 279, 285, 291, 309–310
mcp_plex/server/tools
   media_library.py3371296%203, 576, 674, 693, 744, 795, 866, 956–960
TOTAL293017094% 

Tests Skipped Failures Errors Time
197 0 💤 0 ❌ 0 🔥 1m 28s ⏱️

@Teagan42 Teagan42 merged commit c269114 into main Oct 9, 2025
4 checks passed
@Teagan42 Teagan42 deleted the codex/fix-runtimeerror-in-tool-manager branch October 9, 2025 20:08
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