Skip to content

fix: keep advanced session message writes atomic#3523

Open
he-yufeng wants to merge 1 commit into
openai:mainfrom
he-yufeng:fix/add-items-metadata-transaction
Open

fix: keep advanced session message writes atomic#3523
he-yufeng wants to merge 1 commit into
openai:mainfrom
he-yufeng:fix/add-items-metadata-transaction

Conversation

@he-yufeng
Copy link
Copy Markdown

Summary

  • keep AdvancedSQLiteSession message inserts and structure metadata inserts in one transaction
  • roll back and surface the metadata error instead of reporting a false-success write
  • add a regression test that confirms no base-table or structure rows remain after failure

Fixes #3348.

To verify

  • python -m py_compile src\agents\extensions\memory\advanced_sqlite_session.py tests\extensions\memory\test_advanced_sqlite_session.py
  • uv run ruff check src\agents\extensions\memory\advanced_sqlite_session.py tests\extensions\memory\test_advanced_sqlite_session.py
  • uv run --extra sqlalchemy pytest tests\extensions\memory\test_advanced_sqlite_session.py -q
  • git diff --check

@seratch seratch added duplicate This issue or pull request already exists feature:sessions labels May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists feature:sessions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AdvancedSQLiteSession.add_items can report success after structure metadata failure

2 participants