Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions solvent/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ def add_block(text: str) -> None:


def build_chat_system_prompt(channel: str = "cli") -> str:
"""Gateway/chat entry — private channels get MEMORY.md."""
session_kind = "main" if channel in ("cli", "telegram", "interactive", "dashboard") else "shared"
"""Gateway/chat entry — authenticated private channels get MEMORY.md."""
session_kind = "main" if channel in ("cli", "telegram", "interactive") else "shared"
return build_system_prompt(session_kind=session_kind)


Expand Down
10 changes: 10 additions & 0 deletions tests/test_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ def test_shared_session_skips_memory_file(self):
self.assertIn("SECRET_USER_FACT", main_prompt)
self.assertNotIn("SECRET_USER_FACT", shared_prompt)

def test_dashboard_chat_uses_shared_prompt_without_memory(self):
workspace.seed_workspace()
(workspace.workspace_path() / "MEMORY.md").write_text(
"DASHBOARD_PRIVATE_MEMORY_SECRET\n", encoding="utf-8"
)
cli_prompt = workspace.build_chat_system_prompt("cli")
dashboard_prompt = workspace.build_chat_system_prompt("dashboard")
self.assertIn("DASHBOARD_PRIVATE_MEMORY_SECRET", cli_prompt)
self.assertNotIn("DASHBOARD_PRIVATE_MEMORY_SECRET", dashboard_prompt)

def test_append_daily_memory(self):
workspace.seed_workspace()
path = workspace.append_daily_memory("test event")
Expand Down