From 9b092fd129b570837a0e2017607b422bc34c275a Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Mon, 13 Jul 2026 18:30:52 -0700 Subject: [PATCH] fix(orchestration): compare stale-dispatch timestamps with julianday (#8636) getStaleDispatches compared space-format datetime('now') columns (dispatched_at, last_heartbeat_at) against an ISO-Z threshold using raw TEXT ordering. The space (0x20) sorts below 'T' (0x54) at index 10, so every fresh same-UTC-date dispatch/heartbeat was ordered below the threshold and wrongly flagged stale, producing a false stale warning on each coordinator tick. Wrap both column comparisons and both bound threshold params in julianday(), which parses the space and ISO-Z formats as UTC for a correct numeric comparison. Fixes #8452 (cherry picked from commit 1d40312bf2eb83ebbe6079758578e81e97476a26) Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com> Co-authored-by: Orca