Skip to content

fix(web): ensure thinking messages appear before text in message list#1060

Merged
RealKai42 merged 3 commits intomainfrom
kaiyi/fix-thinking-position
Feb 9, 2026
Merged

fix(web): ensure thinking messages appear before text in message list#1060
RealKai42 merged 3 commits intomainfrom
kaiyi/fix-thinking-position

Conversation

@RealKai42
Copy link
Copy Markdown
Collaborator

@RealKai42 RealKai42 commented Feb 9, 2026

Description

  • Handle models that stream text content before thinking content by inserting the thinking message before the existing text message instead of appending it
  • Only affects the case where text arrives before thinking within the same step; all other scenarios use the existing code path

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked the related issue, if any.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have run make gen-changelog to update the changelog.
  • I have run make gen-docs to update the user documentation.

Open with Devin

Copilot AI review requested due to automatic review settings February 9, 2026 06:42
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes message ordering in the web chat UI when a model streams text before thinking within the same step, so the “thinking” block still appears before the text message.

Changes:

  • Insert the newly-created “thinking” message before an existing text message when text arrived first in the step.
  • Add changelog entries documenting the behavior fix (root + EN/ZH docs).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
web/src/hooks/useSessionStream.ts Adjusts message insertion logic so thinking can be inserted before an already-created text message.
docs/zh/release-notes/changelog.md Documents the web fix in Chinese release notes.
docs/en/release-notes/changelog.md Documents the web fix in English release notes.
CHANGELOG.md Documents the web fix in the main changelog.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@RealKai42 RealKai42 merged commit a15aada into main Feb 9, 2026
24 checks passed
@RealKai42 RealKai42 deleted the kaiyi/fix-thinking-position branch February 9, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants