feat: chat sidebar and inbox, feat: saved chats, fix: wake jobs, fix: sandbox sends, ux: negotiation replies and draft box
This commit is contained in:
@@ -25,3 +25,33 @@ def test_memory_store_clear_selected_sections(tmp_path):
|
||||
assert snapshot["memories"] == []
|
||||
assert snapshot["conversations"] == []
|
||||
assert snapshot["profile"][0]["key"] == "configured_name"
|
||||
|
||||
|
||||
def test_memory_store_separates_chat_threads_but_keeps_shared_memories(tmp_path):
|
||||
store = MemoryStore(str(tmp_path / "memory.sqlite3"))
|
||||
first = store.create_thread("First")
|
||||
second = store.create_thread("Second")
|
||||
store.add_conversation("user", "first thread message", first["id"])
|
||||
store.add_conversation("user", "second thread message", second["id"])
|
||||
store.remember("preference", "Shared trading preference", importance=5)
|
||||
|
||||
first_rows = store.recent_conversation(thread_id=first["id"])
|
||||
second_rows = store.recent_conversation(thread_id=second["id"])
|
||||
|
||||
assert [row["content"] for row in first_rows] == ["first thread message"]
|
||||
assert [row["content"] for row in second_rows] == ["second thread message"]
|
||||
assert store.recall("trading preference")[0]["content"] == "Shared trading preference"
|
||||
|
||||
|
||||
def test_memory_store_renames_threads_and_deletes_outbox_items(tmp_path):
|
||||
store = MemoryStore(str(tmp_path / "memory.sqlite3"))
|
||||
thread = store.create_thread("New chat")
|
||||
store.add_outbox("Wake job result")
|
||||
inbox_id = store.list_outbox()[0]["id"]
|
||||
|
||||
renamed = store.rename_thread(thread["id"], " Market Check ")
|
||||
deleted = store.delete_outbox(inbox_id)
|
||||
|
||||
assert renamed["title"] == "Market Check"
|
||||
assert deleted is True
|
||||
assert store.list_outbox() == []
|
||||
|
||||
Reference in New Issue
Block a user