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.

@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.

@FOWEPJF255

Copy link
Copy Markdown
Author

I have signed the Google CLA for this account / commit identity. Please re-check cla/google.

@FOWEPJF255

Copy link
Copy Markdown
Author

Closing temporarily to refresh cla/google status after signing.

@FOWEPJF255 FOWEPJF255 closed this Sep 12, 2026
@FOWEPJF255 FOWEPJF255 reopened this Sep 12, 2026
@FOWEPJF255

Copy link
Copy Markdown
Author

CLA data updated (GitHub username FOWEPJF255 + emails including the commit address). Please re-check cla/google.

@FOWEPJF255

Copy link
Copy Markdown
Author

cla/google is now green after CLA data + New Contributors rescan. Ready for review when convenient.

@FOWEPJF255

Copy link
Copy Markdown
Author

Temporarily closing to refresh import/copybara after cla/google turned green.

@FOWEPJF255 FOWEPJF255 closed this Sep 12, 2026
@FOWEPJF255 FOWEPJF255 reopened this Sep 12, 2026
@FOWEPJF255
FOWEPJF255 force-pushed the fix/anthropic-result-sibling-keys-7073 branch from 0957c60 to b80c292 Compare September 13, 2026 09:43
@FOWEPJF255

Copy link
Copy Markdown
Author

Rebased onto latest main today (b80c292). Please re-check cla/google for the updated commit identity (GitHub FOWEPJF255).

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 2 times, most recently from 4b66efb to 22f996e Compare September 13, 2026 10:16
@FOWEPJF255

Copy link
Copy Markdown
Author

CLA tip refreshed to lsmlhi_25 <lhi25wy@163.com> (22f996e). cla/google is green again after the earlier qq.com authorship mismatch. Ready for review.

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