Conversation
🤖 Generated with Codex
Test Failure AnalysisSummary: A test in
Root Cause: A test in This looks like a pre-existing Windows CI flakiness: async tests involving localhost network operations or asyncio event loop behavior are known to be sensitive on Windows runners. Suggested Solution: This failure is not caused by changes in this PR. The test suite passes on Ubuntu (Python 3.10 and 3.13) and the lowest-direct-dependencies jobs. Recommend:
Detailed AnalysisFailed job: Timeout location (from log): 8 tests in that file passed, the 9th timed out at the 5s limit. The test involves an async OAuth consent flow with localhost networking, which can stall on Windows. This PR's actual changes are confined to:
Neither file has any connection to the OAuth consent page tests. Passing jobs: Ubuntu Python 3.10, Ubuntu Python 3.13, lowest-direct-dependencies, and integration tests all passed. Related Files
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54cc02cf01
ℹ️ 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 "@codex address that feedback".
| ) | ||
|
|
||
| def fresh_client_factory() -> Client: | ||
| return client.new() |
There was a problem hiding this comment.
Ensure fresh ProxyClient copies are disconnected
_create_client_factory now treats connected ProxyClient targets as safe by returning client.new(), but Client.new() does not reset session state for StdioTransport (src/fastmcp/client/client.py:405-408), so those copies stay connected and share the same underlying session. In the stdio-backed case, this branch still reuses the original receive loop and can leak stale request context across proxied requests despite the new safeguard, so the fix is bypassed for a supported transport type.
Useful? React with 👍 / 👎.
|
Auto-reviewed and merging on behalf of @jlowin — CI is green (Windows OAuth proxy timeouts are pre-existing flaky tests). |
Motivation
ProxyClientsession is reused, enabling cross‑client information leakage. This change targets the vulnerable path while keeping existing semantics for other client types.Description
_create_client_factoryso a connectedProxyClientproduces fresh disconnected copies viaclient.new()instead of reusing the same session.Clientinstances to avoid broad regressions.ProxyClienttarget yields fresh, disconnected client copies from_create_client_factory.Testing
uv syncsuccessfully.uv run pytest -n auto; the suite executed but the environment produced several unrelated timeouts/failures (11 failed, 4677 passed in this run) that appear orthogonal to this change.tests/server/providers/proxy/test_proxy_client.py::TestProxyClient::test_connected_proxy_client_uses_fresh_sessionspassed, and a short selection of other tests showed two unrelated failures/timeouts under this environment.uv run prek run --all-filesfailed to initialize hooks due to an external network clone error.Codex Task