From 8af0c0360f0c8ec0b9c4ce61a23cfa68adfcf23d Mon Sep 17 00:00:00 2001 From: "Bernd (Hermes)" Date: Sat, 15 Aug 2026 10:10:35 +0200 Subject: [PATCH] fix(P-074c): gateway_state.json updated_at ist ISO-String, nicht Unix-Float MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit P-074a Pfad-Fix hat gateway_state.json erstmals korrekt gefunden — dadurch lief der bislang tote Stale-Check (Zeile 622) erstmals. updated_at im realen Core-Schema ist ISO-String ('2026-08-15T08:09:34.985914+00:00'), nicht Unix-Float. TypeError: unsupported operand type(s) for -: 'float' and 'str'. Fix: ISO-String vor Subtraktion via datetime.fromisoformat().timestamp() parsen, graceful fallback auf 0 bei Parse-Fehler. --- plugin/crash_forensics.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugin/crash_forensics.py b/plugin/crash_forensics.py index a94aa59..9aa5e67 100644 --- a/plugin/crash_forensics.py +++ b/plugin/crash_forensics.py @@ -619,6 +619,17 @@ async def check_for_predecessor_crash() -> Optional[str]: gateway_state_stale = False if gateway_state and heartbeat: updated_at = gateway_state.get("updated_at", 0) + # P-074c: updated_at ist im realen Core-Schema ein ISO-String + # (z.B. "2026-08-15T08:09:34.985914+00:00"), kein Unix-Float. + # Vor dem Pfad-Fix war gateway_state immer None (Pfad-Mismatch), + # daher lief dieser Code nie — der Typ-Bug war latent. + if isinstance(updated_at, str): + try: + updated_at = datetime.fromisoformat( + updated_at.replace("Z", "+00:00") + ).timestamp() + except (ValueError, TypeError): + updated_at = 0 if updated_at and (heartbeat_ts - updated_at) > GATEWAY_STATE_STALE_S: gateway_state_stale = True logger.info(