Skip to content

fix: #3304 skip corrupt items during pop - #3305

Merged
seratch merged 1 commit into
openai:mainfrom
Aphroq:fix/session-pop-skip-corrupt-items
May 9, 2026
Merged

fix: #3304 skip corrupt items during pop#3305
seratch merged 1 commit into
openai:mainfrom
Aphroq:fix/session-pop-skip-corrupt-items

Conversation

@Aphroq

@Aphroq Aphroq commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Make SQLite, AsyncSQLite, Redis, SQLAlchemy, and Dapr session pop_item() skip corrupted newest entries and continue to the next valid item.
  • Keep returning None only when no valid item remains after corrupted entries are removed.
  • Add backend coverage for corrupt newest entries and corrupt-only histories. MongoDB already has this behavior via fix(sessions): skip corrupt docs in MongoDBSession.pop_item #3247, so this aligns the sibling session backends.

PR #3247 is adjacent but only covered MongoDBSession.pop_item() and is already merged.

Test plan

  • uv run pytest tests/memory/test_session.py tests/extensions/memory/test_async_sqlite_session.py tests/extensions/memory/test_sqlalchemy_session.py tests/extensions/memory/test_dapr_session.py tests/extensions/memory/test_redis_session.py -k "pop_item_skips_corrupt or pop_item_returns_none_after_dropping_only_corrupt or corrupted_data_handling"
  • uv run pytest tests/memory/test_session.py tests/extensions/memory/test_async_sqlite_session.py tests/extensions/memory/test_sqlalchemy_session.py tests/extensions/memory/test_dapr_session.py tests/extensions/memory/test_redis_session.py
  • bash .agents/skills/code-change-verification/scripts/run.sh

Issue number

Closes #3304

Checks

  • I've added new tests (if relevant)
  • I've added/updated the relevant documentation
  • I've run make lint and make format
  • I've made sure tests pass

@seratch

seratch commented May 9, 2026

Copy link
Copy Markdown
Member

@codex review

@seratch seratch added this to the 0.17.x milestone May 9, 2026
@Aphroq Aphroq changed the title fix(sessions): skip corrupt items during pop fix: #3304 skip corrupt items during pop May 9, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@seratch
seratch merged commit 4b87449 into openai:main May 9, 2026
10 checks passed
RudrenduPaul pushed a commit to RudrenduPaul/openai-agents-python that referenced this pull request Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Session pop_item can report empty after dropping corrupt newest item

2 participants