Postgres
Postgres storage for conversation snapshots. Requires psycopg >= 3.2.
PostgresConversationStore
Share snapshots across workers using one database transaction per lock.
Source code in src/openai_agents/codex/postgres.py
initialize
async
Create the table in the current schema. Safe to call from each worker at startup.
Source code in src/openai_agents/codex/postgres.py
lock
async
lock(
conversation_id: str,
) -> AsyncIterator[StoredConversation]
Hold the ID until commit or rollback. Raise conversation_busy on contention.