Notify-before-evict guard. A terminal task whose parent hasn't been told yet must NOT be evicted — losing the entry would lose the `` `` envelope.
()
| 109 | |
| 110 | |
| 111 | def test_not_eligible_when_not_notified() -> None: |
| 112 | """Notify-before-evict guard. A terminal task whose parent hasn't |
| 113 | been told yet must NOT be evicted — losing the entry would lose |
| 114 | the ``<task-notification>`` envelope.""" |
| 115 | reg = RuntimeTaskRegistry() |
| 116 | agent_id = generate_task_id("local_agent") |
| 117 | register_async_agent( |
| 118 | agent_id=agent_id, description="x", prompt="x", |
| 119 | agent_type="general-purpose", registry=reg, |
| 120 | ) |
| 121 | complete_agent_task(agent_id, result_text="done", registry=reg) |
| 122 | # ``notified`` left at False (deliberately). |
| 123 | state = reg.get(agent_id) |
| 124 | now = (state.evict_after or 0) + 100 |
| 125 | assert is_eligible_for_eviction(state, now=now) is False |
| 126 | |
| 127 | |
| 128 | def test_not_eligible_when_running() -> None: |
nothing calls this directly
no test coverage detected