mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-02 14:28:59 +02:00
[eric] tests: follow the code the file splits moved, without loosening any assertion
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018foyDoK19jjbYdudfzQVkZ
This commit is contained in:
co-authored by
Claude Opus 5
parent
857a374bf0
commit
164956965e
@@ -46,7 +46,9 @@ def test_the_cli_missing_class_specifically_is_covered():
|
||||
def test_silent_quit_diagnostic_carries_a_full_envelope():
|
||||
"""A silent quit is the hardest class to diagnose later, so it must not ship envelope-less.
|
||||
Found live: empty_finish_nudge was the ONE family writing only kind/model/session_id."""
|
||||
import backend.apps.agents.manager.run.empty_finish as ef
|
||||
src = inspect.getsource(ef.maybe_nudge_empty_finish) if hasattr(ef, "maybe_nudge_empty_finish") else inspect.getsource(ef)
|
||||
# The telemetry moved next door when empty_finish.py crossed the 300-line ceiling; the assertion
|
||||
# is about the ENVELOPE, so it follows the code rather than pinning a file name.
|
||||
import backend.apps.agents.manager.run.empty_finish_telemetry as ef
|
||||
src = inspect.getsource(ef.report_nudge)
|
||||
assert "build_envelope" in src, "empty_finish_nudge must attach a flight envelope"
|
||||
assert '"flight"' in src, "the envelope must ride under the standard 'flight' key"
|
||||
|
||||
@@ -16,6 +16,7 @@ from backend.apps.agents.agents import close_session as user_close_route
|
||||
from backend.apps.agents.agents import stop_agent as user_stop_route
|
||||
from backend.apps.agents.core.models import AgentSession
|
||||
from backend.apps.agents.manager.streaming import unwedge_sidecar
|
||||
from backend.apps.agents.manager.streaming import delegation_watchdog
|
||||
|
||||
|
||||
def p_live(name="t") -> AgentSession:
|
||||
@@ -58,7 +59,7 @@ def test_a_user_stopped_parent_is_never_a_lost_result():
|
||||
child.status = "stopped"
|
||||
agent_manager.sessions[child.id] = child
|
||||
asyncio.run(user_stop_route(parent.id))
|
||||
assert unwedge_sidecar.delegation_children_settled(parent.id, 0.0) is False
|
||||
assert delegation_watchdog.delegation_children_settled(parent.id, 0.0) is False
|
||||
|
||||
|
||||
def test_a_genuinely_lost_result_still_settles():
|
||||
@@ -70,7 +71,7 @@ def test_a_genuinely_lost_result_still_settles():
|
||||
child.parent_session_id = parent.id
|
||||
child.status = "completed"
|
||||
agent_manager.sessions[child.id] = child
|
||||
assert unwedge_sidecar.delegation_children_settled(parent.id, 0.0) is True
|
||||
assert delegation_watchdog.delegation_children_settled(parent.id, 0.0) is True
|
||||
|
||||
|
||||
# --- DOOR 2: a machine send into a stopped or closed session -------------------------------------
|
||||
@@ -81,7 +82,7 @@ def test_the_watchdog_resend_cannot_restart_a_user_stopped_session():
|
||||
asyncio.run(user_stop_route(s.id))
|
||||
started, real = p_spy_loop()
|
||||
try:
|
||||
asyncio.run(unwedge_sidecar.force_recover(s.id, s))
|
||||
asyncio.run(delegation_watchdog.force_recover(s.id, s))
|
||||
finally:
|
||||
agent_manager.run_agent_loop = real
|
||||
assert started == []
|
||||
@@ -93,7 +94,7 @@ def test_the_watchdog_resend_still_fires_on_a_session_nobody_stopped():
|
||||
s = p_live()
|
||||
started, real = p_spy_loop()
|
||||
try:
|
||||
asyncio.run(unwedge_sidecar.force_recover(s.id, s))
|
||||
asyncio.run(delegation_watchdog.force_recover(s.id, s))
|
||||
finally:
|
||||
agent_manager.run_agent_loop = real
|
||||
assert started == [s.id]
|
||||
|
||||
Reference in New Issue
Block a user