Create Relay Bot MVP
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
from datetime import UTC, datetime
|
||||
from types import SimpleNamespace
|
||||
|
||||
from app.memory.context_builder import ContextBuilder
|
||||
|
||||
|
||||
def test_context_keeps_summary_and_newest_messages_within_limit() -> None:
|
||||
builder = ContextBuilder(token_limit=100)
|
||||
summary = SimpleNamespace(text="goal: keep deployment simple")
|
||||
messages = [
|
||||
SimpleNamespace(sent_at=datetime.now(UTC), user_name="A", text="old " * 20),
|
||||
SimpleNamespace(sent_at=datetime.now(UTC), user_name="B", text="new fact"),
|
||||
]
|
||||
result = builder.build(summary, messages)
|
||||
assert "goal" in result
|
||||
assert "new fact" in result
|
||||
Reference in New Issue
Block a user