fix(cli): hide thinking end tokens#12109
Closed
Githubguy132010 wants to merge 4 commits into
Closed
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Previous Review Summaries (2 snapshots, latest commit 07e2e0b)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 07e2e0b)Status: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Fix these issues in Kilo Cloud Files Reviewed (3 files)
Previous review (commit d6daabb)Status: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Fix these issues in Kilo Cloud Files Reviewed (4 files)
Reviewed by gpt-5.6-sol-20260709 · Input: 59.6K · Output: 6.5K · Cached: 316.6K Review guidance: REVIEW.md from base branch |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Collaborator
|
This is a provider-side issue, we shouldn't fix it in the client. |
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
Fixes #11982
Context
Some BYOK reasoning models, including MiniMax M3, emit model-specific thinking terminators as visible text deltas. These markers appeared in the final assistant message because providers do not consistently classify them as reasoning content.
Implementation
Filter known thinking end markers at the AI SDK stream adapter boundary before text reaches session processing. The filter buffers only a possible marker suffix so delimiters split across streaming chunks are removed without delaying ordinary text, and flushes unmatched partial text when a text block ends.
Screenshots / Video
N/A — no visual changes.
How to Test
Manual/local verification
bun test ././test/kilocode/reasoning-token.test.ts ././test/session/llm.test.tsfrompackages/opencode(33 tests passed).bun run typecheckfrompackages/opencodesuccessfully.bun run lintsuccessfully (pre-existing warnings only).bun run script/check-opencode-annotations.tssuccessfully.Reviewer test steps
<|end▁of▁thinking|>, including with the marker split between deltas.<and confirm it is preserved when the text block ends.Blocked checks and substitute verification
Checklist
Get in Touch
GitHub: @Githubguy132010