# Unclosed client session and Unclosed connector warnings after upgrading to v1.37

## What's going on

After upgrading google-genai to v1.37, async users started seeing `Unclosed client session` and `Unclosed connector` warnings at shutdown. The root cause is that the async client holds an aiohttp session that needs an async context manager to close cleanly. A maintainer showed the correct pattern: `async with genai.Client(...).aio`. The reporter later confirmed the warnings were gone in v1.52.0.

## The verified fix

Those warnings mean the async client's underlying aiohttp session was never closed, and they started appearing for async users after v1.37. Use the async client as a context manager, `async with genai.Client(...).aio`, so the session closes cleanly at the end of the block. The reporter confirmed the issue was gone in v1.52.0, so also make sure you are on a recent release. If you see this on old code, wrapping the client usage in the async context manager is the fix.
Source: https://github.com/googleapis/python-genai/issues/1388

## How to use this

Take the question above and check if it matches what you're seeing. If it does, work through the verified fix step by step. Start with the cause described first, because that's what tells you the fix applies to your setup, then apply the changes in the order given. Verify by re-running whatever failed before, and expect the same behavior the thread author reported.
