The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(cron): derive the live-owner stale bound only when a live-owned row is seen
kshitijk4poor2eb40f71d8c4
diff --git a/cron/executions.py b/cron/executions.pyindex c5fea3cfdd8..3ac83336127 100644--- a/cron/executions.py+++ b/cron/executions.py@@ -321,7 +321,10 @@ def recover_interrupted_executions() -> int:now = _hermes_now().isoformat()changed = 0recovered: List[Dict[str, Any]] = []- stale_after = _live_owner_stale_after_seconds()+ # Derived on the first live-owned row only: the bound reads config, and the idle gateway+ # tick must stay config-free (tests/cron/test_idle_tick_config_skip.py).+ stale_after: Optional[float] = None+ stale_after_resolved = Falsewith _transaction() as conn:rows = conn.execute("""SELECT id, status, process_id, pid, process_started_at,@@ -342,6 +345,9 @@ def recover_interrupted_executions() -> int:# NOT terminated here (leaked until host restart); rows owned by this process# (process_id == _PROCESS_ID, in-process runs) are skipped above and remain# out of scope.+ if not stale_after_resolved:+ stale_after = _live_owner_stale_after_seconds()+ stale_after_resolved = Trueif stale_after is None or _claim_age_seconds(row["claimed_at"]) <= stale_after:continuereason = _OWNER_WEDGED_REASON