mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-08-04 20:08:40 +00:00
A reasoning model's turn showed its thinking below its answer while streaming, then flipped to thinking-above-answer once the turn settled. One message is rendered by two components with opposite ordering rules: while streaming, an AI message with content and reasoning but no tool calls yet is deliberately held out of the terminal bubble (#4304) and rendered by MessageGroup's chain-of-thought panel, which pinned the trailing reasoning disclosure to the bottom; the settled bubble paints its <Reasoning> disclosure above the content. Render the trailing reasoning disclosure before the assistant text that follows it, and emit a message's reasoning step before its content step in convertToSteps -- the step list was content-first, so ordering by step position alone could not fix it. Assistant text emitted before that reasoning keeps its earlier position. This also covers two cases the report does not mention: tool-using turns reversed the same way, and expanding "N more steps" showed a message's answer above its own thinking.