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
[Feature] openai_compatible provider: support enableThinking parameter for thinking-capable models (Qwen3, DeepSeek-R1) #2149
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
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:
Activity
feat: add enable_thinking support for OpenAI-compatible providers (#2181