Skip to content

Conversation

@joelrobin18
Copy link

@joelrobin18 joelrobin18 commented Dec 26, 2025

Description

When using Gemini with thinking mode enabled (thinking_config), reasoning content was being lost from the message history. The model returns both reasoning (thinking process) and text content in the same response, but only the text was captured.

This affected observability, tracing, and any downstream processing that relies on the conversation history containing the full model output.

Before:

[{"text": "2 + 2 = 4"}]

After:

[
  {"reasoningContent": {"reasoningText": {"text": "Let me calculate..."}}},
  {"text": "2 + 2 = 4"}
]

Related Issues

Fix #1394

Documentation PR

N/A

Type of Change

Bug fix

Testing

How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli

  • I ran hatch run prepare

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…text in same response

Signed-off-by: joel-robin_data <joel.robin@databricks.com>
@joelrobin18
Copy link
Author

@zastrowm @dbschmigelski @pgrayy Could you please review this PR? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Reasoning content is lost when model returns both reasoning and text in the same response

2 participants