---
type: email
from: Lucas Wang <notifications@github.com>
subject: Re: [openai/openai-agents-python] fix: Add close() method to

 SQLAlchemySession for proper engine disposal (PR #1960)
received: 2026-03-06 08:11:28
date_header: Tue, 21 Oct 2025 01:28:20 -0700
priority: normal
status: awaiting_approval
uid: 33266
---

## Email Content

**From:** Lucas Wang <notifications@github.com>
**Subject:** Re: [openai/openai-agents-python] fix: Add close() method to

 SQLAlchemySession for proper engine disposal (PR #1960)
**Date:** Tue, 21 Oct 2025 01:28:20 -0700

### Body (preview)

gn00295120 left a comment (openai/openai-agents-python#1960)



I've added comprehensive unit tests to verify the `engine` property behavior:



## Test Coverage



1. **test_engine_property_from_url()** 

   - Verifies engine property returns AsyncEngine instance

   - Tests that users can access pool status

   - Confirms manual disposal works: `await session.engine.dispose()`



2. **test_engine_property_from_external_engine()**

   - Verifies engine property returns the same external engine instance

   - Ensures users retain control when injecting their own engine



3. **test_engine_property_is_read_only()**

   - Confirms property is immutable (raises AttributeError on assignment)

   - Ensures engine reference cannot be accidentally modified



All tests follow the existing test patterns in the file and use the same in-memory SQLite setup. The tests will run in CI to verify the implementation.



-- 

Reply to this email directly or view it on GitHub:

https://github.com/openai/openai-agents-python/pull/1960#issuecomment-3425394554

You are receiving this because you are subscribed to this thread.



Message ID: <openai/openai-agents-python/pull/1960/c3425394554@github.com>

---

## Suggested Actions
- [ ] Reply
- [ ] Archive
- [ ] Escalate
