mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-16 03:31:10 +00:00
fix(heartbeat): add subagent guard to resolveHeartbeatSession production code
This commit is contained in:
@@ -44,7 +44,6 @@ import { CommandLane } from "../process/lanes.js";
|
||||
import {
|
||||
isSubagentSessionKey,
|
||||
normalizeAgentId,
|
||||
parseAgentSessionKey,
|
||||
resolveAgentIdFromSessionKey,
|
||||
toAgentStoreSessionKey,
|
||||
} from "../routing/session-key.js";
|
||||
@@ -593,11 +592,7 @@ export async function runHeartbeatOnce(opts: {
|
||||
}): Promise<HeartbeatRunResult> {
|
||||
const cfg = opts.cfg ?? loadConfig();
|
||||
const explicitAgentId = typeof opts.agentId === "string" ? opts.agentId.trim() : "";
|
||||
const forcedSessionAgentId =
|
||||
explicitAgentId.length > 0 ? undefined : parseAgentSessionKey(opts.sessionKey)?.agentId;
|
||||
const agentId = normalizeAgentId(
|
||||
explicitAgentId || forcedSessionAgentId || resolveDefaultAgentId(cfg),
|
||||
);
|
||||
const agentId = normalizeAgentId(explicitAgentId || resolveDefaultAgentId(cfg));
|
||||
const heartbeat = opts.heartbeat ?? resolveHeartbeatConfig(cfg, agentId);
|
||||
if (!areHeartbeatsEnabled()) {
|
||||
return { status: "skipped", reason: "disabled" };
|
||||
|
||||
Reference in New Issue
Block a user