Skip to content

fix(ai): Omit sampling parameters that Anthropic SDK 2 refuses - #6184

Merged
dan-petty merged 2 commits into
mainfrom
fix/5096-stop-sending-sampling-parameters-that-sdk-2-refuses
Nov 17, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/5096-stop-sending-sampling-parameters-that-sdk-2-refuses

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The Claude client sends temperature and top_p in extra_body. Anthropic SDK 2 sends API version 2026-10-21, which refuses those parameters with HTTP 400, so every Claude call fails at run time. The client now omits them when the installed SDK major is 2 or later and keeps the SDK 1 behavior, with an HTTP-seam test that refuses any such field.

Closes #5096

Change: openspec/changes/archive/2026-11-17-5096-stop-sending-sampling-parameters-that-sdk-2-refuses/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/ai AI review pipeline, personas, prompts, LLM client, or RAG labels Nov 17, 2026
@dan-petty
dan-petty marked this pull request as ready for review November 17, 2026 16:01
@dan-petty
dan-petty merged commit 1774ebf into main Nov 17, 2026
23 checks passed
@dan-petty
dan-petty deleted the fix/5096-stop-sending-sampling-parameters-that-sdk-2-refuses branch November 17, 2026 16:03
dan-petty pushed a commit that referenced this pull request Nov 17, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.173.2](v0.173.1...v0.173.2)
(2026-11-17)


### Bug Fixes

* **ai:** Omit sampling parameters that Anthropic SDK 2 refuses
([#6184](#6184))
([1774ebf](1774ebf))
* **pr:** Wait for the closing issue before setting its status
([#6179](#6179))
([383a20b](383a20b))
* **roadmap:** Confirm a rejection unless a chosen option names the tool
([#6186](#6186))
([95b60e7](95b60e7))
* **roadmap:** give stage and implement the item comments
([#6182](#6182))
([b5bd396](b5bd396))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/ai AI review pipeline, personas, prompts, LLM client, or RAG type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ai): stop sending sampling parameters that SDK 2 refuses

1 participant