Conversation
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
rafaumeu
force-pushed
the
fix/reasoning-placeholder-leak-8081
branch
from
July 22, 2026 18:14
1231b02 to
d7a3917
Compare
This was referenced Jul 22, 2026
…diegosouzapw#8081) The internal sentinel '(prior reasoning summary unavailable)' is used as a fallback in reasoning fields for non-Anthropic Claude-shape providers. Some upstream providers incorrectly emit it in message.content or streaming delta.content, causing it to leak into visible response. Fix: stripReasoningPlaceholderFromContent() in responseSanitizer.ts, applied at both non-streaming (sanitizeMessageContent) and streaming (sanitizeStreamingChunk) paths. Handles bare, case-varied, <think>-wrapped, and 'Thinking:' prefixed variants. Placeholder is preserved in reasoning_content/reasoning fields. Tests: 9 new tests covering all variants + regression safety.
rafaumeu
force-pushed
the
fix/reasoning-placeholder-leak-8081
branch
from
July 22, 2026 18:55
d7a3917 to
6cdcc7a
Compare
Contributor
Author
|
Rebased against |
Owner
|
Obrigado pela contribuição, @rafaumeu. Para o #8081 (strip do reasoning placeholder) vamos seguir com o #8162 (@Dingding-leo), que é focado exclusivamente nesse bug e cobre os 4 call sites de tradução — enquanto este PR vem agrupado com mudanças de #8072 e #8059 e cobre um subconjunto. Fechando este em favor do #8162 (que estamos finalizando com a correção dos guards de finish_reason/tool_calls). Se identificar um caminho que o #8162 não cobra, reabra focado só nesse gap que integramos com crédito. |
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.
Fix: Reasoning placeholder leaks into message.content (#8081)
Problem
The internal sentinel
"(prior reasoning summary unavailable)"is used as a fallback in reasoning fields for non-Anthropic Claude-shape providers that rejectredacted_thinkingblobs.Some upstream providers incorrectly emit this sentinel in
message.contentor streamingdelta.content, causing it to leak into the visible response.Fix
Added
stripReasoningPlaceholderFromContent()inresponseSanitizer.ts, applied at non-streaming (sanitizeMessageContent) and streaming (sanitizeStreamingChunk) paths.Handles: bare, case-variations,
<think>-wrapped, and"Thinking:"prefixed variants.Safety
reasoning_content/reasoningfieldsmessage.contentanddelta.contentare cleanedcollapseExcessiveNewlines()runs after strip to prevent artifactsTests
9 new tests covering all variants. All 52 existing tests still pass.
Closes #8081