ragflow icon indicating copy to clipboard operation
ragflow copied to clipboard

[Bug]: `start_to_think` with no `end_to_think`

Open AI-Mart opened this issue 1 month ago • 10 comments

Self Checks

  • [x] I have searched for existing issues search for existing issues, including closed ones.
  • [x] I confirm that I am using English to submit this report (Language Policy).
  • [x] Non-english title submitions will be closed directly ( 非英文标题的提交将会被直接关闭 ) (Language Policy).
  • [x] Please do not modify this template :) and fill in all the required fields.

RAGFlow workspace code commit ID

de24e74b4c90ec154965c1bc7dc7a0fe79e669a1

RAGFlow image version

v0.21.1-slim

Other environment information


Actual behavior

Expected behavior

增加end_to_think字段,确保前端能判断已经思考完成了

Steps to reproduce

[Bug]: agent接口/api/v1/agents/{agent_id}/completions的模型回复只有start_to_think字段,没有end_to_think字段

Additional information

No response

AI-Mart avatar Nov 05 '25 02:11 AI-Mart

Hi @AI-Mart! I'm Dosu and I’m helping the ragflow team.

The /api/v1/agents/{agent_id}/completions endpoint currently does not guarantee the presence of the end_to_think field in its responses. While the backend's Canvas logic can emit both start_to_think and end_to_think fields when parsing and tokens, this is not enforced at the API level. The actual output depends on the agent's internal workflow and component logic, and there is no explicit handling or documentation ensuring end_to_think is always included in the response. To make frontend behavior predictable, the API handler or agent logic would need to systematically include the end_to_think marker where required.
Reference: session.py implementation
Reference: Canvas logic

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

dosubot[bot] avatar Nov 05 '25 02:11 dosubot[bot]

@AI-Mart Could you please share the steps to reproduce the issue?

Magicbook1108 avatar Nov 05 '25 07:11 Magicbook1108

直接调用agent接口聊天就可以发现,或者平台自带的前端也没有识别出来,全是灰色的,没有区分思考和正常回答

AI-Mart avatar Nov 05 '25 11:11 AI-Mart

@AI-Mart I cant reproduce your issue. Please provide more details. Which model and model provider you are using ? Image

Magicbook1108 avatar Nov 06 '25 10:11 Magicbook1108

用qwen3-32b

AI-Mart avatar Nov 08 '25 06:11 AI-Mart

接口没有结束思考的字段标记

AI-Mart avatar Nov 08 '25 06:11 AI-Mart

@AI-Mart I still cannot reproduce your issue with qwen3-32b, could you provide a screen shot of your issue? Image

Magicbook1108 avatar Nov 10 '25 02:11 Magicbook1108

Image 我是vllm本地部署的qwen3-14b模型 我也遇到这个bug了

579486 avatar Nov 10 '25 12:11 579486

要用工作流编排调试才能遇到

@AI-Mart I still cannot reproduce your issue with qwen3-32b, could you provide a screen shot of your issue? Image

要用工作流编排调试才能遇到

AI-Mart avatar Nov 10 '25 12:11 AI-Mart

I have same problem in agent.

BruceDou723 avatar Nov 26 '25 02:11 BruceDou723

We are rarely able to reproduce this issue, so there is limited assistance we can provide at this time.

Since there has been no further activity for over three weeks, we will proceed to close this issue. If the problem persists or you have additional questions, please feel free to reopen the issue or create a new one. We’re happy to assist anytime.

Magicbook1108 avatar Dec 15 '25 07:12 Magicbook1108