Skip to content

Conversation

@xzrderek
Copy link
Contributor

@xzrderek xzrderek commented Dec 3, 2025

Note

Surfaces provider_specific_fields (including reasoning_details) from LiteLLM responses and preserves reasoning_details in conversation history; adds a unit test.

  • Policy:
    • LiteLLMPolicy._make_llm_call: Return provider_specific_fields on the message; simplify tool_calls extraction via a single message_obj.
    • Message cleaning: Allow reasoning_details in _clean_messages_for_api.
    • Conversation history: In LLMBasePolicy, propagate provider_specific_fields.reasoning_details into assistant message as reasoning_details.
  • Tests:
    • Add tests/test_litellm_policy_provider_fields.py to verify provider_specific_fields (incl. reasoning_details and other fields) are preserved.

Written by Cursor Bugbot for commit 16ffbac. This will update automatically on new commits. Configure here.

assistant_message_for_history["tool_calls"] = message["tool_calls"]

if message.get("reasoning_details"):
assistant_message_for_history["reasoning_details"] = message["reasoning_details"]
Copy link

Choose a reason for hiding this comment

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

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)

Fix in Cursor Fix in Web

@xzrderek xzrderek merged commit e0923cf into main Dec 3, 2025
8 checks passed
@xzrderek xzrderek deleted the derekx/enable-gemini3-tau branch December 3, 2025 08:50
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.

3 participants