feat: support awaited extension continuity across compaction - #687
Open
phernandez wants to merge 3 commits into
Open
feat: support awaited extension continuity across compaction#687phernandez wants to merge 3 commits into
phernandez wants to merge 3 commits into
Conversation
Signed-off-by: phernandez <paul@basicmachines.co>
Signed-off-by: phernandez <paul@basicmachines.co>
This was referenced Sep 6, 2026
Signed-off-by: phernandez <paul@basicmachines.co>
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.
This is a Basic Machines contribution for Basic Memory, our local-first knowledge and memory system for AI agents. We are adding durable session continuity to Tau and contributing the required host APIs upstream.
The source branch lives in the Basic Machines Tau fork. This replaces #683. Follow-up commit
d8216afremoves redundant branch snapshot copying: the session makes the defensive deep copy once and the extension returns that snapshot directly. Regression tests verify snapshot reuse and nested mutation isolation.Why
Refs #506. Memory extensions need to finish a checkpoint before context replacement, recover its receipt on the correct branch, and insert recall before the next prompt without triggering another agent response. Basic Memory is the concrete consumer: basicmachines-co/basic-memory#1489.
What Changed
context.branch_entries: deep-copied persisted active-path entries, including custom receipts, for reload/resume reconciliation and branch lineage.await context.summarize(messages, instructions=..., timeout=60): bounded tool-free synthesis using the active model/provider, without an agent turn or history mutation. Generation guards reject late results.await tau.append_message(content, custom_type=...): persist reference context while idle before the next prompt. Queued follow-ups—even with trigger_turn=False—can generate another model response; this method does not queue a turn.Design and Boundaries
No persistence destinations, exposed credentials, installed-package patches, or detached summary tasks in core. Extensions select inputs, own cancellation, validate writes and retain receipts. Observation failures preserve the diagnostic-only contract; this is not a compaction veto API.
This addresses extension delivery from #506, not threshold/manual frontend async-iterator or TUI status work, and deliberately does not close that issue. entry_appended delivery is unchanged; persisted active-path inspection supports receipt reconstruction without it.
Verification
uv run pytest -q: 1882 passed, 2 Windows-only tests skipped on macOS.uv run mypy: passed for 121 source files.f4124253, not rerun ford8216af): 51 tests pass, including actual session compaction/reload/branch/resume, headless Textual/reload, and real Basic Memory transcript/checkpoint persistence in temporary projects. Model providers are deterministic fakes; no production user session or paid model was used.Risks
Summary calls use the active provider's ordinary routing/billing. Extensions must choose bounded inputs and timeouts and must not treat a queued instruction or diagnostic-only callback as acknowledgement of an external write. References inserted with append_message are persisted custom messages and contribute to normal context size until compacted.