feat(memory): drive TinyMemory's agent lifecycle around every turn - #6993
Merged
Merged
Conversation
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…ps/connect/memory_tests.rs,crat Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Looking at the diff: 1. `Cargo.lock` changes: The `tinymemory` package is removed, and its dependencies are restructured. `tinymemory-api` version goes from 2.0.0 to 1.23.0. New packages `tinymemory-integrations` and `tinymemory-tools` appear. The old packages `tinymemory-conformance`, `tinymemory-context`, `tinymemory-cortex`, `tinymemory-documents`, `tinymemory-import`, `tinymemory-safety`, `tinymemory-sources` are removed. The main crate now depends on `tinymemory-api`, `tinymemory-integrations`, `tinymemory-tools` instead of `tinymemory`. 2. Multiple test files are deleted: - `crates/openhuman-core/src/memory/auto_recall/auto_recall_tests.rs` (570 lines deleted) - `crates/openhuman-core/src/memory/ops/documents_tests.rs` (323 lines deleted) - `crates/openhuman-core/src/memory/ops/files_tests.rs` (269 lines deleted) Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The change is in `crates/openhuman-core/src/memory/sources/sync.rs`. It: 1. Removes the import of `apply_kind_defaults` from `tinymemory_integrations::sources`. 2. Adds a new local function `apply_kind_defaults` that fills per-kind read caps the user did not set: GitHub repo reads at most 10 PRs, 10 issues, 50 commits; a feed at most 20 items. The doc comment says "How much a sync pulls is host policy, so it lives here rather than in the readers." Wait — but the new function is defined but is it called? The diff shows the function added after `reader_entry` and before `sync_one`. The diff doesn't show a call site being added... Let me check. The diff only shows the import change and the function addition. Hmm, the stat says 18 insertions, 1 deletion. The import line change is 1 insertion + 1 deletion, and the function is 17 lines (including doc comment and blank line). Let me count: +/// Fills the per-kind read caps the user did not set: a GitHub repo reads at +/// most 10 PRs, 10 issues and 50 commits, a feed at most 20 items. How much a Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…ests.rs Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…s/openhuman-core/src/memory/ops Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…e diff section is empty, and th Hmm, the diff is empty. The file is `jobs_tests.rs` in a memory lifecycle module. Since there's no diff content, I have to infer: the file appears to be added (it's listed as a file, untracked among them: none means it's tracked? Actually "Untracked among them: none" means none of the files are untracked). Stat is empty, diff is empty. Given the filename `jobs_tests.rs`, this is a test file for lifecycle jobs. The most reasonable commit would be `test(memory): add tests for lifecycle jobs` or similar. But wait — with an empty diff, maybe the change is trivial. The instructions say omit the description entirely for a trivial change. But we can't know it's trivial. The safest interpretation: a new test file was added for memory lifecycle jobs. Subject: `test(memory): add tests for lifecycle jobs` — under 72 chars, imperative, lowercase. Scope: could be `memory` or `memory-lifecycle` or omitted. The path is crates/openhuman-core/src/memory/lifecycle/jobs_tests.rs. Scope `memory` seems fine. Description: one or two Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…_tests.rs Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…_tests.rs Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…run_context.rs Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…time_session/memory_ingest.rs Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…time_session.rs,crates/openhuma Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…time_session.rs Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…nhuman-core/src/core/events.rs Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…eware/memory_pack.rs Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…ss_assembly.rs,crates/openhuman Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…eware/memory_pack_tests.rs Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…time_session.rs,crates/openhuma Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…ss_assembly.rs,crates/openhuman Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Refresh the vendored tinymemory dependency to its latest revision and adjust the MemoryBrainTab tests to match. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…st.tsx Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
….tsx Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…app/src/components/memory/Memor Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…oks/developing/architecture/mem Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…alog_conversation_intelligence. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…ME.ko.md,docs/README.ur-pk.md,d Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…books/guides/personal-assistant Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…,crates/openhuman-cli/src/bin/l Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…time_session.rs,crates/openhuma Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…time_session/memory_ingest.rs,c Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
When the memory summarizer runs compaction, it now removes any "Recalled from memory" section carried over from a previous checkpoint before appending the new recall. This prevents the summary from accumulating multiple recall sections across successive compactions, keeping the output clean and avoiding redundant context. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Contributor
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
⛔ Files ignored due to path filters (2)
📒 Files selected for processing (204)
Comment |
Update the vendored tinymemory submodule to 1.23.1 and refresh Cargo.lock so the tinymemory-api, tin Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
senamakel
marked this pull request as ready for review
October 4, 2026 17:03
Tiny Sweeper review
|
This was referenced Oct 5, 2026
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.
Summary
memory_backgroundcron).context.mdand its injection;memory_context_*andmemory_conversations_get/setRPCs;tests/memory_roundtrip_e2e.rs,examples/run_memory_reconcile.rs, and the iMessage scanner's call to the removedmemory_doc_ingest.agent:<id>under a layout root, while learnings and the brain are shared;[memory] agent_id/rootoropenhuman_embed::AgentSpec::memory(MemoryBinding::new(id).root(root)).policy_get/set,pack_preview,agents_list,brain_sources/search/ingest/forget,jobs_list/run;Problem
context.mdbrief that reached new threads only;x-sdk-name. Every other backend caller does.Solution
vendor/tinymemorymoves to v1.23.1, which includes tinymemory#196. Thetinymemoryfacade is replaced bytinymemory-api,tinymemory-toolsandtinymemory-integrations.memory::scope.MemoryIdentityresolves to a layout root and a memory agent id. Order: host binding, then[memory.agents.<def>] agent_id/root/recall, then team root, then the definition id.memory::lifecycle:hooks(pre_turn,post_turn,compaction) are bounded by timeouts and never fail a turn;jobsis the persisted, de-duplicated queue, delayed bybuild_delay_secsand paused with the scheduler gate;viewsserves the UI RPCs.before_turn, concurrently with request enrichment;MemoryPackMiddlewareinjects withpush_ephemeral_instruction, so the transcript and prefix cache are untouched;MemoryRecallSummarizerwraps the compaction summarizer;MemoryTurnridesOpenHumanRunContext.memory::guard::ScrubbingEngine. It wraps every bound engine, so all write paths are scrubbed, including TinyMemory's own lifecycle writes.memorytool keeps the same actions, confined to the identity's layout;omit_memory_contextnow means "no per-turn pack for this agent";memorytoggle, with legacy ids mapped.CortexEngine::with_default_headers/EngineSettings::headers. The hosted engine now sends the transport's attribution headers.Submission Checklist
tests/memory_v2_e2e.rs, rewritten for the new RPCs, plus a full web-chat turn. The turn asserts that the pack reaches the inference request, that both turns are logged withx-sdk-name, and that no pack is in the transcript;AgentSpec::memory;docs/TEST-COVERAGE-MATRIX.mdrows 8.2.x).Impact
memory_context_refreshcron row is removed at startup;memory_context_*andmemory_conversations_get/setare gone. The UI is updated in this PR.Related
vendor/tinymemoryis pinned to that tag (4b18323).memory.turn_pack(replacesmemory.context),memory.documents(Brain),memory.conversations,memory.agent_namespaces.app/test/playwright/specs/memory-v2.spec.ts;agent-run-turn-test8 MB stack overflows inchannels::tests::discord_integration(reproduced on main7a671ae344).AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
memory-lifecycleValidation Run
pnpm --filter openhuman-app format:check: cleanpnpm typecheck: cleanmemory_v2_e2e: 15/15;runtime_agents+public_api: pass;cargo fmt,cargo check --workspace --tests --examples, product-feature test build,pnpm rust:clippy,pnpm rust:layoutand the feature-forwarding check are all clean.cargo check --manifest-path crates/openhuman-app/Cargo.tomlis clean.Validation Blocked
command:the fullcargo test -p openhuman --librun and the Playwright memory spec.error:deferred on request. Partial runs abort onagent-run-turn-teststack overflows in the discord_integration tests, which also overflow on main.impact:unrelated tests may still fail; they will be run before this is marked ready.Behavior Changes
context.mdany more.Parity Contract
memorytool's name and actions;MEMORY_OFF, and no turn depends on memory.Duplicate / Superseded PR Handling