fix(fireworks_ai): keep reasoning_content on replayed assistant messages (#40682)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
devin-ai-integration[bot] 2026-09-11 18:47:37 -07:00 committed by GitHub
parent eed11ba59b
commit 7057b2f6c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 4 deletions

View file

@ -511,7 +511,6 @@ class FireworksAIConfig(FireworksAIMixin, OpenAIGPTConfig):
m = cast(dict, message)
m.pop("provider_specific_fields", None)
m.pop("thinking_blocks", None)
m.pop("reasoning_content", None)
return messages

View file

@ -501,8 +501,8 @@ def test_unmapped_model_fallback_function_calling():
assert info["supports_function_calling"] is True
def test_transform_messages_helper_strips_thinking_blocks():
"""thinking_blocks must not be forwarded to Fireworks chat completions."""
def test_transform_messages_helper_strips_thinking_blocks_but_keeps_reasoning_content():
"""Fireworks rejects thinking_blocks but requires reasoning_content to be replayed for reasoning_history."""
config = FireworksAIConfig()
messages = [
{"role": "user", "content": "Translate a poem."},
@ -519,7 +519,7 @@ def test_transform_messages_helper_strips_thinking_blocks():
messages, model="accounts/fireworks/models/glm-5p1", litellm_params={}
)
assert "thinking_blocks" not in out[1]
assert "reasoning_content" not in out[1]
assert out[1]["reasoning_content"] == "internal"
assert out[1]["content"] == "I can help."