Skip to content

fix: #3306 track MongoDB metadata timestamps#3307

Merged
seratch merged 1 commit intoopenai:mainfrom
Aphroq:fix/mongodb-session-timestamps
May 9, 2026
Merged

fix: #3306 track MongoDB metadata timestamps#3307
seratch merged 1 commit intoopenai:mainfrom
Aphroq:fix/mongodb-session-timestamps

Conversation

@Aphroq
Copy link
Copy Markdown
Contributor

@Aphroq Aphroq commented May 9, 2026

Summary

  • Add created_at and updated_at fields to MongoDB session metadata documents on non-empty writes.
  • Preserve created_at across later writes while refreshing updated_at and continuing to increment _seq atomically.
  • Add fake MongoDB update support and regression coverage for first and subsequent writes.

Test plan

  • uv run pytest tests/extensions/memory/test_mongodb_session.py -k "metadata_timestamps or add_and_get_items or multiple_add_calls_accumulate"
  • uv run pytest tests/extensions/memory/test_mongodb_session.py
  • uv run mypy tests/extensions/memory/test_mongodb_session.py
  • uv run pytest tests/extensions/memory/test_mongodb_session.py -k metadata_timestamps
  • bash .agents/skills/code-change-verification/scripts/run.sh

Issue number

Closes #3306

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

@github-actions github-actions Bot added bug Something isn't working feature:extensions labels May 9, 2026
@Aphroq Aphroq changed the title fix(sessions): track MongoDB metadata timestamps fix: #3307 track MongoDB metadata timestamps May 9, 2026
@Aphroq Aphroq changed the title fix: #3307 track MongoDB metadata timestamps fix: #3306 track MongoDB metadata timestamps May 9, 2026
@seratch seratch added this to the 0.17.x milestone May 9, 2026
@seratch seratch merged commit 610c274 into openai:main May 9, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working feature:extensions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MongoDBSession metadata omits documented timestamps

2 participants