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:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user