openclaw/extensions
Patrick Erichsen aca92b2906
memory/dreaming: decouple managed cron from heartbeat (#70737)
* Revert "fix(memory/dreaming): surface blocked status when heartbeat is disabled for main (#69875)"

This reverts commit 529577e045.

Making way for the dreaming-vs-heartbeat decoupling from Josh's
josh/dreaming-isolated-cron-fix branch, which moves the managed dreaming
cron to isolated agent turns (sessionTarget: "isolated") so dreaming no
longer requires heartbeat to fire. Once the cron no longer rides the
heartbeat path, the blocked-reason observability has nothing left to
report — removing it cleanly here before the cherry-picks land.

* openclaw-3ba.1: move managed dreaming cron to isolated agent turns

* openclaw-46d: claim cron runs before embedded attempts

* openclaw-575: disable managed dreaming cron delivery

* openclaw-575: accept wrapped dreaming cron tokens

* openclaw-ccd: filter cron and wrapper transcript noise from dreaming corpus

* openclaw-cd9: filter archived, cron, and heartbeat transcript noise from dreaming corpus

* openclaw-cd9: suppress role-label reflection tags in rem dreaming

* openclaw-b49: stop narrative timeouts from blocking dreaming cron

* openclaw-b49: keep managed dreaming cron out of diary subagents

* openclaw-ff9: restore cron dream diary generation without serial waits

* openclaw-ff9: run dreaming narratives with lightweight isolated subagent lanes

* openclaw-ff9: detach cron dream diary generation from run completion

* openclaw-ff9: defer cron diary task startup until after cron completion

* doctor/cron: migrate stale managed dreaming jobs to isolated agent turns

After the dreaming cron moved off the heartbeat path to sessionTarget:
"isolated" + payload.kind: "agentTurn" (see the preceding memory-core
changes), users with existing ~/.openclaw/cron/jobs.json entries in the
old sessionTarget: "main" + payload.kind: "systemEvent" shape still
carry stale jobs until the gateway restart reconcile rewrites them.

Add a dreaming-specific cron migration to the existing
maybeRepairLegacyCronStore doctor path so "openclaw doctor" (and
"openclaw doctor --fix") rewrites those jobs without needing a gateway
restart. Match lives in a new doctor-cron-dreaming-payload-migration
helper alongside the existing legacy-delivery and store-migration files.

The matching uses the memory-core managed-job name and description tag
plus the short-term-promotion payload token. Constants are mirrored
from extensions/memory-core/src/dreaming.ts and commented so a future
rename in memory-core is a visible drift point here too.

* memory/dreaming: tighten cron-token match to known wrapper, not substring

The previous match relaxed the line check from 'trimmed line equals token'
to 'line contains token anywhere as a substring' to accept the
`[cron:<id>] <token>` wrapper that isolated-cron turns add. Substring
matching also let any user message embedding the token mid-sentence
trigger the dream-promotion hook, and was flagged by both Greptile and
Aisle on PR #70737.

Replace it with strip-the-known-prefix-then-exact-match: keep the
`[cron:<id>]` wrapper case working, reject every other variant. Add
focused unit coverage that the bare token, the wrapped token, and bare
multiline cases match while embedded / code-fenced / arbitrarily-wrapped
variants do not.

* memory/dreaming: drop assistant followup only on assistant-side signals

Per PR #70737 review (aisle-research-bot, Medium): the previous logic
suppressed the next assistant message whenever the prior user message
matched a 'generated prompt' pattern (`[cron:...]`,
`System (untrusted): ...`, heartbeat prompts, exec-completion events).
Real users can type those same patterns, which let a user exfiltrate
real assistant replies from the dreaming corpus by prefixing their own
prompt — the assistant's reply would be silently dropped.

Remove the cross-message coupling. Assistant-side machinery (silent
replies, system wrappers) is already dropped by sanitizeSessionText,
which is the right layer for that filter. Add an explicit assistant-side
HEARTBEAT_TOKEN check to keep the legitimate `HEARTBEAT_OK` ack drop
working without depending on the prior user message. Add a regression
test exercising the spoofing scenario.

* doctor/cron: assert mirrored dreaming constants stay in sync

Per PR #70737 review (greptile-apps): the doctor migration mirrors three
constants (MANAGED_DREAMING_CRON_NAME, MANAGED_DREAMING_CRON_TAG,
DREAMING_SYSTEM_EVENT_TEXT) from extensions/memory-core/src/dreaming.ts.
A future rename in either file would silently break the migration.

Add a vitest unit that reads both files and asserts the literals match.
Manually verified the assertion fires with a clear error when one side
diverges. Adds no runtime cost; sits in the regular test pipeline.

* fix(memory): stabilize dreaming CI checks

* memory/dreaming: skip eager narrative session cleanup when detached

Per PR #70737 review (chatgpt-codex-connector, P2): runDreamingSweepPhases
called deleteNarrativeSessionBestEffort synchronously right after each
phase. Once narrative generation moved to detached mode (queued via
queueMicrotask), the eager cleanup races the writer: the session is
deleted before the queued subagent run reads it, silently dropping cron
diary entries.

Skip the eager cleanup branch when params.detachNarratives is true.
generateAndAppendDreamNarrative still runs its own deleteSession in the
finally{} block, so the cleanup intent is preserved without the race.
Heartbeat-driven (non-detached) runs keep the original eager-cleanup
behavior.

* fix(plugin-sdk): restore heartbeat-summary re-export

Per PR #70737 review (chatgpt-codex-connector, P1): the revert of
PR #69875 dropped the `heartbeat-summary` re-export from
`openclaw/plugin-sdk/infra-runtime`. That subpath shipped publicly two
days earlier, so removing it is technically a breaking change to a
public SDK surface — third-party plugins importing
`isHeartbeatEnabledForAgent` / `resolveHeartbeatIntervalMs` from this
path would fail with no replacement contract introduced.

Restore the re-export. Costs nothing to keep; the helpers are already
public via `../infra/heartbeat-summary.ts`. SDK additions are by
default backwards-compatible (CLAUDE.md), so removing within days of
introduction violates that intent.

* changelog: note dreaming decoupling from heartbeat

Refs PR #70737.

---------

Co-authored-by: Josh Lehman <josh@martian.engineering>
2026-04-23 22:23:19 -07:00
..
acpx feat(codex): add app-server protocol bridge 2026-04-24 04:24:08 +01:00
active-memory refactor: type config schemas as typebox-compatible 2026-04-23 05:22:16 +01:00
alibaba
amazon-bedrock build: update Pi model dependencies 2026-04-24 01:24:46 +01:00
amazon-bedrock-mantle build: update Pi model dependencies 2026-04-24 01:24:46 +01:00
anthropic fix(plugins): align provider auth metadata 2026-04-23 18:16:20 -07:00
anthropic-vertex fix(anthropic-vertex): resolve model discovery and auth for GCP ADC (openclaw#65716) 2026-04-23 09:03:16 -05:00
arcee fix: bound unscoped provider discovery fallback 2026-04-24 05:46:25 +01:00
bluebubbles test(extensions): trim hot extension imports 2026-04-23 13:06:19 +01:00
brave fix(plugins): stop tracking runtime deps manifests 2026-04-23 05:48:49 +01:00
browser perf: lazy load browser test server 2026-04-24 02:45:25 +01:00
byteplus refactor: expose bundled static provider catalogs 2026-04-24 05:46:25 +01:00
chutes fix: keep live catalog providers on registry path 2026-04-24 05:46:25 +01:00
cloudflare-ai-gateway fix: align claude cli permissions with exec policy 2026-04-23 23:11:34 +01:00
codex fix(codex): require final approval decisions (#70751) 2026-04-24 05:30:59 +01:00
comfy fix(plugins): align provider auth metadata 2026-04-23 18:16:20 -07:00
copilot-proxy
deepgram refactor(stt): share transcription helpers 2026-04-23 04:29:35 +01:00
deepseek refactor: expose bundled static provider catalogs 2026-04-24 05:46:25 +01:00
device-pair refactor(qr): share PNG data URL helpers (#70784) 2026-04-23 15:41:45 -07:00
diagnostics-otel lint: enforce exhaustive switches 2026-04-23 06:02:12 +01:00
diffs refactor: type config schemas as typebox-compatible 2026-04-23 05:22:16 +01:00
discord Add Discord live QA lane (#70792) 2026-04-23 19:48:37 -07:00
duckduckgo chore: apply extension lint cleanups 2026-04-23 05:30:49 +01:00
elevenlabs refactor(stt): share transcription helpers 2026-04-23 04:29:35 +01:00
exa
fal
feishu perf: narrow inbound debounce sdk imports 2026-04-24 05:07:28 +01:00
firecrawl fix(plugins): stop tracking runtime deps manifests 2026-04-23 05:48:49 +01:00
fireworks build: update Pi model dependencies 2026-04-24 01:24:46 +01:00
github-copilot build: update Pi model dependencies 2026-04-24 01:24:46 +01:00
google fix: pass Gemini trust flag 2026-04-24 05:55:27 +01:00
google-meet fix: use absolute system profiler for Meet audio checks 2026-04-24 06:18:43 +01:00
googlechat fix(channels): keep bundled setup entries dependency-light 2026-04-24 06:10:07 +01:00
groq refactor: move media defaults into plugin manifests 2026-04-22 06:11:49 +01:00
huggingface
image-generation-core
imessage refactor(channels): centralize runtime binding routes 2026-04-22 23:16:57 +01:00
irc test: trim duplicate runtime smoke work 2026-04-23 11:28:26 +01:00
kilocode fix: keep live catalog providers on registry path 2026-04-24 05:46:25 +01:00
kimi-coding build: update Pi model dependencies 2026-04-24 01:24:46 +01:00
line test(line): trim outbound payload coverage 2026-04-23 13:16:41 +01:00
litellm
llm-task build: migrate schema deps to typebox 2026-04-23 04:59:42 +01:00
lmstudio build: update Pi model dependencies 2026-04-24 01:24:46 +01:00
lobster build: migrate schema deps to typebox 2026-04-23 04:59:42 +01:00
matrix fix(channels): keep bundled setup entries dependency-light 2026-04-24 06:10:07 +01:00
mattermost perf: narrow mattermost setup imports 2026-04-24 04:45:29 +01:00
media-understanding-core
memory-core memory/dreaming: decouple managed cron from heartbeat (#70737) 2026-04-23 22:23:19 -07:00
memory-lancedb fix(memory): support live lancedb hook enablement 2026-04-22 23:06:39 -07:00
memory-wiki lint: enforce exhaustive switches 2026-04-23 06:02:12 +01:00
microsoft
microsoft-foundry
minimax refactor: move media defaults into plugin manifests 2026-04-22 06:11:49 +01:00
mistral fix(plugins): stop tracking runtime deps manifests 2026-04-23 05:48:49 +01:00
moonshot refactor: expose bundled static provider catalogs 2026-04-24 05:46:25 +01:00
msteams perf: narrow msteams attachment imports 2026-04-24 04:29:12 +01:00
nextcloud-talk fix(channels): thread runtime config through sends 2026-04-22 06:47:51 +01:00
nostr fix(channels): keep bundled setup entries dependency-light 2026-04-24 06:10:07 +01:00
nvidia fix(plugins): align provider auth metadata 2026-04-23 18:16:20 -07:00
ollama build: update Pi model dependencies 2026-04-24 01:24:46 +01:00
open-prose
openai fix: guard openai realtime browser fetch 2026-04-24 03:50:43 +01:00
opencode
opencode-go build: update dependencies 2026-04-23 04:00:17 +01:00
openrouter feat: add OpenRouter image generation (#67668) 2026-04-24 01:39:19 +01:00
openshell style: format stale source files 2026-04-23 02:20:10 +01:00
perplexity
phone-control
qa-channel perf: narrow qa bus test imports 2026-04-24 03:44:56 +01:00
qa-lab fix: use openclaw temp root for telegram live preflight 2026-04-24 06:07:17 +01:00
qa-matrix test(qa): isolate matrix stale sync replay 2026-04-23 16:49:53 +01:00
qianfan
qqbot fix(channels): keep bundled setup entries dependency-light 2026-04-24 06:10:07 +01:00
qwen refactor: move media defaults into plugin manifests 2026-04-22 06:11:49 +01:00
runway
searxng
sglang
shared
signal chore: apply extension lint cleanups 2026-04-23 05:30:49 +01:00
skill-workshop fix(skill-workshop): support live hook enablement 2026-04-22 22:09:10 -07:00
slack fix(channels): keep bundled setup entries dependency-light 2026-04-24 06:10:07 +01:00
speech-core feat(agents): add generation tool timeouts 2026-04-24 00:05:38 +01:00
stepfun
synology-chat chore: apply extension lint cleanups 2026-04-23 05:30:49 +01:00
synthetic
talk-voice
tavily fix(plugins): stop tracking runtime deps manifests 2026-04-23 05:48:49 +01:00
telegram perf: narrow inbound debounce sdk imports 2026-04-24 05:07:28 +01:00
tencent refactor: expose bundled static provider catalogs 2026-04-24 05:46:25 +01:00
test-support
thread-ownership refactor(hooks): share live config fallback handling 2026-04-22 21:42:53 -07:00
tlon chore: apply extension lint cleanups 2026-04-23 05:30:49 +01:00
together
tokenjuice fix: harden tokenjuice host typing 2026-04-22 08:52:55 +01:00
twitch
venice
vercel-ai-gateway fix: keep live catalog providers on registry path 2026-04-24 05:46:25 +01:00
video-generation-core
vllm perf: mock vllm provider setup contract 2026-04-24 00:52:53 +01:00
voice-call refactor: centralize realtime voice resolution 2026-04-24 01:50:43 +01:00
volcengine refactor: expose bundled static provider catalogs 2026-04-24 05:46:25 +01:00
voyage
vydra
webhooks fix(webhooks): reload route secrets per request (#70727) 2026-04-23 15:48:10 -06:00
whatsapp test(channels): cover staged setup entry dependency loading 2026-04-24 06:10:07 +01:00
xai build: update Pi model dependencies 2026-04-24 01:24:46 +01:00
xiaomi
zai refactor: move media defaults into plugin manifests 2026-04-22 06:11:49 +01:00
zalo perf: narrow zalo monitor imports 2026-04-24 04:40:42 +01:00
zalouser build: migrate schema deps to typebox 2026-04-23 04:59:42 +01:00
.npmignore
AGENTS.md
CLAUDE.md
music-generation-providers.live.test.ts
tsconfig.package-boundary.base.json
tsconfig.package-boundary.paths.json
video-generation-providers.live.test.ts