Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

chore: files changed crates/openhuman-core/src/channels/tests/identity.rs,crates/openhuman-core/src/

Steven Enamakele80a37d11b1d
diff --git a/crates/openhuman-core/src/channels/tests/identity.rs b/crates/openhuman-core/src/channels/tests/identity.rs
index 40c6251fdc..88c6d8c589 100644
--- a/crates/openhuman-core/src/channels/tests/identity.rs
+++ b/crates/openhuman-core/src/channels/tests/identity.rs
@@ -23,13 +23,15 @@ fn openclaw_loads_workspace_markdown_files() {
prompt.contains("Name: OpenHuman"),
"IDENTITY.md content should be inlined"
);
+ // PROFILE.md and MEMORY.md were v1 memory artefacts. Memory v2 replaces
+ // both with `context.md`, injected as the first user message of a new
+ // session, so they are never inlined even when a workspace still has them.
assert!(
- prompt.contains("Name: Test User"),
- "PROFILE.md content should be inlined"
+ !prompt.contains("Name: Test User"),
+ "PROFILE.md must not be inlined"
);
- // MEMORY.md is optional (archivist-written). When present it should inline.
assert!(
- prompt.contains("User likes Rust"),
- "MEMORY.md content should be inlined when present"
+ !prompt.contains("User likes Rust"),
+ "MEMORY.md must not be inlined"
);
}
diff --git a/crates/openhuman-core/src/channels/tests/prompt.rs b/crates/openhuman-core/src/channels/tests/prompt.rs
index 0fa3767a9b..ba2962ab1f 100644
--- a/crates/openhuman-core/src/channels/tests/prompt.rs
+++ b/crates/openhuman-core/src/channels/tests/prompt.rs
@@ -59,11 +59,10 @@ fn prompt_injects_workspace_files() {
prompt.contains("Name: OpenHuman"),
"missing IDENTITY content"
);
- assert!(prompt.contains("### PROFILE.md"), "missing PROFILE.md");
- // MEMORY.md is optional — the archivist writes it over time. When present
- // in the workspace it should be inlined.
- assert!(prompt.contains("### MEMORY.md"), "missing MEMORY.md");
- assert!(prompt.contains("User likes Rust"), "missing MEMORY content");
+ // v1 memory files are never inlined; memory v2 injects `context.md`.
+ assert!(!prompt.contains("### PROFILE.md"), "PROFILE.md must not be inlined");
+ assert!(!prompt.contains("### MEMORY.md"), "MEMORY.md must not be inlined");
+ assert!(!prompt.contains("User likes Rust"), "MEMORY content must not leak");
}
#[test]
@@ -89,27 +88,17 @@ fn prompt_missing_file_markers() {
}
#[test]
-fn prompt_memory_only_if_exists() {
+fn prompt_never_inlines_v1_memory_files() {
let tmp = TempDir::new().unwrap();
- // Seed the bundled identity files but leave MEMORY.md absent.
std::fs::write(tmp.path().join("SOUL.md"), "# Soul").unwrap();
std::fs::write(tmp.path().join("IDENTITY.md"), "# Identity").unwrap();
std::fs::write(tmp.path().join("PROFILE.md"), "# User Profile").unwrap();
+ std::fs::write(tmp.path().join("MEMORY.md"), "# Memory\nLearned bits.").unwrap();
let prompt = build_system_prompt(tmp.path(), "model", &[], &[], None, Some("Discord"));
- assert!(
- !prompt.contains("### MEMORY.md"),
- "MEMORY.md should not appear when missing"
- );
-
- // Create MEMORY.md — should appear.
- std::fs::write(tmp.path().join("MEMORY.md"), "# Memory\nLearned bits.").unwrap();
- let prompt2 = build_system_prompt(tmp.path(), "model", &[], &[], None, Some("Discord"));
- assert!(
- prompt2.contains("### MEMORY.md"),
- "MEMORY.md should appear when present"
- );
- assert!(prompt2.contains("Learned bits"));
+ assert!(!prompt.contains("### PROFILE.md"));
+ assert!(!prompt.contains("### MEMORY.md"));
+ assert!(!prompt.contains("Learned bits"));
}
#[test]