#Task writing concept using Heartbeat YAML tasks to enhance memory recall

1 messages · Page 1 of 1 (latest)

narrow crystal
#

The docs say "OpenClaw remembers things by writing plain Markdown files." We're exploring using the HEARTBEAT.md YAML tasks: block to write narrative content instead of binary checks that produce near-zero durable output.

Our setup:
• 4 Supabase-scanned task sections, each on their own 2h interval, single-line prompts
• Each writes formatted entries to memory/operations_log.md
• Playbook below YAML block (appended as heartbeat context)
• isolatedSession: true, lightContext: true, deepseek-v4-flash
• Heartbeat timeout 300s, bootstrap 40K chars

We verified isolated sessions have tool access. Source says isTaskDue(undefined) returns true — HEARTBEAT.md is read from disk every tick. But the YAML dispatcher never fires, and the agent gets the default prompt instead. We can see why it should work but can't find the edge case.

System: OpenClaw 2026.5.5
• exec: ask=on-miss, security=full, safeBins: grep/sort/jq
• Memory: lossless-claw + memory-lancedb (plugins.allow empty, no memory-core)
• Heartbeat directPolicy: allow

Two questions:

  1. Is YAML tasks designed for write-oriented work (query → format → write file), or read-only checks only? Any edge cases with ~300+ char single-line prompts?

  2. Could exec on-miss interfere when tasks only use read/write/SQL tools? Does lossless-claw + lancedb (no memory-core) affect heartbeat dispatch?

If YAML tasks aren't the right tool, would openclaw cron add --kind agentTurn be the correct alternative? Isolated sessions have tools — just need a reliable trigger.

Thanks in advance.

silent caveBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

cold phoenixBOT
#

I checked the current docs/source. Short version: tasks: heartbeat is capable of write-oriented work, but the parser is very small and “YAML-like”, not a full YAML dispatcher.

If the agent is getting the default heartbeat prompt, that strongly suggests OpenClaw did not parse any tasks from the workspace HEARTBEAT.md. If tasks parse but none are due, the run skips with reason=no-tasks-due. If tasks parse and are due, the prompt should start with Run the following periodic tasks..., not the default prompt.

Things I’d check first:

  • The file is in the resolved agent workspace, exactly HEARTBEAT.md.
  • The block has a literal line tasks: by itself. tasks: # comment won’t match.
  • Each task uses the simple shape:
tasks:
- name: ops-log
  interval: 2h
  prompt: "Query Supabase, format new findings, append them to memory/operations_log.md."
  • name, interval, and prompt are all present. Missing any one silently drops that task.
  • Prompts are one physical line. A ~300-char single-line prompt should be fine, but folded/block YAML (>, |-) or wrapped continuation lines are not really supported; only the prompt: line is captured.
#
  • Don’t reuse task names unless you intentionally want them to share heartbeatTaskState.

On your two direct questions:

  1. Yes, it can be used for write-oriented work. Heartbeat just creates an agent turn; if the tools are available, the task prompt can tell it to query/format/write. It is not read-only by design. The brittle part is parsing/scheduling, not the write action.

  2. exec: ask=on-miss should not interfere with dispatch unless the model actually tries to call exec. If your task only uses read/write/SQL tools, exec approval policy won’t stop the YAML task prompt from being generated. Likewise, lossless-claw + lancedb/no memory-core should not affect heartbeat task dispatch; that’s separate from parsing HEARTBEAT.md and scheduling the heartbeat turn.

For what you’re building, I’d lean toward cron instead of heartbeat. Heartbeat tasks: is nice for lightweight periodic checks inside the heartbeat loop. For reliable scheduled narrative writes, use an isolated agentTurn cron job. In CLI terms that’s usually --message rather than an explicit --kind flag, e.g.:

openclaw cron add \
  --name "Operations log scan" \
  --every 2h \
  --session isolated \
  --message "Query Supabase, format new findings, and append entries to memory/operations_log.md." \