openclaw - ✅(Solved) Fix [Feature]: Allow memory-core dreaming to use a configurable model override [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#63372Fetched 2026-04-09 07:54:36
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
labeled ×1

Add an optional model field to the dreaming config so dreaming phases can use a different model than the agent's primary.

Root Cause

Add an optional model field to the dreaming config so dreaming phases can use a different model than the agent's primary.

PR fix notes

PR #66583: feat(memory-core): add dreaming.model config field for per-sweep model override

Description (problem / solution / changelog)

Summary

  • Problem: plugins.entries.memory-core.config.dreaming had no model field — dreaming always inherited the agent's primary model with no way to override it. The internal execution.model field existed in the type but was never wired up and was blocked by manifest schema validation anyway.
  • Why it matters: Users running a capable model for interactive use had no config path to use a cheaper model (e.g. google/gemini-2.5-flash) for background dreaming sweeps, so every dreaming run billed against their primary model.
  • What changed: Added model to the dreaming config schema and wired it through resolveMemoryDreamingConfig → phase runners → generateAndAppendDreamNarrative → subagent.run() for all three phases (light, REM, deep). Fixed resolveExecutionConfig to cascade fallback.model so the top-level default propagates to phases that don't override it. Added model to the plugin manifest schema so the config passes validation.
  • What did NOT change: No behavior change when model is omitted. Per-phase phases.<phase>.execution.model continues to work as a more granular override.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #63372

  • Coverage level that should have caught this:

    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: src/memory-host-sdk/dreaming.test.ts, extensions/memory-core/src/dreaming-narrative.test.ts, extensions/memory-core/src/config.test.ts

  • Scenario the test should lock in: dreaming.model cascades to all three phase execution configs; per-phase execution.model overrides the top-level value; manifest schema accepts model and rejects unknown keys

  • Why this is the smallest reliable guardrail: the cascade logic lives entirely in resolveMemoryDreamingConfig and the pass-through lives in generateAndAppendDreamNarrative. Unit tests cover both seams without needing a live subagent run

  • Existing test that already covers this (if any): None

User-visible / Behavior Changes

List user-visible changes (including defaults/config).

  • New optional config field: plugins.entries.memory-core.config.dreaming.model (string). When set, all three dreaming phases (light, REM, deep) use that model for their narrative subagent run instead of the agent's primary model.
    • Per-phase phases.<phase>.execution.model continues to work and takes precedence over the top-level dreaming.model.
    • No change when model is omitted — existing behavior is fully preserved.

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Environment

  • OS: MacOS
  • Runtime/container: Node 22 / local gateway
  • Model/provider: MiniMax (MiniMax-M2.7) as dreaming override; primary agent on Claude
  • Integration/channel (if any):
  • Relevant config (redacted):

plugins.entries.memory-core.config.dreaming.model: "minimax/MiniMax-M2.7"

Steps

  1. Set dreaming.model in memory-core plugin config to a model different from the primary agent
  2. Trigger a dreaming sweep via /dreaming or wait for cron
  3. Check session logs for subagent runs created during the sweep

Expected

  • All three dreaming phase narrative subagent runs use the configured override model
  • Primary agent model is unaffected

Actual

  • Confirmed: light, REM, and deep phases each created subagent runs using the override model
  • Confirmed: per-phase execution.model override takes precedence over top-level dreaming.model
  • Confirmed: allowModelOverride is not required — dreaming runs in request scope and inherits request-scope client authorization automatically

Evidence

Attach at least one:

live cron run confirmed subagent runs created with override model routing correctly across all three phases

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios: top-level dreaming.model routes all three phases to the override model; per-phase execution.model overrides the top-level value for that phase only; omitting model preserves existing behavior
  • Overwriting with an invalid model causes the dream cycle to fail
  • Edge cases checked: allowModelOverride not required — tested without it, dreaming ran normally
  • What you did not verify: behavior across all supported provider model strings;

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? Yes — new optional dreaming.model field; omitting it preserves existing behavior with no migration needed
  • Migration needed? No

Risks and Mitigations

List only real risks for this PR. Add/remove entries as needed. If none, write None.

  • Risk: a misconfigured or unavailable model string causes dreaming phase failures
    • Mitigation: dreaming errors are non-fatal to the primary agent session; existing subagent error handling surfaces failures in session logs

Changed files

  • docs/concepts/dreaming.md (modified, +8/-5)
  • docs/reference/memory-config.md (modified, +6/-4)
  • extensions/memory-core/openclaw.plugin.json (modified, +24/-0)
  • extensions/memory-core/src/config.test.ts (modified, +48/-0)
  • extensions/memory-core/src/dreaming-narrative.test.ts (modified, +33/-0)
  • extensions/memory-core/src/dreaming-narrative.ts (modified, +7/-0)
  • extensions/memory-core/src/dreaming-phases.ts (modified, +2/-0)
  • extensions/memory-core/src/dreaming.ts (modified, +4/-0)
  • src/memory-host-sdk/dreaming.test.ts (modified, +36/-0)
  • src/memory-host-sdk/dreaming.ts (modified, +7/-3)
RAW_BUFFERClick to expand / collapse

Summary

Add an optional model field to the dreaming config so dreaming phases can use a different model than the agent's primary.

Problem to solve

Dreaming inherits the agent's primary model with no way to override it. Users who want a cheap/free model (e.g. google/gemini-2.5-flash) for background dreaming, while keeping a better model (e.g. Claude Sonnet) for interactive use, have no config path to do this.

The plugins.entries.memory-core.config.dreaming schema only exposes: enabled, frequency, timezone, verboseLogging, storage, and phases — no model field.

Proposed solution

Add an optional model field to plugins.entries.memory-core.config.dreaming:

"dreaming": {
  "enabled": true,
  "model": "google/gemini-2.5-flash"
}

### Alternatives considered

_No response_

### Impact

Affected: Any user who wants to split model usage between interactive and background tasks
Severity: Nice to have
Frequency: Every dreaming run
Consequence: Users either overpay for background dreaming or downgrade their interactive model

### Evidence/examples

Confirmed via config.schema.lookup on plugins.entries.memory-core.config.dreaming — no model field exists in the current schema (tested on OpenClaw 2026.4.8).

### Additional information

Should be backward-compatible — if model is omitted, dreaming falls back to the current behaviour (inheriting the primary model). No breaking change.

extent analysis

TL;DR

Add an optional model field to the plugins.entries.memory-core.config.dreaming schema to allow users to specify a different model for dreaming phases.

Guidance

  • Review the proposed solution and verify that adding the model field to the dreaming config does not introduce any breaking changes.
  • Test the updated config schema with different model specifications to ensure it works as expected.
  • Consider adding validation or default values for the model field to handle cases where it is omitted or set incorrectly.
  • Evaluate the impact of this change on existing users and consider providing documentation or guidance on how to take advantage of this new feature.

Example

"dreaming": {
  "enabled": true,
  "model": "google/gemini-2.5-flash"
}

This example shows how the updated config schema could be used to specify a different model for dreaming phases.

Notes

The proposed solution seems straightforward, but it's essential to test and validate the changes to ensure they do not introduce any unintended consequences.

Recommendation

Apply workaround: Add the optional model field to the plugins.entries.memory-core.config.dreaming schema, as this change is backward-compatible and allows users to specify a different model for dreaming phases.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING