Skip to content

fix(playground): server-side memory cleanup on session expiry + startup purge (DAK-6975)#231

Merged
ferhimedamine merged 1 commit into
mainfrom
fix/dak6975-chat-memory-cleanup
Jun 18, 2026
Merged

fix(playground): server-side memory cleanup on session expiry + startup purge (DAK-6975)#231
ferhimedamine merged 1 commit into
mainfrom
fix/dak6975-chat-memory-cleanup

Conversation

@ferhimedamine

Copy link
Copy Markdown
Contributor

Summary

  • BUG 1 FIX: sweep() now triggers engine namespace deletion on session expiry. Added onExpire callback to SessionStore, namespace tracking per session via trackNamespace(), and cleanup on both sweep-timer and resolve-time expiry paths.
  • BUG 6 FIX: Startup purge routine lists all engine namespaces and deletes stale playground-demo-* ones, cleaning up historical data accumulation.
  • 4 new unit tests (64 total, all passing).

Changes

File What
sessions.js onExpire callback, trackNamespace(), cleanup in both sweep() and resolve()
server.js Track namespace when rewriting agent_id
index.js Wire onExpire to DELETE engine namespaces + startup purge routine
proxy.test.js 4 new tests for expiry cleanup behavior

Test plan

  • 64/64 proxy unit tests pass (node --test proxy.test.js)
  • Deploy to playground server and verify sweep logs show namespace deletion
  • Verify old playground-demo-* namespaces are purged on startup

🤖 Generated with Claude Code

…up purge (DAK-6975)

BUG 1: sweep() only removed sessions from the in-memory Map — engine memories
persisted forever in RocksDB. Now tracks namespaces per session and calls
DELETE /v1/namespaces/{ns} on expiry (both sweep timer and resolve-time expiry).

BUG 6: Historical playground-demo-* namespaces accumulated from all past sessions.
Added startup purge that lists all namespaces and deletes playground-demo-* ones.

4 new tests: onExpire callback, resolve-time cleanup, trackNamespace dedup, no-op
when no namespaces tracked. All 64 tests pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ferhimedamine ferhimedamine merged commit 0515002 into main Jun 18, 2026
4 checks passed
@ferhimedamine ferhimedamine added the agent/cto Reviewed/merged by CTO agent label Jun 18, 2026
@ferhimedamine ferhimedamine deleted the fix/dak6975-chat-memory-cleanup branch June 24, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/cto Reviewed/merged by CTO agent auto-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant