You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
algorithm.lightweightMemory.enabled: true does not actually skip evolution pipeline (reward/L2/L3/skill still run) #2063
All evolution calls continue firing regardless of the flag. Confirmed via api_logs table:
SELECT tool_name, count(*), datetime(max(called_at)/1000,'unixepoch') as last
FROM api_logs
WHERE tool_name IN ('skill_generate','world_model_generate','policy_evolve')
GROUP BY tool_name;
Results (with lightweightMemory.enabled: true active throughout):
tool_name
count
skill_generate
19,193 (failure rate 97.5%)
world_model_generate
4,724 (failure rate 99.6%)
policy_evolve
2,122
Root cause (identified)
buildPipelineSubscribers in dist/core/pipeline/deps.js unconditionally creates and attaches all subscribers (rewardRunner, L2, L3, skill) — the lightweightMode flag does not gate this:
exportfunctionbuildPipelineSubscribers(deps,buses,algorithm,session){constcaptureRunner=createCaptureRunner({...})constrewardRunner=createRewardRunner({...})// always created// L2, L3, skill runners created unconditionally as well
lightweightMode only does an early return inside flush(), but the subscribers are already mounted on the event bus. The episode.finalized event still triggers the full evolution chain.
Additionally, recoverOpenEpisodesAsSessionEnd at startup re-emits episode.finalized for all previously closed episodes that lack meta.lightweightMemory === true, causing a large backlog of evolution calls after every bridge restart.
Suggested fix
In buildPipelineSubscribers, skip mounting reward/L2/L3/skill subscribers when lightweightMode is true:
exportfunctionbuildPipelineSubscribers(deps,buses,algorithm,session){constlightweightMode=algorithm.lightweightMemory.enabled;constcaptureRunner=createCaptureRunner({...})if(!lightweightMode){// only create rewardRunner, L2, L3, skill when neededconstrewardRunner=createRewardRunner({...})// ...}
Or alternatively, check lightweightMode at the top of each subscriber's event handler and return early before any LLM call.
Summary: Fixed issue #2063 — algorithm.lightweightMemory.enabled: true now actually skips the evolution pipeline in @memtensor/memos-local-plugin. Two independent root causes were addressed. First, buildPipelineSubscribers in apps/memos-local-plugin/core/pipeline/deps.ts used to attach reward / L2 / L3 / skill / feedback subscribers unconditionally, so every episode.finalized event still cascaded through the LLM-heavy chain — the fix short-circuits the subscriber wiring and returns no-op stubs whose drain/stop/detach/dispose are safe to call from flush() / shutdown(), and whose runner methods throw with a "lightweight mode" message if reached (every real caller is already gated on the flag). Second, memory-core.ts startup + periodic recovery paths (init, autoFinalizeStaleTasks, autoRescoreDirtyClosedEpisodes) used to re-emit episode.finalized for legacy episodes lacking meta.lightweightMemory === true, producing the >19k skill_generate / >4.7k world_model_generate / >2.1k policy_evolve backlog reported in the issue — those paths now close orphan / stale / dirty-closed episodes silently when the flag is on and tag their meta so subsequent restarts stay quiet. Regression coverage added at tests/unit/pipeline/lightweight-mode.test.ts: three tests exercising normal-mode listener presence, lightweight-mode listener absence on capture / reward / L2 buses, and a synthetic episode.finalized recovery emission that must produce zero reward / L2 / L3 / skill events. All 50 existing pipeline unit tests + the openclaw full-chain integration test still pass; TypeScript strict typecheck (tsc --noEmit) is clean. Three pre-existing test failures (startup-recovery, storage/migrator, v7-full-chain e2e) reproduce on the pristine base branch and are out of scope.
Base branch:main Branch:feature/autodev-2063-20260708064514092 Commit:c80d351 PR:#2074 Assigned to:@hijzy Reviewers:@hijzy
Activity
Memtensor-AI commentedon Jul 8, 2026
🤖 AutoDev has picked up this issue and started working on it.
Task ID:
00ce0051970d8558Working branch:
feature/autodev-2063-20260708064514092Target branch:
latest dev* branchWorkflow: opsp (analysis → coding → testing → PR)
I will post the PR link here once done. If I need more information, I will ask in the comments.
fix(memos-local-plugin): actually skip evolution pipeline when lightw…
Memtensor-AI commentedon Jul 8, 2026
✅ AutoDev task
00ce0051970d8558completed.Summary: Fixed issue #2063 —
algorithm.lightweightMemory.enabled: truenow actually skips the evolution pipeline in @memtensor/memos-local-plugin. Two independent root causes were addressed. First,buildPipelineSubscribersinapps/memos-local-plugin/core/pipeline/deps.tsused to attach reward / L2 / L3 / skill / feedback subscribers unconditionally, so everyepisode.finalizedevent still cascaded through the LLM-heavy chain — the fix short-circuits the subscriber wiring and returns no-op stubs whosedrain/stop/detach/disposeare safe to call fromflush()/shutdown(), and whose runner methods throw with a "lightweight mode" message if reached (every real caller is already gated on the flag). Second,memory-core.tsstartup + periodic recovery paths (init,autoFinalizeStaleTasks,autoRescoreDirtyClosedEpisodes) used to re-emitepisode.finalizedfor legacy episodes lackingmeta.lightweightMemory === true, producing the >19kskill_generate/ >4.7kworld_model_generate/ >2.1kpolicy_evolvebacklog reported in the issue — those paths now close orphan / stale / dirty-closed episodes silently when the flag is on and tag their meta so subsequent restarts stay quiet. Regression coverage added attests/unit/pipeline/lightweight-mode.test.ts: three tests exercising normal-mode listener presence, lightweight-mode listener absence on capture / reward / L2 buses, and a syntheticepisode.finalizedrecovery emission that must produce zero reward / L2 / L3 / skill events. All 50 existing pipeline unit tests + the openclaw full-chain integration test still pass; TypeScript strict typecheck (tsc --noEmit) is clean. Three pre-existing test failures (startup-recovery,storage/migrator,v7-full-chain e2e) reproduce on the pristine base branch and are out of scope.Base branch:
mainBranch:
feature/autodev-2063-20260708064514092Commit:
c80d351PR: #2074
Assigned to: @hijzy
Reviewers: @hijzy
Fix #2063: algorithm.lightweightMemory.enabled: true does not actuall…
Fix MemTensor#2063: algorithm.lightweightMemory.enabled: true does no…