feat(ui): add chain-of-thought panel above assistant messages #2899
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Many open weight models support to reveal the CoT process (while many of the providers hide it in the API). This PR adds a collapsible “Show thinking” panel that surfaces the assistant’s Chain-of-Thought (anything wrapped in
<think> … </think>) above every assistant message, while keeping the final answer unchanged.UI Preview
cot_2x.mov
Key Changes
ui/desktop/src/components/GooseMessage.tsx• Parses message text for
<think>blocks.• Stores the visible reply and CoT separately.
• Renders a
<details>element at the top of the message:summary→ “Show thinking”, body → rendered Markdown of the CoT.• Leaves existing timestamp, copy-link, images, tool-call handling untouched.
• Mirrors UX patterns of other AI chat apps that transparently expose the model’s reasoning without cluttering the main conversation.
• Keeps the default view concise; CoT is opt-in via a single click.
• No back-end or protocol changes required—pure front-end enhancement.
Testing