feat(memory): add workspace Dream prompt override

This commit is contained in:
chengyongru
2026-07-03 00:41:51 +08:00
committed by Xubin Ren
parent 5af22042ec
commit f38fd7d5d3
22 changed files with 295 additions and 10 deletions
+28
View File
@@ -61,6 +61,34 @@ class TestBuildDreamPrompt:
prompt, _ = result
assert "skill-creator" in prompt
def test_workspace_dream_prompt_overrides_default(self, store):
store.dream_prompt_file.parent.mkdir(parents=True)
store.dream_prompt_file.write_text(
"Custom Dream prompt.",
encoding="utf-8",
)
store.append_history("keep this fact")
result = store.build_dream_prompt()
assert result is not None
prompt, _ = result
assert prompt.startswith("Custom Dream prompt.")
assert "memory consolidation engine" not in prompt
assert "## Conversation History" in prompt
assert "keep this fact" in prompt
def test_empty_workspace_dream_prompt_uses_default(self, store):
store.dream_prompt_file.parent.mkdir(parents=True)
store.dream_prompt_file.write_text(" \n", encoding="utf-8")
store.append_history("test")
result = store.build_dream_prompt()
assert result is not None
prompt, _ = result
assert "memory consolidation engine" in prompt
def test_truncates_long_entries(self, store):
long_content = "x" * 2000
store.append_history(long_content)