-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Fix: Remove <think> blocks from chat title generation #8239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Remove <think> blocks from chat title generation #8239
Conversation
- Update removeCodeBlocksAndTrim to handle <think> blocks from models like qwen3 - Add comprehensive test coverage for think block removal - Fixes issue where chat titles showed thinking process instead of content Fixes continuedev#5689
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 2 files
tingwai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for the improvement!
|
🎉 This PR is included in version 1.29.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.26.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
Fixed autodetect title generation for models that use
<think>blocks (like qwen3:30b). Updated theremoveCodeBlocksAndTrimfunction to remove thinking content before generating chat titles, preventing titles from showing the model's reasoning process instead of actual response content.AI Code Review
@continue-reviewChecklist
Tests
Added comprehensive test coverage in
core/util/index.test.tsfor:<think>block removal from textFixes
Closes #5689
Updated the
removeCodeBlocksAndTrimfunction to use greedy regex matching (/<think>[\s\S]*<\/think>/g) to properly handle all think block scenarios while maintaining existing code block removal functionality.Summary by cubic
Fixed autodetected chat titles for models that emit blocks (e.g., qwen3) by stripping thinking and code blocks before building the title, so titles reflect the actual answer.