fix(heartbeat): retain history after empty runs

This commit is contained in:
chengyongru
2026-07-15 01:19:48 +08:00
committed by chengyongru
parent dcb37259fa
commit 63a6d5d07d
2 changed files with 108 additions and 5 deletions
+5 -5
View File
@@ -1860,16 +1860,16 @@ def _run_gateway(
if isinstance(message_tool, MessageTool) and suppress_token is not None:
message_tool.reset_suppress_delivery(suppress_token)
if not resp or not resp.content:
return
response = resp.content
# Keep a small tail of heartbeat history so the loop stays bounded.
session = agent.sessions.get_or_create("heartbeat")
session.retain_recent_legal_suffix(hb_cfg.keep_recent_messages)
agent.sessions.save(session)
if not resp or not resp.content:
return
response = resp.content
evaluator_prompt = resolve_evaluator_prompt(config.workspace_path)
# Fail closed: stay silent on evaluator failure instead of notifying.