You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix authentication event loop corruption by converting get_current_user to async
The get_current_user() function was using asyncio.run() within FastAPI's async context,
which creates a new event loop and causes "Event loop is closed" errors. This led to
intermittent authentication failures where requests would alternate between success (200)
and failure (500).
Changes:
- Convert get_current_user() from sync to async function
- Replace asyncio.run(verify_token()) with await verify_token()
- Update require_scope() and require_role() dependency functions to be async
- Fix all related test cases to use await when calling these functions
This resolves the issue where tool calls to the memory server would intermittently fail
with 500 errors during token verification.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
0 commit comments