feat(reasoning): show reasoning output + toggle#152
Merged
Conversation
This PR add reasoning output to the panel. It cols be toggled with `/reasoning` or `/thinking`, `Opencode toggle_reasoning_output ` or `<leader>otr` This should resolve #138
Closed
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for displaying reasoning/thinking output from AI models in the output panel. Users can toggle the visibility of reasoning output using slash commands (/reasoning or /thinking), the Vim command :Opencode toggle_reasoning_output, or the keymap <leader>otr.
Key Changes:
- Added reasoning output formatting with timestamps and visual styling
- Implemented toggle functionality for showing/hiding reasoning output
- Added configuration option
show_reasoning_output(default: true)
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/data/reasoning.json | Test data containing sample reasoning message parts with timestamps |
| tests/data/reasoning.expected.json | Expected formatted output for reasoning test data |
| lua/opencode/ui/icons.lua | Added 'reasoning' icon () for display in output |
| lua/opencode/ui/highlight.lua | Added 'OpencodeReasoningText' highlight group for reasoning output styling |
| lua/opencode/ui/formatter.lua | Implemented _format_reasoning() function to format and display reasoning parts with timestamps and borders; updated _format_action() and _add_vertical_border() signatures |
| lua/opencode/types.lua | Added 'reasoning' to message part types and time field to OpencodeMessagePart |
| lua/opencode/config.lua | Added show_reasoning_output config option and keymaps for toggling reasoning/tool output |
| lua/opencode/api.lua | Implemented toggle_reasoning_output() function and added slash commands /reasoning and /thinking |
| README.md | Documented new keymaps, configuration options, and commands for reasoning output |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR add reasoning output to the panel.
It cols be toggled with
/reasoningor/thinking,Opencode toggle_reasoning_outputor<leader>otrThis should resolve #138