Skip to content

fix: concatenate reasoning field in streaming response consolidation#5578

Merged
chitalian merged 1 commit intoHelicone:mainfrom
ink-the-squid:fix/streaming-reasoning-consolidation
Feb 17, 2026
Merged

fix: concatenate reasoning field in streaming response consolidation#5578
chitalian merged 1 commit intoHelicone:mainfrom
ink-the-squid:fix/streaming-reasoning-consolidation

Conversation

@ink-the-squid
Copy link
Contributor

Problem

consolidateTextFields() in responseParserHelpers.ts only concatenates content and function_call from streaming deltas, but ignores reasoning. This means reasoning tokens from providers like Gemini 2.5 (with thinking/reasoning enabled) get last-chunk-wins behavior instead of proper concatenation when stored.

Fix

Add reasoning field handling alongside content in the delta consolidation logic — same pattern, same null-safety.

Testing

  • Tested locally with Gemini 2.5 Flash streaming + reasoning_effort: high
  • Verified reasoning tokens are properly concatenated in stored response body
  • 4-line change, follows existing pattern exactly

consolidateTextFields() only concatenated content and function_call
from streaming deltas, but not reasoning. This meant reasoning tokens
from providers like Gemini with thinking/reasoning would get
last-chunk-wins behavior instead of proper concatenation.

Adds reasoning field handling alongside content in the delta
consolidation logic.
@vercel
Copy link

vercel bot commented Feb 17, 2026

@ink-the-squid is attempting to deploy a commit to the Helicone Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@chitalian chitalian merged commit 62d4e18 into Helicone:main Feb 17, 2026
4 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants