Repository navigation
Conversation
Same defect as future-agi#151 (fixed for openai in future-agi#245): the completion instrumentation wrote INPUT_VALUE three times, ending with "query" = eval_input[0] — the first message's text only — after already writing the joined text of every message. Multi-turn inputs lost all but the first content piece. Drop the query write and the now-unused "query" key from _process_messages so the joined eval_input survives; image parts still surface as {{input_images.N}} placeholders alongside INPUT_IMAGES. Also repairs three stale attribute assertions in the litellm test file that referenced pre-migration names (FI_SPAN_KIND -> GEN_AI_SPAN_KIND, LLM_MODEL_NAME -> GEN_AI_REQUEST_MODEL) so the file actually runs green. Generated with Devin Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This was referenced Oct 7, 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.
What does this PR do?
Fixes the litellm sibling of #151 (flagged in #245).
_instrument_func_type_completionwroteINPUT_VALUEthree times:safe_json_dumps(kwargs)— the full requestjson.dumps(filtered_messages)— structured messagesquery=eval_input[0]— first message's text only ← the bugSame mechanism as the openai handler: multi-turn conversations lost every message after the first in
input.value. Removed thequeryoverwrite and the now-unusedquerykey from_process_messages(private helper; no other consumers). Image parts still surface as{{input_images.N}}placeholders withINPUT_IMAGESset.Also repairs three stale assertions in the same test file —
FI_SPAN_KIND→GEN_AI_SPAN_KINDandLLM_MODEL_NAME→GEN_AI_REQUEST_MODEL(attribute names from the OTEL GenAI migration that the test file never picked up). Without this the file was red regardless of any change, which would have hidden the regression tests.Why?
Completes the fix for the bug family reported in #151 — the reporter scoped it to the openai handler, but litellm carried the identical overwrite.
How was it tested?
TestInputValueMultiMessageinpython/tests/test_framework_litellm.py: multi-message preservation through_instrument_func_type_completion, multimodal text+image placeholders,querykey absencepytest tests/test_framework_litellm.py— 43/43 pass (3 pre-existingFI_SPAN_KIND/LLM_MODEL_NAMEfailures repaired as part of this diff)Checklist
mainfix(litellm): …)