MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / test_not_eligible_when_not_notified

Function test_not_eligible_when_not_notified

tests/test_eviction.py:111–125  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

109
110
111def 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
128def test_not_eligible_when_running() -> None:

Callers

nothing calls this directly

Calls 6

getMethod · 0.95
RuntimeTaskRegistryClass · 0.90
generate_task_idFunction · 0.90
register_async_agentFunction · 0.90
complete_agent_taskFunction · 0.90
is_eligible_for_evictionFunction · 0.90

Tested by

no test coverage detected