kimi wang 3244d4a8ff
fix(managed-subagents): make signature() change when an update lands in one clock tick (#8035) (#8076)
* fix(managed-subagents): make signature() change when an update lands in one clock tick

SqlManagedSubagentStore.signature() returns the tuple of (id, updated_at), so
a definition change is only visible to peer processes when the row's stamp
moves. The ORM onupdate callback reads the wall clock, which has ~15.6 ms
resolution on Windows and can also sit behind a stamp written by a node with
a skewed clock. In both cases the new value equals or precedes the stored one
and the registry snapshot is never invalidated.

Force updated_at strictly forward in update(): normalise SQLite's naive
datetime to UTC and, when the clock has not advanced past the stored value,
bump it by one microsecond. Add a regression test that freezes both clocks to
the stored timestamp; it fails without the fix (signature unchanged) and
passes with it.

Refs #8035

* fix(managed-subagents): serialize signature timestamp updates

---------

Co-authored-by: wangkangmao <wangkangmao@users.noreply.github.com>
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-13 13:55:36 +08:00
..