fix: #2806 sanitize AnyLLM responses replay input before validation#2813
Merged
Conversation
40b8a1d to
6f4057d
Compare
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.
This pull request fixes #2806 a multi-turn
AnyLLMModelResponses-path failure where replayed history could reach any-llm local validation with adapter-only metadata and explicitNonefields thatResponsesParamsdoes not accept.The bug shows up after prior turns have produced replay items such as reasoning blocks or tool calls that still contain fields like
provider_data, placeholder response IDs, orstatus: None. In that state, the request fails locally duringResponsesParams(**payload)construction before it ever reaches a backend such as vLLM or Ollama.This change narrows the fix to the adapter layer by sanitizing replayed Responses input before validation:
provider_dataNonefieldsThe change keeps any-llm validation in place for supported versions instead of bypassing validation globally with a shim. It also adds regression coverage for reasoning-item sanitization and for the AnyLLM Responses fetch path so subsequent tool turns continue to validate and execute with sanitized replay input.