openclaw - 💡(How to fix) Fix Heartbeat config written to invalid `gateway.heartbeat` location instead of `agents.defaults.heartbeat` [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#43728Fetched 2026-04-08 00:17:25
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×1

When configuring heartbeat settings, OpenClaw writes the configuration to gateway.heartbeat which is not a valid schema key. This causes the gateway to abort on startup with a schema validation error. Running openclaw doctor --fix removes the invalid key, but the issue recurs when heartbeat settings are modified again.


Error Message

When configuring heartbeat settings, OpenClaw writes the configuration to gateway.heartbeat which is not a valid schema key. This causes the gateway to abort on startup with a schema validation error. Running openclaw doctor --fix removes the invalid key, but the issue recurs when heartbeat settings are modified again. 4. Gateway fails to start with error:

Root Cause

When configuring heartbeat settings, OpenClaw writes the configuration to gateway.heartbeat which is not a valid schema key. This causes the gateway to abort on startup with a schema validation error. Running openclaw doctor --fix removes the invalid key, but the issue recurs when heartbeat settings are modified again.


Fix Action

Workaround

Run openclaw doctor --fix to remove the invalid key. However, this is only temporary - any subsequent modification to heartbeat settings will reintroduce the issue.


Code Example

Config invalid
   gateway: Unrecognized key: "heartbeat"
   Gateway aborted: config is invalid.

---

{
  "gateway": {
    "auth": { ... },
    "bind": "loopback",
    "heartbeat": {
      "lightContext": true,
      "model": "google/gemini-3.1-flash-lite-preview",
      "activeHours": {
        "start": "08:00",
        "end": "23:00"
      }
    },
    "mode": "local",
    ...
  }
}

---

{
  "gateway": {
    // heartbeat removed (correct - schema doesn't allow it)
  },
  "agents": {
    "defaults": {
      "heartbeat": null
    }
  }
}

---

2026-03-12T01:25:58.378-04:00 config reload skipped (invalid config): gateway: Unrecognized key: "heartbeat"
2026-03-12T01:26:47.730-04:00 Gateway aborted: config is invalid.
2026-03-12T01:26:47.730-04:00 gateway: Unrecognized key: "heartbeat"
2026-03-12T01:26:47.730-04:00 Fix the config and retry, or run "openclaw doctor" to repair.
RAW_BUFFERClick to expand / collapse

GitHub Issue Draft

Repository: openclaw/openclaw Created: 2026-03-12 Status: Ready to submit


Title

Heartbeat config written to invalid gateway.heartbeat location instead of agents.defaults.heartbeat

Labels

bug, config, regression


Summary

When configuring heartbeat settings, OpenClaw writes the configuration to gateway.heartbeat which is not a valid schema key. This causes the gateway to abort on startup with a schema validation error. Running openclaw doctor --fix removes the invalid key, but the issue recurs when heartbeat settings are modified again.


Steps to Reproduce

  1. Start OpenClaw gateway
  2. Modify heartbeat configuration (e.g., change lightContext, model, or activeHours)
  3. Restart the gateway
  4. Gateway fails to start with error:
    Config invalid
    gateway: Unrecognized key: "heartbeat"
    Gateway aborted: config is invalid.

Expected Behavior

Heartbeat configuration should be written to agents.defaults.heartbeat which is the valid location in the schema.


Actual Behavior

Heartbeat configuration is incorrectly written to gateway.heartbeat, causing schema validation failure and gateway abort.


Evidence

Backup file (.bak.2) shows invalid location:

{
  "gateway": {
    "auth": { ... },
    "bind": "loopback",
    "heartbeat": {
      "lightContext": true,
      "model": "google/gemini-3.1-flash-lite-preview",
      "activeHours": {
        "start": "08:00",
        "end": "23:00"
      }
    },
    "mode": "local",
    ...
  }
}

After doctor --fix, the key is removed but not migrated:

{
  "gateway": {
    // heartbeat removed (correct - schema doesn't allow it)
  },
  "agents": {
    "defaults": {
      "heartbeat": null
    }
  }
}

Log excerpts showing the failure:

2026-03-12T01:25:58.378-04:00 config reload skipped (invalid config): gateway: Unrecognized key: "heartbeat"
2026-03-12T01:26:47.730-04:00 Gateway aborted: config is invalid.
2026-03-12T01:26:47.730-04:00 gateway: Unrecognized key: "heartbeat"
2026-03-12T01:26:47.730-04:00 Fix the config and retry, or run "openclaw doctor" to repair.

Workaround

Run openclaw doctor --fix to remove the invalid key. However, this is only temporary - any subsequent modification to heartbeat settings will reintroduce the issue.


Environment

  • OpenClaw Version: 2026.3.8
  • Node Version: 22.22.0
  • Platform: macOS (Darwin 25.3.0 arm64)
  • Config file: ~/.openclaw/openclaw.json

Additional Context

The issue appears to be in the config write/migration logic that persists heartbeat settings. The valid schema path is agents.defaults.heartbeat but the code writes to gateway.heartbeat.

The doctor --fix command correctly identifies and removes the invalid key but does not migrate the configuration to the correct location.


Suggested Fix

  1. Audit all config write paths that set heartbeat settings
  2. Ensure writes go to agents.defaults.heartbeat not gateway.heartbeat
  3. Consider adding migration logic in doctor --fix to move existing gateway.heartbeat configs to agents.defaults.heartbeat

extent analysis

Fix Plan

To resolve the issue, we need to update the configuration write logic to use the correct schema path. Here are the steps:

  • Update the configuration write logic to use agents.defaults.heartbeat instead of gateway.heartbeat.
  • Add migration logic to doctor --fix to move existing gateway.heartbeat configurations to agents.defaults.heartbeat.

Code Changes

// Update config write logic
function writeHeartbeatConfig(config) {
  // Use the correct schema path
  config.agents.defaults.heartbeat = {
    lightContext: true,
    model: 'google/gemini-3.1-flash-lite-preview',
    activeHours: {
      start: '08:00',
      end: '23:00'
    }
  };
  // Remove the invalid key
  delete config.gateway.heartbeat;
}

// Add migration logic to doctor --fix
function migrateHeartbeatConfig(config) {
  if (config.gateway && config.gateway.heartbeat) {
    // Migrate the configuration to the correct location
    config.agents.defaults.heartbeat = config.gateway.heartbeat;
    // Remove the invalid key
    delete config.gateway.heartbeat;
  }
}

Verification

To verify the fix, follow these steps:

  • Run openclaw doctor --fix to migrate any existing configurations.
  • Modify the heartbeat settings and restart the gateway.
  • Check the configuration file to ensure that the heartbeat settings are written to the correct location (agents.defaults.heartbeat).
  • Verify that the gateway starts successfully without any schema validation errors.

Extra Tips

  • Make sure to test the fix thoroughly to ensure that it resolves the issue and does not introduce any new problems.
  • Consider adding additional logging or monitoring to detect any future configuration issues.
  • Review the code changes to ensure that they are consistent with the existing codebase and follow best practices.

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 Heartbeat config written to invalid `gateway.heartbeat` location instead of `agents.defaults.heartbeat` [1 participants]