feat(heartbeat): change default target to 'last' and remove target option from UI

This commit is contained in:
Abhimanyu Saharan
2026-02-15 01:37:12 +05:30
parent 55af799223
commit 0ac22dbd7a
6 changed files with 9 additions and 67 deletions

View File

@@ -235,10 +235,7 @@ def _update_agent_heartbeat(
if isinstance(raw, dict):
heartbeat.update(raw)
heartbeat["every"] = payload.every
if payload.target is not None:
heartbeat["target"] = payload.target
elif "target" not in heartbeat:
heartbeat["target"] = DEFAULT_HEARTBEAT_CONFIG.get("target", "none")
heartbeat["target"] = DEFAULT_HEARTBEAT_CONFIG.get("target", "last")
agent.heartbeat_config = heartbeat
agent.updated_at = utcnow()

View File

@@ -16,8 +16,6 @@ class BoardGroupHeartbeatApply(SQLModel):
# Heartbeat cadence string understood by the OpenClaw gateway
# (e.g. "2m", "10m", "30m").
every: str
# Optional heartbeat target (most deployments use "none").
target: str | None = None
include_board_leads: bool = False

View File

@@ -13,7 +13,7 @@ _GATEWAY_AGENT_SUFFIX = ":main"
DEFAULT_HEARTBEAT_CONFIG: dict[str, Any] = {
"every": "10m",
"target": "none",
"target": "last",
"includeReasoning": False,
}

View File

@@ -307,7 +307,7 @@ async def test_control_plane_upsert_agent_create_then_update(monkeypatch):
agent_id="board-agent-a",
name="Board Agent A",
workspace_path="/tmp/workspace-board-agent-a",
heartbeat={"every": "10m", "target": "none", "includeReasoning": False},
heartbeat={"every": "10m", "target": "last", "includeReasoning": False},
),
)
@@ -341,7 +341,7 @@ async def test_control_plane_upsert_agent_handles_already_exists(monkeypatch):
agent_id="board-agent-a",
name="Board Agent A",
workspace_path="/tmp/workspace-board-agent-a",
heartbeat={"every": "10m", "target": "none", "includeReasoning": False},
heartbeat={"every": "10m", "target": "last", "includeReasoning": False},
),
)