Skip to content

fix(anthropic): preserve sibling keys beside function_response result - #7074

Open
FOWEPJF255 wants to merge 1 commit into
google:mainfrom
FOWEPJF255:fix/anthropic-result-sibling-keys-7073
Open

fix(anthropic): preserve sibling keys beside function_response result#7074
FOWEPJF255 wants to merge 1 commit into
google:mainfrom
FOWEPJF255:fix/anthropic-result-sibling-keys-7073

Conversation

@FOWEPJF255

Copy link
Copy Markdown

Summary

Test plan

  • PYTHONPATH=src pytest tests/unittests/models/test_anthropic_llm.py -k "sibling_keys or traditional_result or dict_result or with_content"

Fixes #7073

@google-cla

google-cla Bot commented Sep 9, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

When a tool response dict has result plus other keys, serialize the full dict for Claude tool_result content (parity with Gemini). Keep single-key {result: x} unwrapping. Fixes google#7073.

Rebased onto latest main.
@FOWEPJF255
FOWEPJF255 force-pushed the fix/anthropic-result-sibling-keys-7073 branch from b73e388 to 0957c60 Compare September 10, 2026 14:29
@FOWEPJF255

Copy link
Copy Markdown
Author

Rebased onto latest main and resolved the conflict in anthropic_llm.py:

CLA: cla/google is still required before review/import. Please sign at https://cla.developers.google.com/ (same Google account linked to GitHub FOWEPJF255), then re-check this PR.

@FOWEPJF255

Copy link
Copy Markdown
Author

Follow-up: the code conflict on main is resolved on this branch. cla/google is still required before review can proceed 鈥?I am completing the Google CLA signing for this account and will ping once the CLA check turns green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Anthropic/Claude: tool result dict with a result key drops every sibling key (only json.dumps(result) reaches the model)

2 participants