Skip to content

[Bug] captureRunner uses reflectLlm (skill-evolver) for batch reflection — should use main llm #2148

Description

@7889545

Pre-submission checklist

  • I have searched existing issues and this hasn't been mentioned before
  • I have read the project documentation and confirmed this issue doesn't already exist
  • This issue is specific to MemOS and not a general software issue

Bug Description

Summary

In core/pipeline/deps.ts, the captureRunner is wired with reflectLlm: deps.reflectLlm (the skill-evolver model). This means the capture pipeline's batch reflection — which requires JSON output — runs on the skill-evolver model instead of the main llm. When skillEvolver.enableThinking=true and llm.enableThinking=false (as configured for Qwen3), the capture reflection gets enable_thinking=true, producing malformed JSON with <think> tags that fail to parse.

Root Cause

// deps.ts line ~216
const captureRunner = createCaptureRunner({
    ...
    llm: deps.llm,
    reflectLlm: deps.reflectLlm,  // ← BUG: should be deps.llm
    ...
});

Inside capture.ts (line ~286), the batch reflection prefers reflectLlm:

const rLlm = deps.reflectLlm ?? deps.llm;

So when reflectLlm is set (skill-evolver with enableThinking=true), the capture reflection runs on the wrong model.

Impact

  • Capture batch reflection produces malformed JSON (thinking tags mixed into JSON output)
  • malformed JSON errors appear in logs during capture summarization
  • The reflection quality degrades because the JSON-output task runs on a thinking-enabled model

Environment

  • MemOS: v2.0.20 (memos-local-plugin)
  • LLM: Qwen/Qwen3-8B via SiliconFlow
  • Config: llm.enableThinking=false, skillEvolver.enableThinking=true

Suggested Fix

Change the wiring so capture reflection uses the main llm (no thinking for JSON tasks):

const captureRunner = createCaptureRunner({
    ...
    llm: deps.llm,
    reflectLlm: deps.llm,  // capture reflection needs JSON, not thinking
    ...
});

Note: The dedicated l3Llm config slot (PR #1959) already addresses L3 abstraction routing. A similar approach could be considered for capture reflection if independent model control is desired.

Metadata

Metadata

Labels

area:pluginOpenClaw & Hermesstatus:in-progressSomeone or AI is working on it | 人工或 AI 正在处理types:bugSomething isn't working | 功能异常

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions