diff --git a/.openclaw-sync/source.json b/.openclaw-sync/source.json index ae1334d4c..58a1f9519 100644 --- a/.openclaw-sync/source.json +++ b/.openclaw-sync/source.json @@ -1,5 +1,5 @@ { "repository": "openclaw/openclaw", - "sha": "8fae1825319bb77192b2bb1950dfe062921c698d", - "syncedAt": "2026-04-07T23:09:49.987Z" + "sha": "51633fc13a553c831cf7ec4a4dbe38e9bef6fec0", + "syncedAt": "2026-04-07T23:52:29.002Z" } diff --git a/docs/concepts/system-prompt.md b/docs/concepts/system-prompt.md index 5f1136d37..463f1888a 100644 --- a/docs/concepts/system-prompt.md +++ b/docs/concepts/system-prompt.md @@ -43,7 +43,7 @@ The prompt is intentionally compact and uses fixed sections: - **Sandbox** (when enabled): indicates sandboxed runtime, sandbox paths, and whether elevated exec is available. - **Current Date & Time**: user-local time, timezone, and time format. - **Reply Tags**: optional reply tag syntax for supported providers. -- **Heartbeats**: heartbeat prompt and ack behavior. +- **Heartbeats**: heartbeat prompt and ack behavior, when heartbeats are enabled for the default agent. - **Runtime**: host, OS, node, model, repo root (when detected), thinking level (one line). - **Reasoning**: current visibility level + /reasoning toggle hint. @@ -103,10 +103,12 @@ Bootstrap files are trimmed and appended under **Project Context** so the model - `BOOTSTRAP.md` (only on brand-new workspaces) - `MEMORY.md` when present, otherwise `memory.md` as a lowercase fallback -All of these files are **injected into the context window** on every turn, which -means they consume tokens. Keep them concise — especially `MEMORY.md`, which can -grow over time and lead to unexpectedly high context usage and more frequent -compaction. +All of these files are **injected into the context window** on every turn unless +a file-specific gate applies. `HEARTBEAT.md` is omitted on normal runs when +heartbeats are disabled for the default agent or +`agents.defaults.heartbeat.includeSystemPromptSection` is false. Keep injected +files concise — especially `MEMORY.md`, which can grow over time and lead to +unexpectedly high context usage and more frequent compaction. > **Note:** `memory/*.md` daily files are **not** injected automatically. They > are accessed on demand via the `memory_search` and `memory_get` tools, so they diff --git a/docs/gateway/heartbeat.md b/docs/gateway/heartbeat.md index d846daa2b..9c5d9cb9d 100644 --- a/docs/gateway/heartbeat.md +++ b/docs/gateway/heartbeat.md @@ -54,7 +54,10 @@ Example config: - Prompt body (configurable via `agents.defaults.heartbeat.prompt`): `Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK.` - The heartbeat prompt is sent **verbatim** as the user message. The system - prompt includes a “Heartbeat” section and the run is flagged internally. + prompt includes a “Heartbeat” section only when heartbeats are enabled for the + default agent, and the run is flagged internally. +- When heartbeats are disabled with `0m`, normal runs also omit `HEARTBEAT.md` + from bootstrap context so the model does not see heartbeat-only instructions. - Active hours (`heartbeat.activeHours`) are checked in the configured timezone. Outside the window, heartbeats are skipped until the next tick inside the window. @@ -330,6 +333,11 @@ If a `HEARTBEAT.md` file exists in the workspace, the default prompt tells the agent to read it. Think of it as your “heartbeat checklist”: small, stable, and safe to include every 30 minutes. +On normal runs, `HEARTBEAT.md` is only injected when heartbeat guidance is +enabled for the default agent. Disabling the heartbeat cadence with `0m` or +setting `includeSystemPromptSection: false` omits it from normal bootstrap +context. + If `HEARTBEAT.md` exists but is effectively empty (only blank lines and markdown headers like `# Heading`), OpenClaw skips the heartbeat run to save API calls. That skip is reported as `reason=empty-heartbeat-file`.