Skip to content

fix(gateway): finalize session-end memory providers with transcript - #12261

Closed
MonkeyLeeT wants to merge 1 commit into
NousResearch:mainfrom
MonkeyLeeT:codex/fix-11205-gateway-memory-finalize
Closed

fix(gateway): finalize session-end memory providers with transcript#12261
MonkeyLeeT wants to merge 1 commit into
NousResearch:mainfrom
MonkeyLeeT:codex/fix-11205-gateway-memory-finalize

Conversation

@MonkeyLeeT

Copy link
Copy Markdown

Summary

  • finalize gateway session-end memory providers with the real transcript on session expiry and /new//reset
  • reuse a shared helper to flush built-in memory, then call shutdown_memory_provider(history) before closing stale agents
  • add regressions for the expiry watcher and reset path so the provider hook stays covered

Root Cause

The gateway already had a built-in memory flush path, but its real session-boundary paths did not finalize MemoryProvider.on_session_end() correctly. Session expiry called provider shutdown without the transcript, and /new//reset only scheduled the built-in flush before closing the cached agent. That meant memory providers never received the actual session messages they need to persist end-of-session state.

Validation

  • source .venv/bin/activate && python -m pytest tests/gateway/test_async_memory_flush.py tests/gateway/test_session_model_reset.py tests/gateway/test_session_boundary_hooks.py tests/gateway/test_resume_command.py tests/gateway/test_gateway_shutdown.py -q

Closes #11205.

@MonkeyLeeT MonkeyLeeT changed the title [codex] Fix gateway session-end memory finalization fix(gateway): finalize session-end memory providers with transcript Apr 18, 2026
@MonkeyLeeT
MonkeyLeeT marked this pull request as ready for review April 18, 2026 19:50
@MonkeyLeeT
MonkeyLeeT force-pushed the codex/fix-11205-gateway-memory-finalize branch from fa0c161 to e920d90 Compare April 18, 2026 19:52
@MonkeyLeeT

Copy link
Copy Markdown
Author

Closing this duplicate fix in favor of existing PRs already covering #11205.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: MemoryProvider.on_session_end() never called on gateway session expiry

1 participant