fix: Make HEARTBEAT.md creation match documentation#11807
Draft
HenryLoenwind wants to merge 1 commit intoopenclaw:mainfrom
Draft
fix: Make HEARTBEAT.md creation match documentation#11807HenryLoenwind wants to merge 1 commit intoopenclaw:mainfrom
HenryLoenwind wants to merge 1 commit intoopenclaw:mainfrom
Conversation
6 tasks
This was referenced Feb 14, 2026
Contributor
|
Thanks for calling this out. |
Contributor
|
I'm going to let Peter handle this one since it has to do with HEARTBEAT.md and onboarding. |
Contributor
Author
No problem, it was pretty obvious to me as I created the original issue. In the long run, heuristics like this will have to go, I think. They are hard to understand for people, and while "it just works after install" is nice, things break when people start to tweak stuff that is "black box magic". In the end, I can see a point where heartbeats only run when they are put into the config explicitely, and don't care about the files. For now, I think moving the file created down two lines to be with the bootstrap creation makes the most sense. |
bfc1ccb to
f92900f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #11766 - Missing HEARTBEAT.md behaviour doesn't match documentation
Summary
The documentation states that "If the file is missing, the heartbeat still runs and the model decides what to do." However, the actual behavior was that a missing HEARTBEAT.md disabled the heartbeat completely because OpenClaw silently created an empty one. This commit fixes the logic to match the documented behavior by creating HEARTBEAT.md only when the workspace is brand new, ensuring existing workspaces with missing HEARTBEAT.md files can still execute heartbeats as intended.
Change
Moved the HEARTBEAT.md creation inside the
isBrandNewWorkspacecheck to prevent overwriting or creating empty files in existing workspaces.Impact
This change technically is a behavioural change, but it now matches what the documentation promises, i.e. exactly what users expect.
Testing
pnpm check and test passed
Greptile Overview
Greptile Summary
This PR adjusts workspace bootstrapping so
HEARTBEAT.mdis only created for brand new workspaces (inside theisBrandNewWorkspacebranch) rather than being created opportunistically whenever it’s missing.That aligns
ensureAgentWorkspace(src/agents/workspace.ts) with the heartbeat runner behavior (src/infra/heartbeat-runner.ts), which explicitly proceeds whenHEARTBEAT.mdis absent (letting the model decide) but skips when the file exists and is “effectively empty.”Confidence Score: 5/5