fix(transcript): wrap reasoning in <thinking> tags in markdown export#25368
Open
1fanwang wants to merge 1 commit intoanomalyco:devfrom
Open
fix(transcript): wrap reasoning in <thinking> tags in markdown export#253681fanwang wants to merge 1 commit intoanomalyco:devfrom
1fanwang wants to merge 1 commit intoanomalyco:devfrom
Conversation
The `_Thinking:_` open delimiter had no closing counterpart, so a downstream parser couldn't tell where reasoning ends and the assistant response begins in the exported markdown. Switch the wrapper to `<thinking>...</thinking>`, which is well-formed and matches the native output of reasoning models like DeepSeek, Qwen3, and GLM. Live TUI rendering is intentionally untouched — that's anomalyco#11439. Closes anomalyco#25308 Signed-off-by: 1fanwang <[email protected]>
This was referenced May 2, 2026
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.
Issue for this PR
Closes #25308
Type of change
What does this PR do?
The markdown transcript renders thinking content with a
_Thinking:_open delimiter that has no closing counterpart, so a downstream parser can't tell where reasoning ends and the assistant response begins.This swaps the wrapper to
<thinking>...</thinking>informatPart'sreasoningbranch. The shape is well-formed (closing tag present) and matches the native output of reasoning models like DeepSeek, Qwen3, and GLM, so the same parser can handle live model output and exported transcripts.The live TUI render in
cli/cmd/tui/routes/session/index.tsxis intentionally untouched — that's a separate concern (#11439) about UI rendering, not the markdown export artifact.How did you verify your code works?
From
packages/opencode:The existing
formats reasoning when thinking enabledassertion is updated to match the new shape.Screenshots / recordings
N/A — markdown text format change only.
Checklist