Merged
Conversation
dphuang2
reviewed
Dec 3, 2025
dphuang2
approved these changes
Dec 3, 2025
| assistant_message_for_history["tool_calls"] = message["tool_calls"] | ||
|
|
||
| if message.get("reasoning_details"): | ||
| assistant_message_for_history["reasoning_details"] = message["reasoning_details"] |
There was a problem hiding this comment.
Bug: Field name mismatch: reasoning_details vs reasoning_content
The new code uses reasoning_details as the field name, but the rest of the codebase (including the Message model in eval_protocol/models.py and the langchain adapter) uses reasoning_content. LiteLLM's documentation also uses reasoning_content. If LiteLLM returns the reasoning in a field called reasoning_content via provider_specific_fields, checking for message.get("reasoning_details") would return None and the reasoning content wouldn't be captured. Similarly, adding reasoning_details to allowed_fields wouldn't preserve the actual reasoning_content field.
Additional Locations (1)
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.
Note
Surfaces
provider_specific_fields(includingreasoning_details) from LiteLLM responses and preservesreasoning_detailsin conversation history; adds a unit test.provider_specific_fieldson the message; simplifytool_callsextraction via a singlemessage_obj.reasoning_detailsin_clean_messages_for_api.LLMBasePolicy, propagateprovider_specific_fields.reasoning_detailsintoassistantmessage asreasoning_details.tests/test_litellm_policy_provider_fields.pyto verifyprovider_specific_fields(incl.reasoning_detailsand other fields) are preserved.Written by Cursor Bugbot for commit 16ffbac. This will update automatically on new commits. Configure here.