Skip to content

fix: convert reasoning_content to plain string in non‑streaming Gemini#1991

Open
KaveeshKhattar wants to merge 1 commit intoenvoyproxy:mainfrom
KaveeshKhattar:fix/gemini-reasoning-content-string
Open

fix: convert reasoning_content to plain string in non‑streaming Gemini#1991
KaveeshKhattar wants to merge 1 commit intoenvoyproxy:mainfrom
KaveeshKhattar:fix/gemini-reasoning-content-string

Conversation

@KaveeshKhattar
Copy link
Copy Markdown
Contributor

@KaveeshKhattar KaveeshKhattar commented Mar 27, 2026

Description

Non-streaming Gemini responses were returning reasoning_content as a nested object instead of a plain string. This breaks OpenAI-compatible clients.

This commit replaces the nested awsbedrock.ReasoningContentBlock with a direct string assignment for the reasoning content.

Related Issues/PRs

Fixes #1974

Validation

  • Added TestGeminiCandidatesToOpenAIChoices_ReasoningContent to verify the change.
  • make test and make precommit passed locally.

Notes

  • Gemini “thought signatures” are not included, as they are not part of the OpenAI schema.

Please suggest if signatures need to be handled differently.

@KaveeshKhattar KaveeshKhattar requested a review from a team as a code owner March 27, 2026 07:47
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Mar 27, 2026
@KaveeshKhattar KaveeshKhattar force-pushed the fix/gemini-reasoning-content-string branch from 1ff0e1b to 4451a3e Compare March 27, 2026 08:27
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.47%. Comparing base (98200a4) to head (22b701d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1991      +/-   ##
==========================================
+ Coverage   84.33%   84.47%   +0.13%     
==========================================
  Files         130      130              
  Lines       17987    17953      -34     
==========================================
- Hits        15170    15165       -5     
+ Misses       1873     1847      -26     
+ Partials      944      941       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…i responses

Signed-off-by: Kaveesh Khattar <kaveeshkhattar@gmail.com>
@KaveeshKhattar KaveeshKhattar force-pushed the fix/gemini-reasoning-content-string branch from 4451a3e to 22b701d Compare March 27, 2026 15:32
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAI-GCP Vertex AI translator: reasoning_content returned as nested dict instead of string (non-streaming)

2 participants