Repository navigation
fix(ai): split streamed reasoning when only </think> arrives - #1001
Merged
altic-dev merged 2 commits intoOct 1, 2026
Merged
Conversation
Chat templates that open the think block in the prompt (Qwen3 Thinking-2507) stream "reasoning</think>answer". StandardThinkingParser never saw an opening tag, so the reasoning stayed in the content. Split on that close in finalize when no opening tag was seen, as stripThinkingTags already does for non-streaming responses.
|
Preferring </think> over </thinking> regardless of position hid answer text when a </thinking> separator was followed by a stray </think>. stripThinkingTags matches whichever comes first; do the same.
8 of 12 tasks
renato-dransay
added a commit
to renato-dransay/FluidVoice
that referenced
this pull request
Oct 1, 2026
Brings in altic-dev/FluidVoice f0ef01c (unbounded FluidMeeting recording memory growth, altic-dev#1034) and 14f8457 (split streamed reasoning when only </think> arrives, altic-dev#1001). Conflict resolution: - MeetingAudioChunkWriter: adopt upstream's reportWriterFailure episode reporting, which covers append, chunk-start and finalization failures. It replaces the fork's lastNoChunkFailureDetail dedupe. - MeetingPCMFormatContractError: adopt upstream's "Unsupported PCM format: <reason>." description; keep the fork's MeetingPCMFormatNormalizer. - MeetingAudioChunkSinkTests: keep both helper recorders and update the fork's normalizer tests to the upstream error text.
6 of 12 tasks
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.
Description
With streaming, a response shaped like
reasoning</think>answerkeeps the reasoning in the content. Qwen3 Thinking-2507 answers this way by design (its chat template already opens<think>in the prompt), and a server that doesn't split reasoning out passes it straight through.StandardThinkingParsernever sees an opening tag, emits everything as content, andfinalizeonly strips the tag, so AI cleanup of a dictation, which always streams, inserts the model's reasoning along with the answer.The non-streaming path already splits this in
stripThinkingTags. This does the same inStandardThinkingParser.finalizewhen no opening tag was seen, so a stray close after a real<think>block (#836) is still left alone.Type of Change
Related Issue or Discussion
Related to #836, same parsing on the non-streaming side. No separate issue.
Testing
swiftlint --strict --config .swiftlint.yml(clean)swiftformat --config .swiftformat Sources(not installed here)xcodebuild testcommand with the same skip, 1716 tests, 0 failures. The newtestTagParserSplitsReasoningWhenOnlyCloseTagStreamsfails without the parser change (content comes back asReasoning.Ready.).Screenshots / Video
Notes
Model names containing "deepseek" go to
SeparateFieldThinkingParser, which doesn't look at inline tags at all, so the same output still leaks there. Left that for a separate change.