refactor(goals): share one dropped-write warning across managers

Review fixups for #88965. The goal, loop, and heartbeat managers each
had a copy of the same WARNING text. The shared _warn_dropped_write
helper in goals.py keeps the three logs identical and greppable as one
bug class. The _warm_goals_session_db parameter is now label. The old
name ctx said context, but the value is a log label.
This commit is contained in:
ethernet
2026-08-18 17:55:29 -04:00
committed by Teknium
parent 46d8cf0be3
commit 6e67841a9a
4 changed files with 25 additions and 20 deletions
+3 -6
View File
@@ -184,12 +184,9 @@ def save_heartbeat(session_id: str, state: HeartbeatState) -> None:
return
db = _get_session_db()
if db is None:
logger.warning(
"HeartbeatManager: heartbeat for %s not persisted — session "
"DB unavailable (bootstrap window exceeded, in-memory state "
"still active)",
session_id,
)
from hermes_cli.goals import _warn_dropped_write
_warn_dropped_write("HeartbeatManager", "heartbeat", session_id)
return
try:
db.set_meta(_meta_key(session_id), state.to_json())