Repository navigation
fix(openai): warn about reasoningContent once per request - #5016
Merged
Merged
Conversation
3 tasks done
AkshayShah03
marked this pull request as ready for review
October 8, 2026 19:32
liramon2
approved these changes
Oct 9, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
8 of 9 tasks
This was referenced Oct 21, 2026
1 task done
gautamsirdeshmukh
pushed a commit
to gautamsirdeshmukh/harness-sdk
that referenced
this pull request
Nov 2, 2026
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.
Human Overview
The "reasoningContent is not supported" warning was repeated for every earlier message on every request, logs filled up fast in long conversations; the check now runs once per request. LiteLLM also fixed. Once per request instead of once per model instance.
Description
OpenAIModelre-formats the whole history on every request and logged thereasoningContentwarning once per reasoning message each time, so a reasoning-model run of N turns logged about N²/2 copies (552k in the reporter's benchmark). The check now runs once over the history, so each request logs at most one warning.LiteLLMModelshares this formatter and gets the same fix.This warns once per request rather than once per model instance, as the issue suggested: the formatter is a classmethod with no instance to hold a "warned" flag, and the issue lists once per request as acceptable.
Resolves #4990
Related Issues
#4990, #1053 (how models handle reasoning content they didn't produce; this PR only changes how often the warning is logged)
Documentation PR
N/A — log-volume fix, no user-facing docs change.
Type of Change
Bug fix
Testing
Ran the issue's repro script: requests 1, 10 and 100 now each log 1 warning (100 in total over 100 requests, down from 5,050). Ran the OpenAI and LiteLLM model test suites and the full
strands-pyunit suite.hatch run prepareAdditional Details
Extended context (optional)
The
cachePointand location-source warnings in the same loop also repeat for every matching message on every request. They're left out of this PR to keep it focused.Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.