From de1973fbff0d6b4855d770d88bdc69cb2b23df7b Mon Sep 17 00:00:00 2001 From: momentum dev Date: Wed, 22 Jul 2026 19:36:19 -0500 Subject: [PATCH] fix: telemetry heartbeat insert needs an explicit uuid id (NOT NULL, no default) Co-Authored-By: Claude Fable 5 --- nightly_tune.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nightly_tune.py b/nightly_tune.py index c19dd28..b114eb3 100644 --- a/nightly_tune.py +++ b/nightly_tune.py @@ -46,10 +46,11 @@ def _write_heartbeat(outcome: str) -> None: # The DB row is queryable remotely and survives container churn. try: con = open_research_db("market") + import uuid con.execute( - "INSERT INTO telemetry_events (event_type, source, reason, metadata_json) " - "VALUES (?, ?, ?, ?)", - ["tuner_heartbeat", "nightly_tune", outcome, + "INSERT INTO telemetry_events (id, event_type, source, reason, metadata_json) " + "VALUES (?, ?, ?, ?, ?)", + [str(uuid.uuid4()), "tuner_heartbeat", "nightly_tune", outcome, json.dumps({"ran_at": datetime.now(timezone.utc).isoformat()})]) except Exception: # noqa: BLE001 pass