mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
feat(cron): database-backed heartbeat monitor scratch replaces HEARTBEAT.md (#112967)
* feat(cron): move heartbeat context into database-backed per-job cron scratch - new additive cron_job_scratch SQLite table (revision tombstones keep compare-and-swap monotonic across unset/recreate; 256KiB cap) - heartbeat runner reads monitor scratch instead of workspace HEARTBEAT.md; heartbeat_respond gains a private scratch replacement parameter - openclaw doctor --fix migrates HEARTBEAT.md into scratch (hash-verified, archived under state backups, idempotent, symlink-contained) - gateway cron.scratch.get/set admin RPCs + openclaw cron scratch CLI - workspace bootstrap no longer seeds HEARTBEAT.md; Codex heartbeat file guidance removed; docs and prompt snapshots updated * fix(cron): review round 2 — shared-workspace heartbeat migration and non-default agent monitors - doctor migration groups agents by heartbeat source file and imports into every monitor before archiving/removing the shared file once - exempt heartbeat payloads from the main-session default-agent restriction: monitors only poke the wake bus, so non-default agents converge again - document why disabled monitors retain their last cadence (config default already resolves before the fallback) * fix(cron): honor configured cron store, legacy heartbeat fallback, and safer doctor claim * fix(cron): claim HEARTBEAT.md before committing scratch and restore without clobbering * fix(cron): pin migration CAS to precondition revision, re-verify claim on release, archive first, report scratch as pending * docs(heartbeat): remove retired config options * fix(cron): crash-recoverable migration claims, partial-import rollback, latest-response scratch pairing * test(heartbeat): keep latest scratch proposal paired * fix(cron): roll back committed scratch on changed-claim release and restore no-row state * fix(cron): revision-guarded rollback delete and recreated-file detection on claim release * fix(cron): treat every failed claim re-verification as a migration conflict * test(heartbeat): rename ack test after ackMaxChars retirement * fix(heartbeat): keep monitor scratch out of bypass-scope runs * fix(cron): resolve claimed symlinks on release and gate legacy fallback on proven scratch state * fix(cron): strict claim-name recovery and per-entry migration grouping * fix(ci): heartbeat scratch gate repairs — lint causes, dead exports, since-train, inventory path, prompt snapshot, regenerated docs map, SDK baseline, protocol bindings * fix(cron): live-owner claim guard and canonical entry-key migration grouping * fix(cron): archive claimed inode on release and flag orphan claims beside recreated files * docs(cron): document process-global state-db invariant for scratch service ops * chore(i18n): refresh native inventory line numbers after protocol binding regen
This commit is contained in:
committed by
GitHub
parent
78b987aa2e
commit
3e2b3ea4d5
+3
@@ -1276,6 +1276,9 @@
|
||||
"reason": {
|
||||
"type": "string"
|
||||
},
|
||||
"scratch": {
|
||||
"type": "string"
|
||||
},
|
||||
"summary": {
|
||||
"type": "string"
|
||||
}
|
||||
|
||||
Vendored
+16
-19
@@ -133,7 +133,7 @@
|
||||
"collaborationMode": {
|
||||
"mode": "default",
|
||||
"settings": {
|
||||
"developer_instructions": "This is an OpenClaw heartbeat turn. Apply these instructions only to this heartbeat wake; ordinary chat turns should stay in Codex Default mode.\n\nWhen you are ready to end the heartbeat, prefer the structured `heartbeat_respond` tool so OpenClaw can record the wake outcome and notification decision. If `heartbeat_respond` is not already available and `tool_search` is available, search for `heartbeat_respond`, load it, then call it. Use `notify=false` when nothing should visibly interrupt the user.\n\n### Heartbeats\n\nHeartbeat = useful proactive progress, not chatter. Wake, orient, read HEARTBEAT.md, act.\nAssigned/ongoing work: pursue spirit with judgment. Quiet check counts only if real blocker/urgent interruption.\nNo rote loops; orientation != accomplishment. Prefer action/silent progress.\nNever repetitive \"same/no change/still\" updates.\nInterrupt only for meaningful development/result/blocker/decision/time risk. Unchanged: work, change approach, dig deeper, or silence.\n\n## OpenClaw Agent Soul\n\nOpenClaw loaded these workspace instruction files from the active agent workspace. They are the canonical definitions of who you are, how you think and work, and the human you work alongside. Internalize and follow them accordingly.\n\n### /tmp/openclaw-happy-path/workspace/IDENTITY.md\n\n<IDENTITY.md contents will be here>\n\n### /tmp/openclaw-happy-path/workspace/SOUL.md\n\n<SOUL.md contents will be here>\n\n### /tmp/openclaw-happy-path/workspace/USER.md\n\n<USER.md contents will be here>\n\n## OpenClaw Heartbeat Workspace\n\nHEARTBEAT.md exists in the active agent workspace. Read it before proceeding with this heartbeat, then decide what action is appropriate.\n\n- /tmp/openclaw-happy-path/workspace/HEARTBEAT.md",
|
||||
"developer_instructions": "This is an OpenClaw heartbeat turn. Apply these instructions only to this heartbeat wake; ordinary chat turns should stay in Codex Default mode.\n\nWhen you are ready to end the heartbeat, prefer the structured `heartbeat_respond` tool so OpenClaw can record the wake outcome and notification decision. If `heartbeat_respond` is not already available and `tool_search` is available, search for `heartbeat_respond`, load it, then call it. Use `notify=false` when nothing should visibly interrupt the user.\n\n### Heartbeats\n\nHeartbeat = useful proactive progress, not chatter. Wake, orient, use the provided monitor scratch, act.\nAssigned/ongoing work: pursue spirit with judgment. Quiet check counts only if real blocker/urgent interruption.\nNo rote loops; orientation != accomplishment. Prefer action/silent progress.\nNever repetitive \"same/no change/still\" updates.\nInterrupt only for meaningful development/result/blocker/decision/time risk. Unchanged: work, change approach, dig deeper, or silence.\n\n## OpenClaw Agent Soul\n\nOpenClaw loaded these workspace instruction files from the active agent workspace. They are the canonical definitions of who you are, how you think and work, and the human you work alongside. Internalize and follow them accordingly.\n\n### /tmp/openclaw-happy-path/workspace/IDENTITY.md\n\n<IDENTITY.md contents will be here>\n\n### /tmp/openclaw-happy-path/workspace/SOUL.md\n\n<SOUL.md contents will be here>\n\n### /tmp/openclaw-happy-path/workspace/USER.md\n\n<USER.md contents will be here>",
|
||||
"model": "gpt-5.5",
|
||||
"reasoning_effort": "medium"
|
||||
}
|
||||
@@ -201,8 +201,8 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
|
||||
```json
|
||||
{
|
||||
"codexCollaborationModeDeveloperInstructions": {
|
||||
"chars": 1715,
|
||||
"roughTokens": 429
|
||||
"chars": 1507,
|
||||
"roughTokens": 377
|
||||
},
|
||||
"codexModelInstructions": {
|
||||
"chars": 21335,
|
||||
@@ -217,24 +217,24 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
|
||||
"roughTokens": 0
|
||||
},
|
||||
"dynamicToolsJson": {
|
||||
"chars": 60186,
|
||||
"roughTokens": 15047
|
||||
"chars": 60257,
|
||||
"roughTokens": 15065
|
||||
},
|
||||
"openClawDeveloperInstructions": {
|
||||
"chars": 2469,
|
||||
"roughTokens": 618
|
||||
},
|
||||
"totalTextOnly": {
|
||||
"chars": 27105,
|
||||
"roughTokens": 6777
|
||||
"chars": 26885,
|
||||
"roughTokens": 6722
|
||||
},
|
||||
"totalWithDynamicToolsJson": {
|
||||
"chars": 87293,
|
||||
"roughTokens": 21824
|
||||
"chars": 87144,
|
||||
"roughTokens": 21786
|
||||
},
|
||||
"userInputText": {
|
||||
"chars": 1271,
|
||||
"roughTokens": 318
|
||||
"chars": 1259,
|
||||
"roughTokens": 315
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -460,7 +460,7 @@ When you are ready to end the heartbeat, prefer the structured `heartbeat_respon
|
||||
|
||||
### Heartbeats
|
||||
|
||||
Heartbeat = useful proactive progress, not chatter. Wake, orient, read HEARTBEAT.md, act.
|
||||
Heartbeat = useful proactive progress, not chatter. Wake, orient, use the provided monitor scratch, act.
|
||||
Assigned/ongoing work: pursue spirit with judgment. Quiet check counts only if real blocker/urgent interruption.
|
||||
No rote loops; orientation != accomplishment. Prefer action/silent progress.
|
||||
Never repetitive "same/no change/still" updates.
|
||||
@@ -481,12 +481,6 @@ OpenClaw loaded these workspace instruction files from the active agent workspac
|
||||
### /tmp/openclaw-happy-path/workspace/USER.md
|
||||
|
||||
<USER.md contents will be here>
|
||||
|
||||
## OpenClaw Heartbeat Workspace
|
||||
|
||||
HEARTBEAT.md exists in the active agent workspace. Read it before proceeding with this heartbeat, then decide what action is appropriate.
|
||||
|
||||
- /tmp/openclaw-happy-path/workspace/HEARTBEAT.md
|
||||
```
|
||||
|
||||
### User: Turn Input Text
|
||||
@@ -521,7 +515,7 @@ Conversation info (untrusted metadata):
|
||||
}
|
||||
```
|
||||
|
||||
Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. Use heartbeat_respond to report the wake outcome. Set notify=false when nothing needs the user's attention. Set notify=true with notificationText only when the user should be interrupted.
|
||||
Follow the heartbeat monitor scratch context when provided. Do not infer or repeat old tasks from prior chats. Use heartbeat_respond to report the wake outcome. Set notify=false when nothing needs the user's attention. Set notify=true with notificationText only when the user should be interrupted.
|
||||
````
|
||||
|
||||
### Tools: Dynamic Tool Catalog
|
||||
@@ -709,6 +703,9 @@ Full JSON: `codex-dynamic-tools.heartbeat-turn.json`
|
||||
"reason": {
|
||||
"type": "string"
|
||||
},
|
||||
"scratch": {
|
||||
"type": "string"
|
||||
},
|
||||
"summary": {
|
||||
"type": "string"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user