mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
The MCP conftest.py was overriding session-scoped `server` and `graph_cleanup` fixtures with no-op versions. Having two session-scoped fixtures with the same name at different directory levels caused pytest-asyncio event loop conflicts, making all oauth_test.py tests fail with "Event loop is closed". Since these fixtures are session-scoped and shared across the entire test run, the override was unnecessary — the SpinTestServer is already created for other tests. Also adds defensive `access_token` key validation in MCP OAuth token exchange and refresh to prevent KeyError on malformed responses.