Commit Graph

222 Commits

Author SHA1 Message Date
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
Peter Steinberger
bfa6708c03 perf: narrow gateway runtime reset imports 2026-04-24 05:48:32 +01:00
Peter Steinberger
569290c36d feat: add Google Meet paired-node Chrome transport 2026-04-24 05:31:32 +01:00
Peter Steinberger
d0d018bdad fix(qa): restore agentic parity tool runtime 2026-04-23 04:22:03 +01:00
Peter Steinberger
4b2b261367 fix(plugins): preserve source activation config 2026-04-22 19:26:12 +01:00
Peter Steinberger
053147451b docs: generalize plugin runtime comments 2026-04-22 07:13:15 +01:00
Gustavo Madeira Santana
24db09a19b fix(cli): keep channel status checks off plugin runtimes (#69479)
Merged via squash.

Prepared head SHA: 63f6e416a9
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-21 13:53:08 -04:00
Pavan Kumar Gondhi
31160dc069 fix(agents): enforce subagent envelope inheritance on ACP child sessions [AI-assisted] (#69383)
* fix: address issue

* fix: address review feedback

* fix: finalize issue changes

* fix: address PR review feedback

* address build faiure

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback
2026-04-21 17:25:25 +05:30
Peter Steinberger
f76b426e2b perf: reduce jiti loader alias work 2026-04-20 18:06:45 +01:00
Mariano
bd3ad3436e tasks: add detached runtime plugin registration contract (#68915)
* tasks: register detached runtime plugins

* tasks: harden detached runtime ownership

* tasks: extract detached runtime contract types

* changelog: note detached runtime contract

* changelog: attribute detached runtime contract
2026-04-19 13:13:11 +02:00
Peter Steinberger
df525b90f2 chore(lint): enable unnecessary type parameter rule 2026-04-18 18:31:13 +01:00
Vincent Koc
87eac5377c fix(plugins): share runtime boundary alias builder 2026-04-14 17:26:45 +01:00
Vincent Koc
41d649c31a fix(plugins): share runtime boundary jiti cache helper 2026-04-14 17:17:58 +01:00
Vincent Koc
b7b3846793 feat(plugins): narrow channel loads from manifests (#65429)
* feat(plugins): narrow channel loads from manifests

* fix(plugins): harden channel owner activation trust

* fix(plugins): preserve empty channel scopes

* fix(plugins): honor channel-owner policy gates

* fix(plugins): keep channel setup and scope fallbacks correct

* fix(plugins): keep channel trust tied to source config
2026-04-12 17:24:15 +01:00
Vincent Koc
6a189eec0b fix(plugins): centralize explicit plugin scope handling (#65298)
* fix(plugins): centralize explicit plugin scope handling

* fix(plugins): preserve explicit empty web scopes

* fix(plugins): preserve runtime web provider scopes without config

* fix(plugins): preserve web provider runtime filtering

* fix(plugins): preserve scoped web runtime fallback

* fix(plugins): harden plugin scope normalization
2026-04-12 16:16:37 +01:00
Vincent Koc
a5689accc4 fix(plugins): preserve empty provider scopes 2026-04-12 11:04:58 +01:00
Vincent Koc
43a2156d1f fix(plugin-sdk): split runtime task contracts 2026-04-12 02:37:47 +01:00
Vincent Koc
51731d906f fix(plugin-sdk): split tts runtime contract types 2026-04-12 02:13:06 +01:00
Vincent Koc
d9357f9f39 fix(cycles): split command detection runtime types 2026-04-11 23:38:35 +01:00
Vincent Koc
9d717176d3 fix(plugins): split pairing runtime store types 2026-04-11 20:22:57 +01:00
Vincent Koc
4a799e77d7 fix(runtime): split reply dispatcher type surface 2026-04-11 17:46:58 +01:00
Vincent Koc
f630e8d440 fix(utils): bypass delivery context wrapper for shared consumers 2026-04-11 17:26:38 +01:00
Vincent Koc
899a1b7565 fix(runtime): drop media stt type back-edge 2026-04-11 17:08:24 +01:00
Vincent Koc
c37aaf0b60 fix(cycles): bypass session binding service type import 2026-04-11 16:26:40 +01:00
Vincent Koc
6e74d77a42 fix(cycles): split media understanding runtime contracts 2026-04-11 16:17:08 +01:00
Vincent Koc
97d1b88e3f fix(cycles): split plugin runtime contract leaf types 2026-04-11 15:39:32 +01:00
Vincent Koc
3b4de1ac14 fix(cycles): split reply and gateway leaf seams 2026-04-11 13:53:20 +01:00
Vincent Koc
af428d9b8a fix(cycles): split runtime taskflow type surface 2026-04-11 13:26:50 +01:00
Vincent Koc
543c14a4ed fix(cycles): split runtime delivery and registry seams 2026-04-11 13:26:50 +01:00
Vincent Koc
74e7b8d47b fix(cycles): bulk extract leaf type surfaces 2026-04-11 13:26:50 +01:00
Vincent Koc
75d7325e32 test(tasks): add control runtime override seam 2026-04-11 12:03:16 +01:00
Vincent Koc
7308e72fac fix(cycles): continue seam extraction 2026-04-11 10:43:22 +01:00
Peter Steinberger
1c7444dab6 perf: optimize test import surfaces 2026-04-11 03:08:58 +01:00
Peter Steinberger
73d054b764 refactor: simplify web channel runtime export names 2026-04-11 00:09:38 +01:00
Peter Steinberger
44ec4d05de feat: add pluggable agent harness registry 2026-04-10 21:22:16 +01:00
Peter Steinberger
0ebeee8b0d chore: enable consistent-return 2026-04-10 20:56:43 +01:00
Mariano
46f8c4dfd5 fix(memory-core): harden request-scoped dreaming fallback (#64156)
* memory-core: harden request-scoped dreaming fallback

* memory-core: tighten request-scoped fallback classification
2026-04-10 12:11:57 +02:00
Qasim Soomro
71617ef2f0 fix: allow private network provider request opt-in (#63671)
* feat(models): allow private network via models.providers.*.request
Add optional request.allowPrivateNetwork for operator-controlled self-hosted
OpenAI-compatible bases (LAN/overlay/split DNS). Plumbs the flag into
resolveProviderRequestPolicyConfig for streaming provider HTTP and OpenAI
responses WebSocket so SSRF policy can allow private-resolved model URLs
when explicitly enabled.
Updates zod schema, config help/labels, and unit tests for sanitize/merge.

* agents thread provider request into websocket stream

* fix(config): scope allowPrivateNetwork to model requests

* fix(agents): refresh websocket manager on request changes

* fix(agents): scope runtime private-network overrides to models

* fix: allow private network provider request opt-in (#63671) (thanks @qas)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-04-10 11:11:03 +05:30
Peter Steinberger
7f5d129a37 fix: keep runtime task test harness behind task seams 2026-04-08 16:53:46 +01:00
Peter Steinberger
e98dc17866 refactor: dedupe plugin test harnesses 2026-04-08 15:58:45 +01:00
Josh Lehman
b8f12d99b2 fix: expose runtime-ready provider auth to plugins (#62753) 2026-04-07 19:28:36 -07:00
Peter Steinberger
02d41b98c0 test: speed up plugin registry loader tests 2026-04-08 01:44:13 +01:00
Peter Steinberger
a96a1aa670 refactor: dedupe plugin auto-reply trimmed readers 2026-04-08 01:36:39 +01:00
Gustavo Madeira Santana
d78512b09d Refactor: centralize native approval lifecycle assembly (#62135)
Merged via squash.

Prepared head SHA: b7c20a7398
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-07 14:40:26 -04:00
Peter Steinberger
625fd5b3e3 refactor: centralize inbound mention policy 2026-04-07 07:51:00 +01:00
Peter Steinberger
fdacaf0853 test: sync messaging runtime and talk expectations 2026-04-07 05:46:13 +01:00
Peter Steinberger
80c8567f9d fix: resolve merge conflicts and preserve runtime test fixes 2026-04-06 22:46:33 +01:00
Peter Steinberger
ce30557399 refactor(deadcode): remove orphaned core helpers 2026-04-06 17:26:25 +01:00
Peter Steinberger
d12029a15a fix(check): repair plugin runtime type drift batch 2026-04-06 15:54:12 +01:00
Peter Steinberger
5a54005b4d fix(plugins): restore green runtime gates 2026-04-06 15:42:51 +01:00