feat(jobs): t3code events go back to the dispatching conversation, quiet branches close at night

This commit is contained in:
hh committed 2026-10-23 22:25:12 +02:00
1 parent 2bf2326178
commit 6db6c7b6ec
3 files changed
+43 -3

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
from typing import Any
from beaver_agent.jobs.t3code import t3code_event
class FakeRun:
def __init__(self, payload: dict[str, Any]) -> None:
self.payload = payload
self.injects: list[tuple[str | None, str, str, str]] = []
async def inject_into(
self, public_id: str | None, text: str, *, urgency: str, origin: str
) -> bool:
self.injects.append((public_id, text, urgency, origin))
return True
async def test_the_event_goes_to_the_conversation_that_dispatched() -> None:
run = FakeRun(
{
"event": "completed",
"thread_id": "t1",
"title": "lint",
"machine": "mac",
"project": "beaver",
"origin": "conv-7",
"text": "done",
}
)
await t3code_event(run) # ty: ignore[invalid-argument-type]
[(target, text, urgency, origin)] = run.injects
assert (target, urgency, origin) == ("conv-7", "urgent", "t3code")
assert "завершён" in text and "done" in text