Pre-submission checklist
Problem
Models like Qwen3 and DeepSeek-R1 support an enable_thinking parameter to control whether the model produces <think> reasoning blocks. When thinking is enabled, output contains <think>... tags before the actual response — which breaks JSON parsing in tasks that require structured output (capture summarization, L3 abstraction, skill crystallization).
Currently, the openai_compatible provider (core/llm/providers/openai.ts) has no support for the enableThinking config option. The complete() and stream() methods build the request body without considering config.enableThinking.
PR #2079 addressed this for the qwen3 preference extractor specifically, but the provider layer itself still lacks the capability.
Use Case
Users need to configure different thinking modes per LLM instance:
llm:
model: "Qwen/Qwen3-8B"
enableThinking: false # Main LLM: no thinking (JSON output tasks)
skillEvolver:
model: "Qwen/Qwen3-8B`
enableThinking: true # Skill evolution: with thinking (reasoning tasks)
Without provider-level support, the enableThinking config is ignored and all models use the provider default.
Proposed Solution
Add enableThinking patch to both complete() and stream() methods in openai.ts:
// In complete() method, after building body:
if (config.enableThinking === false) body.enable_thinking = false;
if (config.enableThinking === true) body.enable_thinking = true;
// Same patch in stream() method
This is a minimal, non-breaking change — when enableThinking is undefined (not set), the body is unchanged, preserving backward compatibility.
Debug Logging
Optionally add debug logging to help diagnose thinking mode:
if (config.enableThinking !== undefined) {
log.info("enableThinking.debug", {
model,
enableThinking: config.enableThinking,
bodyEnableThinking: body.enable_thinking,
});
}
Alternatives Considered
The provider-level approach is complementary to per-task routing — both can coexist.
Environment
- MemOS: v2.0.20 (memos-local-plugin)
- LLM Provider: openai_compatible (SiliconFlow)
- Model: Qwen/Qwen3-8B (supports enable_thinking parameter)
Pre-submission checklist
Problem
Models like Qwen3 and DeepSeek-R1 support an
enable_thinkingparameter to control whether the model produces<think>reasoning blocks. When thinking is enabled, output contains<think>...tags before the actual response — which breaks JSON parsing in tasks that require structured output (capture summarization, L3 abstraction, skill crystallization).Currently, the
openai_compatibleprovider (core/llm/providers/openai.ts) has no support for theenableThinkingconfig option. Thecomplete()andstream()methods build the request body without consideringconfig.enableThinking.PR #2079 addressed this for the qwen3 preference extractor specifically, but the provider layer itself still lacks the capability.
Use Case
Users need to configure different thinking modes per LLM instance:
Without provider-level support, the
enableThinkingconfig is ignored and all models use the provider default.Proposed Solution
Add
enableThinkingpatch to bothcomplete()andstream()methods inopenai.ts:This is a minimal, non-breaking change — when
enableThinkingis undefined (not set), the body is unchanged, preserving backward compatibility.Debug Logging
Optionally add debug logging to help diagnose thinking mode:
Alternatives Considered
The provider-level approach is complementary to per-task routing — both can coexist.
Environment