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 1d40312bf2)

Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com>
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Jinjing
2026-07-13 18:30:52 -07:00
committed by GitHub
co-authored by Neil Orca
parent 2266c1b03a
commit 9b092fd129

Diff Content Not Available