th-374b27: memory_for_access seam — durable auto-recall into every turn - #330
Merged
Conversation
…y turn The engine core already supported auto-recall (AgentConfig::with_memory → build_context_messages → memory.recall(msg, 5)), but the server never wired it: StorageAdapter had checkpoints()/knowledge() but no memory accessor, and runner.rs built each AgentConfig without .with_memory(). Add StorageAdapter::memory_for_access(&access) -> Option<Arc<dyn Memory>> (default None → every backend byte-for-byte unchanged; hosted auto-recall stays a deliberate opt-in). runner.rs now calls .with_memory() when the adapter returns Some. The in-memory conformance adapter gains a with_memory() builder + override so the seam is exercised end-to-end (2 new injection_seams tests, 8/8 pass). Lights up Big Smooth: its SQLite adapter overrides memory_for_access to return its store, injecting remembered preferences into every turn. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017QkUKdJ4Xbx7WXV2FAg555
🦋 Changeset detectedLatest commit: 6fe69cc The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The engine core already supports memory auto-recall (`AgentConfig::with_memory` → `build_context_messages` → `memory.recall(msg, 5)`), but the server never wired it. `StorageAdapter` exposed `checkpoints()`/`knowledge()` but no memory accessor, and `runner.rs` built each turn's `AgentConfig` without `.with_memory(...)`. So Big Smooth's durable memory (RememberTool/RecallTool, th-6d1692) only worked when the agent explicitly called `recall` — never auto-injected.
Fix
Default `None` ⇒ every existing backend is byte-for-byte unchanged. Hosted auto-recall across all orgs stays a deliberate opt-in (a backend overriding `memory_for_access`), not a side effect of adding the seam.
Lights up Big Smooth
Its single-tenant SQLite adapter (smooth repo) overrides `memory_for_access` to return its store → remembered preferences (e.g. "always add shows to smoo-hub") get injected into every turn without the agent calling `recall`. Follow-on in the smooth repo: bump the engine pin + add the daemon-side override.
Tests
2 new `injection_seams` tests (no memory ⇒ no recall block; attached memory ⇒ recalled content reaches the model). 8/8 pass. Clippy clean on the new code; fmt clean on touched files.
🤖 Generated with Claude Code