Skip to content

The agent that grows with you

refactor(state): spell the worker heal's unset created_source like the upsert

kshitijk4poor0909e430c0db
diff --git a/hermes_state_runtime.py b/hermes_state_runtime.py
index ffbfd0b7a22..00e667993ad 100644
--- a/hermes_state_runtime.py
+++ b/hermes_state_runtime.py
@@ -901,7 +901,7 @@ def _worker_usage(db, conn, session_id, payload, *, auxiliary=False):
if surfaced:
conn.execute(
"UPDATE sessions SET created_source=? WHERE id=? "
- "AND (created_source IS NULL OR created_source = 'unknown')",
+ "AND NULLIF(created_source, 'unknown') IS NULL",
(surfaced, session_id))
from hermes_state_compression import stamp_compression_ancestors
stamp_compression_ancestors(conn, session_id)