feat: add thread info and status reads

This commit is contained in:
lda committed 2026-09-24 04:51:32 +07:00 Verified
1 parent 726f0c8b2a
commit d1fba584aa
16 files changed
+496 -33

No files matched your search

+18
View File
@@ -39,3 +39,21 @@ def test_ops_join_and_delete():
assert c in t2.participants
ops.delete_agent(s, c.id)
assert s.get_agent_by_id(c.id) is None
def test_ops_thread_info_and_read_state():
s = InMemoryStore()
a = ops.get_or_create_agent(s, "A")
b = ops.get_or_create_agent(s, "B")
t = ops.create_thread(s, {a, b})
latest = ops.append_message(s, t.id, a, "hello")
info = ops.get_thread_info(s, t.id)
state = ops.get_thread_read_state(s, t.id, b)
assert info is not None
assert info.thread == t
assert info.latest_message == latest
assert state.agent == b
assert state.unread_count == 1
assert state.unread_from_others_count == 1