fix: remove unused agent arg from App.poll

This commit is contained in:
lda
2026-09-01 03:09:38 +07:00 Verified
parent e6071994c7
commit 921735dbcb
3 changed files with 3 additions and 5 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ class App:
def append(self, tid: uuid.UUID, sender: Agent, content: str):
return ops.append_message(self.store, tid, sender, content)
def poll(self, tid: uuid.UUID, agent: Agent, after_seq: int = 0):
def poll(self, tid: uuid.UUID, after_seq: int = 0) -> list:
return ops.list_messages(self.store, tid, after_seq)
def mark_read(self, tid: uuid.UUID, agent: Agent, seq: int) -> None:
+1 -3
View File
@@ -71,9 +71,7 @@ def poll(thread_id: str, after_seq: int = 0) -> list[dict]:
"""Poll messages in a thread after seq."""
from uuid import UUID
# poll doesn't need agent for cursor; use raw store list for simplicity
msgs = _app.poll(UUID(thread_id), _app.get_or_create_agent("__poll__"), after_seq)
# filter out the dummy poll agent if it ever sent (it never does)
msgs = _app.poll(UUID(thread_id), after_seq)
return [
{
"seq": m.seq,
+1 -1
View File
@@ -9,7 +9,7 @@ def test_app_facade_with_memory():
t = app.create_thread(alice, bob)
app.append(t.id, alice, "hello")
assert app.has_unread(t.id, bob) is True
msgs = app.poll(t.id, bob)
msgs = app.poll(t.id)
assert len(msgs) == 1
app.mark_read(t.id, bob, msgs[0].seq)
assert app.has_unread(t.id, bob) is False