Spawn → complete → mark notified. Helper for the eligibility tests.
(reg: RuntimeTaskRegistry)
| 31 | |
| 32 | |
| 33 | def _make_terminal_notified(reg: RuntimeTaskRegistry) -> LocalAgentTaskState: |
| 34 | """Spawn → complete → mark notified. Helper for the eligibility |
| 35 | tests.""" |
| 36 | agent_id = generate_task_id("local_agent") |
| 37 | register_async_agent( |
| 38 | agent_id=agent_id, description="x", prompt="x", |
| 39 | agent_type="general-purpose", registry=reg, |
| 40 | ) |
| 41 | complete_agent_task(agent_id, result_text="done", registry=reg) |
| 42 | # Manually mark ``notified=True`` — the production path does this |
| 43 | # via ``enqueue_agent_notification``, but we test eviction in |
| 44 | # isolation here. |
| 45 | reg.update(agent_id, lambda prev: replace(prev, notified=True)) |
| 46 | return reg.get(agent_id) |
| 47 | |
| 48 | |
| 49 | # --------------------------------------------------------------------------- |
no test coverage detected