Add scheduled memory maintenance - #1
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class, scheduled memory maintenance by introducing a stable memory_list enumeration tool (with tenant/namespace-bound cursors) and an operator-installed preset that creates a memory-only maintainer agent plus a disabled-by-default weekly schedule. This fits the existing run/tool/schedule/trace model by making maintenance run through the same queued-run pipeline rather than adding a background worker.
Changes:
- Add bounded, keyset-paginated
memory_listwith tenant/namespace-bound cursors and supporting store API + tests. - Add a per-tenant
memory-maintenancepreset endpoint that installs a memory-only agent and a disabled weekly schedule, plus server-side tests. - Update documentation and changelog to cover the new tool, preset API, and reliability/threat-model evidence.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents memory_list and the memory-maintenance preset behavior. |
| docs/threat-model.md | Adds threat-model notes for bounded listing + preset isolation. |
| docs/reliability.md | Adds reliability claims and references to new tests for listing + preset. |
| docs/http-api.md | Documents the new preset endpoint and memory_list tool semantics. |
| docs/architecture.md | Describes enumeration and scheduled maintenance in the existing run loop. |
| crates/agentd-store/src/lib.rs | Implements keyset pagination for memory listing and adds store tests. |
| crates/agentd-server/src/server.rs | Wires the new preset route and adds an integration test. |
| crates/agentd-server/src/handlers/presets.rs | Implements the preset installer for agent + schedule resources. |
| crates/agentd-server/src/handlers/mod.rs | Exposes the new presets handler module. |
| crates/agentd-core/src/runtime.rs | Extends runtime tracing test to include memory_list tool events. |
| crates/agentd-core/src/lib.rs | Registers memory_list in the capability dispatch. |
| crates/agentd-core/src/handlers/memory.rs | Implements cursor encoding/decoding and the memory_list tool handler. |
| crates/agentd-api/src/builtin_catalog.rs | Adds memory_list to the builtin tool catalog and updates catalog tests. |
| CHANGELOG.md | Adds release notes for memory_list and the maintenance preset. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| tenant, | ||
| namespace, | ||
| after_id.as_deref(), | ||
| params.get("limit").and_then(Value::as_u64).unwrap_or(50) as usize, |
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.
What changed
memory_listkeyset pagination with tenant/namespace-bound cursorsWhy
Scheduled runs could not reliably enumerate a namespace, so they could not audit, deduplicate, or conservatively maintain all durable memory while staying inside the existing run/tool/schedule/trace model.
Impact
Operators can install the preset explicitly, review its resources, and enable the schedule when desired. Installation alone creates no LLM calls or memory mutations.
Validation
cargo fmt --all -- --checkcargo check --workspace --all-targetscargo test --workspace(50 passed, 1 ignored)cargo clippy --workspace --all-targets -- -D warnings