Agent ReAct mode doesn't fit with gpt-oss model #523

Closed
opened 2026-02-16 10:19:39 -05:00 by yindo · 4 comments
Owner

Originally created by @dickens88 on GitHub (Aug 5, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues Dify issues & Dify Official Plugins, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

v1.7.1

Plugin version

Dify Agent Strategies 0.0.23

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Hi Team,

I set up gpt-oss:20b in my local ollama. I tried to configure this model into Agent node with ReAct mode. It seems the agent can not get anything with this mode, it always reply the same.

Image

Then i changed it to Function calling mode, it works. But we know the difference between these two modes, the ReAct is more helpful in some cases. so that i hope someone can help and fix it. thank you.

Image

✔️ Error log

No response

Originally created by @dickens88 on GitHub (Aug 5, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version v1.7.1 ### Plugin version Dify Agent Strategies 0.0.23 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Hi Team, I set up gpt-oss:20b in my local ollama. I tried to configure this model into Agent node with ReAct mode. It seems the agent can not get anything with this mode, it always reply the same. <img width="1312" height="796" alt="Image" src="https://github.com/user-attachments/assets/09cdd0ef-208c-4f89-9be7-12e8abe0abcc" /> Then i changed it to Function calling mode, it works. But we know the difference between these two modes, the ReAct is more helpful in some cases. so that i hope someone can help and fix it. thank you. <img width="1324" height="514" alt="Image" src="https://github.com/user-attachments/assets/d1049175-8c44-42bf-9f79-88db2dd88785" /> ### ✔️ Error log _No response_
yindo added the bug label 2026-02-16 10:19:39 -05:00
yindo closed this issue 2026-02-16 10:19:39 -05:00
Author
Owner

@dickens88 commented on GitHub (Aug 6, 2025):

I tried Qwen3:30b-a3b model, everything works fine with ReACT. With gpt-oss, if the question doesnt need any function calling everthing is fine, until I ask about time. So i suppose:

  • The loop in ReAct will determine whether the LLM's return result is a tool call (action). If it is, it will invoke _handle_invoke_action to execute the tool, then feed the observation back to the LLM to continue to the next round.
  • If the action is not correctly recognized, or if the observation is not included in the next round's prompt, the process will terminate prematurely.
@dickens88 commented on GitHub (Aug 6, 2025): I tried Qwen3:30b-a3b model, everything works fine with ReACT. With gpt-oss, if the question doesnt need any function calling everthing is fine, until I ask about time. So i suppose: - The loop in ReAct will determine whether the LLM's return result is a tool call (action). If it is, it will invoke `_handle_invoke_action` to execute the tool, then feed the `observation` back to the LLM to continue to the next round. - If the action is not correctly recognized, or if the observation is not included in the next round's prompt, the process will terminate prematurely.
Author
Owner

@QuietRocket commented on GitHub (Aug 7, 2025):

gpt-oss is a native reasoning model. ReAct was introduced at a time where models weren't trained to reason. Rather, we prompted them to imitate reasoning.

If I am not mistaken, the ReAct agent strategy induces a chain-of-thought like process through prompting.

According to OpenAI's documentation on best practices for reasoning models, they explicitly say:

Avoid chain-of-thought prompts: Since these models perform reasoning internally, prompting them to "think step by step" or "explain your reasoning" is unnecessary.

Thus, your observation that ReAct isn't working well is rather normal. The function calling agent strategy should yield better results because the agent knows how to plan and reason on its own.

@QuietRocket commented on GitHub (Aug 7, 2025): gpt-oss is a native reasoning model. ReAct was introduced at a time where models weren't trained to reason. Rather, we prompted them to imitate reasoning. If I am not mistaken, the ReAct agent strategy induces a chain-of-thought like process through prompting. According to OpenAI's documentation on [best practices for reasoning models](https://platform.openai.com/docs/guides/reasoning-best-practices#how-to-prompt-reasoning-models-effectively), they explicitly say: > Avoid chain-of-thought prompts: Since these models perform reasoning internally, prompting them to "think step by step" or "explain your reasoning" is unnecessary. Thus, your observation that ReAct isn't working well is rather normal. The function calling agent strategy should yield better results because the agent knows how to plan and reason on its own.
Author
Owner

@dickens88 commented on GitHub (Aug 7, 2025):

gpt-oss is a native reasoning model. ReAct was introduced at a time where models weren't trained to reason. Rather, we prompted them to imitate reasoning.

If I am not mistaken, the ReAct agent strategy induces a chain-of-thought like process through prompting.

According to OpenAI's documentation on best practices for reasoning models, they explicitly say:

Avoid chain-of-thought prompts: Since these models perform reasoning internally, prompting them to "think step by step" or "explain your reasoning" is unnecessary.

Thus, your observation that ReAct isn't working well is rather normal. The function calling agent strategy should yield better results because the agent knows how to plan and reason on its own.

Thank you for your reply, your explanation is very reasonable. We understand that COT is a relatively good approach. If, as OPENAI suggests, there are better practices for gpt-oss that do not involve COT prompts, I will proceed to test the effectiveness of gpt-oss in handling complex tool invocations.

Anyway, Function calling strategy works fine with gpt-oss. : )

@dickens88 commented on GitHub (Aug 7, 2025): > gpt-oss is a native reasoning model. ReAct was introduced at a time where models weren't trained to reason. Rather, we prompted them to imitate reasoning. > > If I am not mistaken, the ReAct agent strategy induces a chain-of-thought like process through prompting. > > According to OpenAI's documentation on [best practices for reasoning models](https://platform.openai.com/docs/guides/reasoning-best-practices#how-to-prompt-reasoning-models-effectively), they explicitly say: > > > Avoid chain-of-thought prompts: Since these models perform reasoning internally, prompting them to "think step by step" or "explain your reasoning" is unnecessary. > > Thus, your observation that ReAct isn't working well is rather normal. The function calling agent strategy should yield better results because the agent knows how to plan and reason on its own. Thank you for your reply, your explanation is very reasonable. We understand that COT is a relatively good approach. If, as OPENAI suggests, there are better practices for gpt-oss that do not involve COT prompts, I will proceed to test the effectiveness of gpt-oss in handling complex tool invocations. Anyway, Function calling strategy works fine with gpt-oss. : )
Author
Owner

@dosubot[bot] commented on GitHub (Aug 23, 2025):

Hi, @dickens88. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that the gpt-oss:20b model produces repetitive outputs in Agent node ReAct mode.
  • ReAct mode relies on chain-of-thought (COT) prompting, which is not suitable for gpt-oss's native reasoning.
  • Maintainer QuietRocket confirmed that Function calling mode works better for this model.
  • You acknowledged this and planned to test Function calling for complex tool invocations.

Next Steps:

  • Please confirm if this issue is still relevant with the latest version of dify-official-plugins by commenting here.
  • If no further updates are provided, I will automatically close this issue in 5 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 23, 2025): Hi, @dickens88. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that the gpt-oss:20b model produces repetitive outputs in Agent node ReAct mode. - ReAct mode relies on chain-of-thought (COT) prompting, which is not suitable for gpt-oss's native reasoning. - Maintainer QuietRocket confirmed that Function calling mode works better for this model. - You acknowledged this and planned to test Function calling for complex tool invocations. **Next Steps:** - Please confirm if this issue is still relevant with the latest version of dify-official-plugins by commenting here. - If no further updates are provided, I will automatically close this issue in 5 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#523