Repository navigation
Conversation
8 tasks done
Contributor
Author
|
Bump — fixes multi-message context truncation in input.value. Mergeable. |
Third instance of the future-agi#151 defect family (openai future-agi#245, litellm future-agi#246): each wrapped call built its attribute dict with _get_query last, where query = eval_input[0] — the first message's text — overwriting the joined eval_input that carried every message. Remove the query write, its dead _get_query helper, and the "query" key from _extract_image_data; move _get_eval_input to the end of the chain so the joined multi-message text wins INPUT_VALUE, matching the openai, litellm, dspy, and groq handlers. Generated with Devin Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
jjcav84
force-pushed
the
fix/anthropic-input-value-context
branch
from
November 6, 2026 00:30
a803a72 to
9660687
Compare
This branch has not been deployed
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?
Third instance of the
INPUT_VALUEfirst-message-only defect family from #151 (openai → #245, litellm → #246).All five anthropic wrapper chains (
Completions×2,Messages×2,TokenCount) built their attribute dict ending with_get_query(query)wherequery = eval_input[0]— the first message's text only. It overwrote the joinedeval_inputproduced just earlier in the samechain(...), so multi-turn conversations lost every message after the first ininput.value.Fix, matching the sibling handlers (openai/litellm/dspy/groq all end on the joined text):
_get_query(query)from the five chains, delete the helper, and remove thequerykey from_extract_image_data(no other consumers)._get_eval_inputto last in each chain so the joined text winsINPUT_VALUE— previously_get_raw_input(full-kwargs JSON) would have won, which preserves context but diverges from the flat-text convention evaluators read.Why?
Same reported bug as #151: trace correctness for multi-message inputs.
How was it tested?
TestInputValueMultiMessageinpython/tests/test_framework_anthropic.py: joined text preserves every message, image placeholders embed correctly, and a directdict(chain(raw_input, eval_input))ordering assertion pins the winning writepytest tests/test_framework_anthropic.py::TestInputValueMultiMessage— 3/3 passmain: 7 pre-existing failures (anthropic.resources.completionsremoved in newer SDKs — instrumentor version drift, unrelated); same 7 fail before and after, zero regressionsChecklist
mainfix(anthropic): …)Added in second commit: the instrumentor imported
anthropic.resources.completionsunconditionally, but the current SDK removed that module — every test failed at_instrument. The import is now guarded (nothing to instrument when the resource is absent) and the two legacy-resource tests areskipif-gated.pytest tests/test_framework_anthropic.py: 10 pass, 1 skip (was 7 failed / 4 passed on clean main).