memory: per-session semantic memory (strata-memory crate, Qdrant Edge + BGE-M3)
remember/recall/forget agent tools, one-way opt-in latch with embedder gate, fail-open Store-authoritative design, keyword fallback, model-id rebuild, GUI toggle + i18n; docs updated; split-debuginfo=unpacked
This commit is contained in:
1 parent
6898cdf113
commit
f74d53e446
24 files changed
+4853
-67
No files matched your search
+20
-1
@@ -75,7 +75,7 @@ async fn build_app() -> (axum::Router, Arc<SqliteStore>) {
|
||||
.unwrap()
|
||||
.as_nanos();
|
||||
let root = std::env::temp_dir().join(format!("strata-ctl-test-{nanos}"));
|
||||
let app = router_with_store(svc, store.clone(), AuthConfig::default(), root);
|
||||
let app = router_with_store(svc, store.clone(), AuthConfig::default(), root, None);
|
||||
(app, store)
|
||||
}
|
||||
|
||||
@@ -163,6 +163,25 @@ async fn mcp_connector_crud_and_validation() {
|
||||
assert_eq!(st, StatusCode::NOT_FOUND);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn memory_enable_rejected_without_service() {
|
||||
let (app, _store) = build_app().await;
|
||||
let id = create_session(&app).await;
|
||||
// No memory service in this app -> enabling the one-way latch is refused.
|
||||
let (st, text) = req(
|
||||
&app,
|
||||
Method::PATCH,
|
||||
&format!("/api/sessions/{id}"),
|
||||
Some(serde_json::json!({"settings": {"memory_enabled": true}})),
|
||||
)
|
||||
.await;
|
||||
assert_eq!(st, StatusCode::BAD_REQUEST, "{text}");
|
||||
// The rejected enable did not persist: the session stays off.
|
||||
let (_, text) = req(&app, Method::GET, &format!("/api/sessions/{id}"), None).await;
|
||||
let v: serde_json::Value = serde_json::from_str(&text).unwrap();
|
||||
assert_eq!(v["settings"]["memory_enabled"], false);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn session_holds_context_and_persists_usage() {
|
||||
let (app, _store) = build_app().await;
|
||||
|
||||
Reference in new issue
Block a user