Skip to content

Conversation

@Teagan42
Copy link
Contributor

What

  • replace the PlexServer lifespan generator with an explicit async context manager that always calls close
  • extend the lifespan test to assert that the server close hook executes
  • bump the package version to 0.26.30 and refresh the lock file

Why

  • the SSE endpoint crashed because the prior lifespan implementation returned an async generator that is not a valid async context manager for FastMCP

Affects

  • mcp_plex.server
  • tests/test_server.py
  • packaging metadata

Testing

  • uv run ruff check .
  • uv run pytest

Documentation

  • Not needed

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

Copilot AI review requested due to automatic review settings September 30, 2025 08:32
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 fixes a critical bug in the SSE endpoint by replacing an invalid async generator lifespan implementation with a proper async context manager that ensures the server's close method is always called.

  • Replaced the PlexServer lifespan generator with an explicit async context manager class
  • Enhanced the lifespan test to verify that the server close hook executes properly
  • Bumped package version to 0.26.30

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
mcp_plex/server.py Replaced async generator with proper async context manager implementation
tests/test_server.py Added assertion to verify server close hook execution
pyproject.toml Version bump to 0.26.30

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.py4172893%70, 73–74, 150, 179–183, 185–194, 205, 207–209, 225, 251, 652–654
   server.py3212193%112–113, 236, 464, 468, 490–496, 528, 538, 569–570, 587–588, 611, 614–615, 662, 699
TOTAL9194995% 

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

@Teagan42 Teagan42 merged commit aab88b6 into main Sep 30, 2025
4 checks passed
@Teagan42 Teagan42 deleted the codex/investigate-/sse-endpoint-connection-error branch September 30, 2025 08:34
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