diff --git a/ouroboros/claudexor_daemon.py b/ouroboros/claudexor_daemon.py index 581a929fc..2eb969736 100644 --- a/ouroboros/claudexor_daemon.py +++ b/ouroboros/claudexor_daemon.py @@ -970,7 +970,13 @@ def warm_owned_daemon() -> bool: def warm() -> None: try: - ensure_owned_gateway().close() + # Warmup is the host's speculative join, so give an already + # custodied daemon enough room to finish journal admission after + # its control socket appears. A normal caller keeps the shorter + # admission window; expiry still leaves custody intact and the + # first real caller simply joins the same startup. + warmup_admission_wait = max(_ADMISSION_WAIT_SEC, _SPAWN_WAIT_SEC * 2.0) + ensure_owned_gateway(admission_wait_sec=warmup_admission_wait).close() except Exception: log.info("Owned daemon warmup did not reach readiness; the first caller starts or joins", exc_info=True) diff --git a/tests/test_manual_restart_execution.py b/tests/test_manual_restart_execution.py index e14f280ce..6103a3fd4 100644 --- a/tests/test_manual_restart_execution.py +++ b/tests/test_manual_restart_execution.py @@ -246,7 +246,7 @@ def test_warmup_is_one_background_ensure_for_a_provisioned_home_only(restart_roo descriptor.write_text("{}") assert owned.warm_owned_daemon() is True _join_warmup_thread() - assert ensures == [("ensure", {}), "closed"] + assert ensures == [("ensure", {"admission_wait_sec": 40.0}), "closed"] def unreachable(**kw): raise RuntimeError("fixture daemon down")