Skip to content

fix(supermemory): honor auto capture across lifecycle flushes - #78617

Closed
CryptoKylan wants to merge 1 commit into
NousResearch:mainfrom
CryptoKylan:fix/supermemory-auto-capture-lifecycle
Closed

fix(supermemory): honor auto capture across lifecycle flushes#78617
CryptoKylan wants to merge 1 commit into
NousResearch:mainfrom
CryptoKylan:fix/supermemory-auto-capture-lifecycle

Conversation

@CryptoKylan

Copy link
Copy Markdown

Summary

Fixes an auto_capture: false policy leak in the bundled Supermemory provider.

The provider already respected the flag in sync_turn(), but three independent automatic lifecycle flushes bypassed it:

  • gateway transcript ingest through on_session_end() (including compaction/session boundaries),
  • buffered turn flush through on_session_switch(), and
  • the process-termination fallback flush.

All three now honor the same flag. Explicit user-intent writes through supermemory_store and on_memory_write() remain available when automatic capture is disabled.

This is a narrower lifecycle-complete follow-up to #21690 / #21692.

Validation

python -m pytest tests/plugins/memory/test_supermemory_autocapture_guard.py tests/plugins/memory/test_supermemory_provider.py -o 'addopts=' -q\n34 passed in 5.04s\n\nruff check plugins/memory/supermemory/__init__.py tests/plugins/memory/test_supermemory_autocapture_guard.py\nAll checks passed!\n\npython -m py_compile plugins/memory/supermemory/__init__.py\ngit diff --check\n```\n\nThe regression suite covers disabled and enabled behavior at each lifecycle boundary, repeated session-end calls representative of compression, and preservation of explicit tool and memory-write paths.

@CryptoKylan
CryptoKylan marked this pull request as ready for review August 4, 2026 16:47
@CryptoKylan

Copy link
Copy Markdown
Author

Marked ready after independent, provenance-verified Opus 5 review of the final diff.

Review result: pass_with_watchlist, high confidence, no blocking defects. The one behavioral finding (disabled session-switch path did not reset _turn_count) was fixed with a failing regression first; the review was then rerun against amended commit fbe45db679.

Final validation:

python -m pytest tests/plugins/memory/test_supermemory_autocapture_guard.py tests/plugins/memory/test_supermemory_provider.py -o 'addopts=' -q\n34 passed\n\nruff check plugins/memory/supermemory/__init__.py tests/plugins/memory/test_supermemory_autocapture_guard.py\nAll checks passed!\n\npython -m py_compile plugins/memory/supermemory/__init__.py\ngit diff --check\n```\n\nNon-blocking watchlist: `auto_capture` intentionally governs automatic storage, while `auto_recall` independently controls recall/network queries; this follow-up deliberately does not alter that documented policy boundary.

@CryptoKylan
CryptoKylan marked this pull request as draft August 4, 2026 16:49
@CryptoKylan

Copy link
Copy Markdown
Author

Status correction: GitHub is still serving the pre-amend head 7ed8909f for this PR, even though the source branch now resolves to independently reviewed commit fbe45db679. I returned the PR to draft while resolving that fork/PR synchronization mismatch; please do not review it yet.

@CryptoKylan

Copy link
Copy Markdown
Author

Superseded by #78656. GitHub kept this PR pinned to stale commit 7ed8909f after the reviewed amendment; #78656 is the identical reviewed change from a fresh branch and correctly points to fbe45db679.

@CryptoKylan

Copy link
Copy Markdown
Author

Closing as superseded by #78656 to avoid reviewers landing on the stale fork head.

@CryptoKylan CryptoKylan closed this Aug 4, 2026
@alt-glitch alt-glitch added type/bug Something isn't working comp/plugins Plugin system and bundled plugins tool/memory Memory tool and memory providers P3 Low — cosmetic, nice to have labels Aug 4, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

@Dhravya @MaheshtheDev Tagging you on this Supermemory provider item as the soft maintainers.

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

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have tool/memory Memory tool and memory providers type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants