openclaw - 💡(How to fix) Fix [Feature Request] Support heartbeat.model configuration to use separate lightweight model for heartbeats [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#49452Fetched 2026-04-08 00:55:06
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0

Code Example

{
  "agents": {
    "defaults": {
      "heartbeat": {
        "model": "anthropic/claude-opus-4-6",
        "every": "30m",
        "prompt": "Read HEARTBEAT.md..."
      }
    }
  }
}

---

{
  "agents": {
    "list": [
      {
        "id": "main",
        "model": "vllm/Qwen3.5-35B-A3B-FP8",
        "heartbeat": {
          "model": "qwen1.7b/Qwen3-1.7B-CPU",
          "every": "30m",
          "prompt": "Read HEARTBEAT.md. If no issues, reply: HEARTBEAT_OK."
        }
      }
    ]
  }
}
RAW_BUFFERClick to expand / collapse

Current Status

The OpenClaw documentation confirms the existence of heartbeat.model configuration field: https://docs.openclaw.ai/gateway/heartbeat

{
  "agents": {
    "defaults": {
      "heartbeat": {
        "model": "anthropic/claude-opus-4-6",
        "every": "30m",
        "prompt": "Read HEARTBEAT.md..."
      }
    }
  }
}

Issue Being Reported

Expected Behavior

The heartbeat.model configuration should allow users to specify a different, lightweight model for heartbeat checks. This is crucial for:

  • Reducing token usage
  • Lower costs
  • Faster heartbeat responses
  • Using CPU-only models for periodic checks

Actual Behavior

Currently, heartbeat messages are processed using the main agent's model configuration, not the specified heartbeat.model.

Configuration Example

User has configured (correctly per docs):

{
  "agents": {
    "list": [
      {
        "id": "main",
        "model": "vllm/Qwen3.5-35B-A3B-FP8",
        "heartbeat": {
          "model": "qwen1.7b/Qwen3-1.7B-CPU",
          "every": "30m",
          "prompt": "Read HEARTBEAT.md. If no issues, reply: HEARTBEAT_OK."
        }
      }
    ]
  }
}

Expected: Heartbeats use Qwen3-1.7B-CPU (lightweight CPU model)
Actual: Heartbeats use Qwen3.5-35B-A3B-FP8 (main GPU model)

Impact

  1. Cost: High-cost model runs every 30 minutes for simple health checks
  2. Performance: Heavy models are slower for simple status updates
  3. Inefficiency: The heartbeat.model field exists but is completely ignored

Proposed Solution

The heartbeat.ts implementation should:

  1. Check for agents.list[*].heartbeat.model configuration
  2. Use this model if specified (not just the main model)
  3. Fall back to main model if not specified (backward compatibility)

Files to Check

  • src/auto-reply/heartbeat.ts (currently uses main model)
  • src/auto-reply/heartbeat-summary.ts
  • src/infra/heartbeat-summary.ts

This is a feature request to implement the documented heartbeat.model configuration field.

extent analysis

Fix Plan

To implement the heartbeat.model configuration field, follow these steps:

  • Update the heartbeat.ts file to check for the agents.list[*].heartbeat.model configuration.
  • Use the specified model for heartbeat checks if it exists, otherwise fall back to the main model.

Example code changes:

// src/auto-reply/heartbeat.ts
import { AgentConfig } from '../types';

// ...

const getHeartbeatModel = (agentConfig: AgentConfig) => {
  return agentConfig.heartbeat?.model || agentConfig.model;
};

// ...

const model = getHeartbeatModel(agentConfig);
// Use the model for heartbeat checks
  • Update the heartbeat-summary.ts files to reflect the changes:
// src/auto-reply/heartbeat-summary.ts
import { getHeartbeatModel } from './heartbeat';

// ...

const model = getHeartbeatModel(agentConfig);
// Use the model for heartbeat summary

Verification

To verify the fix, follow these steps:

  • Configure the heartbeat.model field in the agent configuration.
  • Run the heartbeat check and verify that the specified model is used.
  • Remove the heartbeat.model field and verify that the main model is used as a fallback.

Example test case:

{
  "agents": {
    "list": [
      {
        "id": "main",
        "model": "vllm/Qwen3.5-35B-A3B-FP8",
        "heartbeat": {
          "model": "qwen1.7b/Qwen3-1.7B-CPU",
          "every": "30m",
          "prompt": "Read HEARTBEAT.md. If no issues, reply: HEARTBEAT_OK."
        }
      }
    ]
  }
}

Verify that the qwen1.7b/Qwen3-1.7B-CPU model is used for heartbeat checks.

Extra Tips

  • Make sure to update the documentation to reflect the changes.
  • Consider adding logging or monitoring to track the usage of the heartbeat.model field.
  • Test the changes thoroughly to ensure backward compatibility and correct behavior.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Feature Request] Support heartbeat.model configuration to use separate lightweight model for heartbeats [1 participants]