feat(memory): add workspace Dream prompt override
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -375,6 +375,15 @@ class TestSyncWorkspaceTemplates:
|
||||
|
||||
assert (workspace / "memory").exists() or (workspace / "skills").exists()
|
||||
|
||||
def test_creates_prompt_readme_without_dream_override(self, tmp_path):
|
||||
workspace = tmp_path / "workspace"
|
||||
|
||||
added = sync_workspace_templates(workspace, silent=True)
|
||||
|
||||
assert "prompts/README.md" in {path.replace("\\", "/") for path in added}
|
||||
assert (workspace / "prompts" / "README.md").exists()
|
||||
assert not (workspace / "prompts" / "dream.md").exists()
|
||||
|
||||
def test_returns_list_of_added_files(self, tmp_path):
|
||||
"""Should return list of relative paths for added files."""
|
||||
workspace = tmp_path / "workspace"
|
||||
|
||||
Reference in New Issue
Block a user