openclaw - ✅(Solved) Fix OpenClaw v2026.4.14 causes repeated context engine errors and breaks usability [2 pull requests, 7 comments, 6 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#66601Fetched 2026-04-15 06:25:29
View on GitHub
Comments
7
Participants
6
Timeline
16
Reactions
0
Timeline (top)
commented ×7cross-referenced ×4referenced ×2subscribed ×2

Error Message

Main error: Error: Context engine "lossless-claw" factory returned an invalid ContextEngine: info.id must match registered id "lossless-claw".

Root Cause

Please investigate and provide a fix or compatibility guidance, because in the current state the release produces a large volume of errors and is not practically usable.

Fix Action

Fixed

PR fix notes

PR #65589: feat(memory-core): dreaming circuit breaker to prevent runaway cost and data corruption

Description (problem / solution / changelog)

Summary

  • Adds a DreamingBudgetEnforcer module to the memory-core plugin that prevents dreaming runaway loops from burning unbounded API costs and corrupting daily notes
  • Implements three independent safety layers: per-cycle deduplication, sliding-window cost circuit breaker, and confidence-gated candidate filtering
  • Includes an integration helper (filterCandidatesThroughEnforcer) showing exactly how the enforcer plugs into the existing dreaming.ts pipeline
  • Covers all functionality with 51 unit tests including boundary conditions, persistence round-trips, and edge cases

Motivation

Issue #65550 documents a real production incident where the dreaming system entered an uncontrolled loop:

  • 94 LLM subagent sessions spawned in 65 minutes
  • $4.35 burned on API calls producing entirely garbage output
  • 302 lines of dream fragments overwrote real daily notes (data corruption)
  • All candidates had confidence: 0.00, recalls: 0 — zero-value entries that should never have been processed
  • 76 of 94 sessions reprocessed the same stale data with no deduplication

Root causes identified:

  1. No per-cycle deduplication — same candidates reprocessed in tight loops
  2. No cost tracking or budget cap — no awareness of accumulated API spend
  3. No candidate quality gate — zero-confidence entries passed through to expensive LLM calls

Users' only recourse is disabling dreaming entirely (dreaming.enabled: false), losing the long-term memory consolidation feature that is a core differentiator of OpenClaw.

Design

DreamingBudgetEnforcer (dreaming-budget.ts)

A stateful class instantiated at the start of each dreaming cycle with three guard methods:

LayerMethodWhat it prevents
DeduplicationshouldSkipDuplicate(snippet)Same content processed twice (SHA-256 fingerprint of normalized text)
Cost breakerisBudgetExceeded(nowMs?)Cumulative API cost exceeding configurable budget ($1.00/60min default)
Quality gateshouldSkipLowQuality(candidate)Zero-confidence/zero-recall candidates reaching LLM calls

Plus a composite checkCandidate() that runs all three checks in priority order (budget > quality > dedup).

Persistence: Budget state is saved to memory/.dreams/dreaming-budget.json via atomic write (temp file + rename) so it survives SIGUSR1 restarts. Uses the same file I/O patterns as short-term-promotion.ts.

Configuration: All thresholds are configurable via the plugin config schema under dreaming.budget:

{
  "dreaming": {
    "budget": {
      "maxCostUsd": 1.0,
      "windowMs": 3600000,
      "minConfidence": 0.05,
      "minRecalls": 1
    }
  }
}

Integration guide (dreaming-budget-integration.ts)

Documents the 6 exact integration points in the existing dreaming.ts pipeline with code snippets showing where each enforcer call is inserted. Also exports filterCandidatesThroughEnforcer() — a helper that filters ranked promotion candidates through all three safety layers and returns a breakdown of skip reasons.

Test plan

  • 51 vitest unit tests covering:
    • Fingerprinting: consistency, normalization, uniqueness, format validation
    • Deduplication: first/second encounter, case variants, cross-instance independence
    • Quality gate: zero confidence, zero recall, NaN, negative, custom thresholds
    • Cost breaker: under/over budget, latching behavior, window reset, default cost, invalid values
    • Composite check: priority ordering (budget > quality > dedup)
    • Persistence: save/load round-trip, missing file, corrupt JSON, wrong version, restart survival
    • Integration filter: valid candidates, duplicates, low quality, budget exceeded, empty list
    • Boundary conditions: exactly-at-threshold for confidence/cost, latch persistence through window expiry, state immutability
  • Verify existing dreaming.test.ts tests still pass after integration
  • Manual test: enable dreaming with budget.maxCostUsd: 0.10 and verify the cycle halts at the budget with a warning log

Closes #65550

Changed files

  • extensions/memory-core/src/dreaming-budget-integration.ts (added, +167/-0)
  • extensions/memory-core/src/dreaming-budget.test.ts (added, +541/-0)
  • extensions/memory-core/src/dreaming-budget.ts (added, +245/-0)

PR #66680: fix: remove info.id mismatch validation in context engine registry

Description (problem / solution / changelog)

Summary

The validation added in #63222 that info.id must match the registered engine ID is too strict and breaks external plugins (e.g. lossless-claw) that have always worked with a different info.id than their registry key.

Root Cause

In , the check:

else if (infoId !== engineId) {
  issues.push(`info.id must match registered id "${engineId}"`);
}

was rejecting any context engine factory that returned an info.id not equal to the registry key. This breaks plugins that register under one ID (e.g., "lossless-claw" ) but internally set info.id to a different value.

Why This Is Wrong

The info.id field is informational. The registry key is what matters for lookups and routing. The only downstream usage of info.id in is:

includeMemorySection: !params.contextEngine || params.contextEngine.info.id === "legacy",

This is non-critical behavior (memory section inclusion). A mismatch here doesn't cause system-wide failure.

Fix

Remove the infoId !== engineId check while keeping validation for genuinely missing info.id (empty string) and missing info.name.

Testing

pnpm test -- src/context-engine/context-engine.test.ts

All 35 tests pass (removed the now-invalid test that expected mismatch rejection).

Issue

Fixes #66601

Changed files

  • src/context-engine/context-engine.test.ts (modified, +0/-24)
  • src/context-engine/registry.ts (modified, +0/-2)
RAW_BUFFERClick to expand / collapse

Hi,

After upgrading to OpenClaw v2026.4.14, I started seeing repeated runtime errors and the system became effectively unusable.

Release: https://github.com/openclaw/openclaw/releases/tag/v2026.4.14

Main error:

Context engine "lossless-claw" factory returned an invalid ContextEngine: info.id must match registered id "lossless-claw"

Observed behavior:

  • repeated embedded agent failures before reply
  • repeated lane task errors
  • frequent fallback / failure logs
  • normal usage is heavily affected and the system becomes difficult to use

Representative log snippets:

Error: Context engine "lossless-claw" factory returned an invalid ContextEngine: info.id must match registered id "lossless-claw". Embedded agent failed before reply: Context engine "lossless-claw" factory returned an invalid ContextEngine: info.id must match registered id "lossless-claw".

Environment:

  • OpenClaw: v2026.4.14
  • Platform: macOS arm64
  • Plugin involved: lossless-claw

This release appears to have introduced a compatibility or validation change that now breaks existing context engine/plugin behavior.

Please investigate and provide a fix or compatibility guidance, because in the current state the release produces a large volume of errors and is not practically usable.

Thanks.

extent analysis

TL;DR

The issue is likely due to a compatibility problem between OpenClaw v2026.4.14 and the "lossless-claw" plugin, causing the context engine factory to return an invalid ContextEngine.

Guidance

  • Verify that the "lossless-claw" plugin is properly registered and configured in the OpenClaw environment, ensuring its info.id matches the expected "lossless-claw" id.
  • Check the release notes for OpenClaw v2026.4.14 to see if there are any specific instructions or guidelines for updating plugins or context engines.
  • Investigate potential changes in the plugin's implementation or configuration that may be causing the compatibility issue.
  • Consider downgrading to a previous version of OpenClaw or waiting for a patch release that addresses the compatibility problem.

Example

No code snippet is provided as the issue does not contain sufficient information about the specific implementation or configuration.

Notes

The exact cause of the issue is unclear, but it appears to be related to a change in OpenClaw's validation or compatibility checks. Further investigation is needed to determine the root cause and develop a permanent fix.

Recommendation

Apply a workaround by downgrading to a previous version of OpenClaw until a patch release is available that addresses the compatibility issue, as this will allow the system to function normally while a permanent fix is developed.

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

openclaw - ✅(Solved) Fix OpenClaw v2026.4.14 causes repeated context engine errors and breaks usability [2 pull requests, 7 comments, 6 participants]