Ollama think_mode and /no_think not properly supported in AG2 when using Qwen3 model
Hi, thank you for your great work on AG2!
I'm currently using AG2 (v0.9.2) with Ollama 0.9 and testing models that support "thinking mode", such as Qwen3. According to Ollama's documentation and Qwen3's behavior:
think_mode can be toggled at runtime when interacting with Ollama, which controls whether the model simulates multi-step thinking.
Qwen3 also supports a soft disable by using /no_think inside the user message.
However, I’ve encountered two issues when integrating this behavior into AG2:
AG2 does not expose the Ollama think_mode flag. In the current OllamaAgent, there seems to be no way to enable or disable think_mode dynamically at runtime, even though Ollama 0.9 supports this feature.
/no_think only affects the first message. When using Qwen3 with AG2, inserting /no_think in a message only disables thinking mode for the first model response. In multi-turn chats, the model returns to thinking mode in follow-up responses, even when /no_think is repeatedly used in later messages.
🧪 Expected Behavior: AG2 should allow toggling think_mode via agent configuration or runtime parameters.
If using /no_think, AG2 should ideally preserve this flag across the conversation (or provide a way to enforce it per turn).
🛠️ Suggestions: Support think_mode=True/False as part of the OllamaAgent initialization or message-level config.
Optionally, introduce a persistent context flag to carry /no_think behavior across turns when using Qwen models.
📦 Versions: AG2: v0.9.2
Ollama: v0.9
Model: Qwen3 (with native think_mode)
Thanks again for the amazing project! Let me know if you need reproduction steps or additional debug info.
@kangkannnng thanks for your issue, it's a good one, do you think you could try and create a solution here for it?
Hi, do you have any updates on this issue? Thanks!
I don't have any other ideas to solve this, it's just that this is indeed a problem I am facing right now.
seems like it should be fixed is a part of #1946 We should just provide config with extra options for specific models