Repository navigation
fix(AIC-3735): send Claude Messages sampling parameters through extra_body - #256
Merged
Merged
Conversation
…_body anthropic 1.0.0 removed temperature, top_p and top_k from messages.create and messages.stream, so every claude-messages call whose AI Config set one raised "AsyncMessages.create() got an unexpected keyword argument". The API still accepts them, and extra_body is merged into the request JSON on every anthropic release, so the handler now sends them there. The wire body is unchanged on 0.113 and now works on 1.x and 2.x. The drift tests now cover the full allowed range (>=0.113): the sampling keys are no longer required in the SDK signatures, and diagnostics, speed and workspace_id (added after 0.113) are excluded. The thinking between_tools variant is listed as not forwarded yet. A new CI job runs the claude-messages suite against the newest anthropic, since the lock pins 0.113.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…est 1.x anthropic 2.x sends API version 2026-10-21, where the API returns 400 for temperature, top_p and top_k, so the extra_body route only holds for the anthropic 0.x and 1.x releases that send 2023-06-01. Cap claude-messages at anthropic<2 until a follow-up decides the 2026-10-21 behaviour. The newest-anthropic CI job now reads the requirement from claude-messages' pyproject.toml, because `uv pip install anthropic` ignores that cap, and uses --upgrade-package so only anthropic moves off the lock (plain --upgrade also upgraded opentelemetry-api and pydantic, breaking the OTel imports). It runs the full suite instead of claude-messages only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jeffdupont
marked this pull request as ready for review
October 30, 2026 20:15
andrewklatzke
approved these changes
Oct 30, 2026
Merged
jeffdupont
pushed a commit
that referenced
this pull request
Oct 30, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>launchdarkly-ai-server: 1.0.0</summary> ## [1.0.0](launchdarkly-ai-server-0.5.0...launchdarkly-ai-server-1.0.0) (2026-10-30) ### ⚠ BREAKING CHANGES * **client:** init_client raises when the LaunchDarkly client did not initialize ([#254](#254)) * **evaluations:** route generation and judges to a scoped wildcard handler only for its named providers, and accept two scoped wildcards of one mode when their lists differ * **AIC-3439:** let wildcard handlers accept only named providers * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) * **evaluations:** promote Evaluations from Code to core ([#235](#235)) * **client:** capture conversation content by default ([#213](#213)) * **evaluations:** remove default pass rate threshold ([#238](#238)) * **evaluations:** set default pass rate threshold ([#226](#226)) * **client:** spans carry launchdarkly.project_id instead of highlight.project_id * **AIC-3687:** rename create_openai_agent_handler to create_openai_agents_handler ([#225](#225)) * **skills:** rename FDv2SkillStore to LaunchDarklySkillStore ([#223](#223)) ### Features * **AIC-3439:** let wildcard handlers accept only named providers ([454a4de](454a4de)) * **AIC-3687:** rename create_openai_agent_handler to create_openai_agents_handler ([#225](#225)) ([a7cdbc0](a7cdbc0)) * **client:** add result variant and value to the feature_flag span event ([#240](#240)) ([040d487](040d487)) * **client:** capture conversation content by default ([#213](#213)) ([77a7cf5](77a7cf5)) * **client:** point judge spans at the run they graded ([#253](#253)) ([863d423](863d423)) * **evaluations:** promote Evaluations from Code to core ([#235](#235)) ([0bc43a5](0bc43a5)) * **evaluations:** remove default pass rate threshold ([#238](#238)) ([882d099](882d099)) * **evaluations:** route generation and judges to a scoped wildcard handler only for its named providers, and accept two scoped wildcards of one mode when their lists differ ([454a4de](454a4de)) * **evaluations:** set default pass rate threshold ([#226](#226)) ([7ee368c](7ee368c)) * **skills:** rename FDv2SkillStore to LaunchDarklySkillStore ([#223](#223)) ([11f2c0b](11f2c0b)) ### Bug Fixes * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) ([88e57e6](88e57e6)) * **AIC-3573:** never send a NativeTool to the model as a function tool ([#248](#248)) ([73caeae](73caeae)) * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) ([5860b40](5860b40)) * **AIC-3601:** stop graph routing text inviting a router to answer for its target ([#230](#230)) ([27b8d09](27b8d09)) * **client:** init_client raises when the LaunchDarkly client did not initialize ([#254](#254)) ([6e66c00](6e66c00)) * **client:** stamp launchdarkly.project_id on the telemetry resource ([#229](#229)) ([5347558](5347558)) * **evaluations:** copy inline tool schemas and name both sources on a key collision ([#227](#227)) ([bfbdd4c](bfbdd4c)) * **evaluations:** send criterion errors as errorMessage and skip criteria for rows that did not generate ([#228](#228)) ([8b05b56](8b05b56)) * **graph:** report a node's own judge scores on its node_done stream event ([#236](#236)) ([2f3f9ee](2f3f9ee)) ### Documentation * **AIC-3692:** say which project id attribute the telemetry resource carries ([#239](#239)) ([64eff43](64eff43)) * state that Agent Skills and Evaluations from Code need 1.0.0 ([#191](#191)) ([fe3ef08](fe3ef08)) </details> <details><summary>launchdarkly-ai-python: 1.0.0</summary> ## [1.0.0](launchdarkly-ai-python-0.4.0...launchdarkly-ai-python-1.0.0) (2026-10-30) ### ⚠ BREAKING CHANGES * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) * **evaluations:** promote Evaluations from Code to core ([#235](#235)) ### Features * **evaluations:** promote Evaluations from Code to core ([#235](#235)) ([0bc43a5](0bc43a5)) ### Bug Fixes * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) ([88e57e6](88e57e6)) * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) ([5860b40](5860b40)) ### Documentation * state that Agent Skills and Evaluations from Code need 1.0.0 ([#191](#191)) ([fe3ef08](fe3ef08)) </details> <details><summary>launchdarkly-ai-claude-agents: 1.0.0</summary> ## [1.0.0](launchdarkly-ai-claude-agents-0.3.0...launchdarkly-ai-claude-agents-1.0.0) (2026-10-30) ### ⚠ BREAKING CHANGES * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) * **claude-agents:** honour the config's max_tokens and disable thinking unless the config asks ([#237](#237)) * **client:** capture conversation content by default ([#213](#213)) * **AIC-3685:** make the internal provider helpers private ([#224](#224)) * **skills:** rename FDv2SkillStore to LaunchDarklySkillStore ([#223](#223)) ### Features * **AIC-3685:** make the internal provider helpers private ([#224](#224)) ([9afdb94](9afdb94)) * **client:** add result variant and value to the feature_flag span event ([#240](#240)) ([040d487](040d487)) * **client:** capture conversation content by default ([#213](#213)) ([77a7cf5](77a7cf5)) * **skills:** rename FDv2SkillStore to LaunchDarklySkillStore ([#223](#223)) ([11f2c0b](11f2c0b)) ### Bug Fixes * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) ([88e57e6](88e57e6)) * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) ([5860b40](5860b40)) * **claude-agents:** honour the config's max_tokens and disable thinking unless the config asks ([#237](#237)) ([a7ded1b](a7ded1b)) </details> <details><summary>launchdarkly-ai-claude-messages: 1.0.0</summary> ## [1.0.0](launchdarkly-ai-claude-messages-0.3.0...launchdarkly-ai-claude-messages-1.0.0) (2026-10-30) ### ⚠ BREAKING CHANGES * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) * **client:** capture conversation content by default ([#213](#213)) ### Features * **client:** add result variant and value to the feature_flag span event ([#240](#240)) ([040d487](040d487)) * **client:** capture conversation content by default ([#213](#213)) ([77a7cf5](77a7cf5)) ### Bug Fixes * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) ([88e57e6](88e57e6)) * **AIC-3573:** never send a NativeTool to the model as a function tool ([#248](#248)) ([73caeae](73caeae)) * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) ([5860b40](5860b40)) * **AIC-3735:** send Claude Messages sampling parameters through extra_body ([#256](#256)) ([c6d0376](c6d0376)) </details> <details><summary>launchdarkly-ai-openai-agents: 1.0.0</summary> ## [1.0.0](launchdarkly-ai-openai-agents-0.3.0...launchdarkly-ai-openai-agents-1.0.0) (2026-10-30) ### ⚠ BREAKING CHANGES * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) * **client:** capture conversation content by default ([#213](#213)) * **AIC-3685:** make the internal provider helpers private ([#224](#224)) * **AIC-3687:** rename create_openai_agent_handler to create_openai_agents_handler ([#225](#225)) ### Features * **AIC-3685:** make the internal provider helpers private ([#224](#224)) ([9afdb94](9afdb94)) * **AIC-3687:** rename create_openai_agent_handler to create_openai_agents_handler ([#225](#225)) ([a7cdbc0](a7cdbc0)) * **client:** add result variant and value to the feature_flag span event ([#240](#240)) ([040d487](040d487)) * **client:** capture conversation content by default ([#213](#213)) ([77a7cf5](77a7cf5)) ### Bug Fixes * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) ([88e57e6](88e57e6)) * **AIC-3573:** never send a NativeTool to the model as a function tool ([#248](#248)) ([73caeae](73caeae)) * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) ([5860b40](5860b40)) * **AIC-3716:** build OpenAI native graph node tools with FunctionTool ([#251](#251)) ([b859b67](b859b67)) * **AIC-3726:** realign three usage IDs with the 1.0 factory names ([#252](#252)) ([1c4d904](1c4d904)) </details> <details><summary>launchdarkly-ai-vercel-agents: 1.0.0</summary> ## [1.0.0](launchdarkly-ai-vercel-agents-0.2.0...launchdarkly-ai-vercel-agents-1.0.0) (2026-10-30) ### ⚠ BREAKING CHANGES * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) ### Features * **client:** add result variant and value to the feature_flag span event ([#240](#240)) ([040d487](040d487)) ### Bug Fixes * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) ([88e57e6](88e57e6)) * **AIC-3573:** never send a NativeTool to the model as a function tool ([#248](#248)) ([73caeae](73caeae)) * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) ([5860b40](5860b40)) </details> <details><summary>launchdarkly-ai-litellm-agents: 1.0.0</summary> ## [1.0.0](launchdarkly-ai-litellm-agents-0.2.0...launchdarkly-ai-litellm-agents-1.0.0) (2026-10-30) ### ⚠ BREAKING CHANGES * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) * **client:** capture conversation content by default ([#213](#213)) ### Features * **client:** add result variant and value to the feature_flag span event ([#240](#240)) ([040d487](040d487)) * **client:** capture conversation content by default ([#213](#213)) ([77a7cf5](77a7cf5)) ### Bug Fixes * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) ([88e57e6](88e57e6)) * **AIC-3573:** never send a NativeTool to the model as a function tool ([#248](#248)) ([73caeae](73caeae)) * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) ([5860b40](5860b40)) </details> <details><summary>launchdarkly-ai-openai-messages: 1.0.0</summary> ## [1.0.0](launchdarkly-ai-openai-messages-0.3.0...launchdarkly-ai-openai-messages-1.0.0) (2026-10-30) ### ⚠ BREAKING CHANGES * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) * **client:** capture conversation content by default ([#213](#213)) ### Features * **client:** add result variant and value to the feature_flag span event ([#240](#240)) ([040d487](040d487)) * **client:** capture conversation content by default ([#213](#213)) ([77a7cf5](77a7cf5)) ### Bug Fixes * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) ([88e57e6](88e57e6)) * **AIC-3573:** never send a NativeTool to the model as a function tool ([#248](#248)) ([73caeae](73caeae)) * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) ([5860b40](5860b40)) * **AIC-3726:** realign three usage IDs with the 1.0 factory names ([#252](#252)) ([1c4d904](1c4d904)) </details> <details><summary>launchdarkly-ai-vercel-messages: 1.0.0</summary> ## [1.0.0](launchdarkly-ai-vercel-messages-0.2.0...launchdarkly-ai-vercel-messages-1.0.0) (2026-10-30) ### ⚠ BREAKING CHANGES * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) ### Features * **client:** add result variant and value to the feature_flag span event ([#240](#240)) ([040d487](040d487)) ### Bug Fixes * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) ([88e57e6](88e57e6)) * **AIC-3573:** never send a NativeTool to the model as a function tool ([#248](#248)) ([73caeae](73caeae)) * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) ([5860b40](5860b40)) </details> <details><summary>launchdarkly-ai-litellm-messages: 1.0.0</summary> ## [1.0.0](launchdarkly-ai-litellm-messages-0.2.0...launchdarkly-ai-litellm-messages-1.0.0) (2026-10-30) ### ⚠ BREAKING CHANGES * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) * **client:** capture conversation content by default ([#213](#213)) ### Features * **client:** add result variant and value to the feature_flag span event ([#240](#240)) ([040d487](040d487)) * **client:** capture conversation content by default ([#213](#213)) ([77a7cf5](77a7cf5)) ### Bug Fixes * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) ([88e57e6](88e57e6)) * **AIC-3573:** never send a NativeTool to the model as a function tool ([#248](#248)) ([73caeae](73caeae)) * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) ([5860b40](5860b40)) </details> <details><summary>launchdarkly-ai-langchain-agents: 1.0.0</summary> ## [1.0.0](launchdarkly-ai-langchain-agents-0.3.0...launchdarkly-ai-langchain-agents-1.0.0) (2026-10-30) ### ⚠ BREAKING CHANGES * **evaluations:** route generation and judges to a scoped wildcard handler only for its named providers, and accept two scoped wildcards of one mode when their lists differ * **AIC-3439:** let wildcard handlers accept only named providers * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) * **client:** capture conversation content by default ([#213](#213)) ### Features * **AIC-3439:** let wildcard handlers accept only named providers ([454a4de](454a4de)) * **client:** add result variant and value to the feature_flag span event ([#240](#240)) ([040d487](040d487)) * **client:** capture conversation content by default ([#213](#213)) ([77a7cf5](77a7cf5)) * **evaluations:** route generation and judges to a scoped wildcard handler only for its named providers, and accept two scoped wildcards of one mode when their lists differ ([454a4de](454a4de)) ### Bug Fixes * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) ([88e57e6](88e57e6)) * **AIC-3573:** never send a NativeTool to the model as a function tool ([#248](#248)) ([73caeae](73caeae)) * **AIC-3590:** build Python langchain-agents with langchain.agents.create_agent ([#175](#175)) ([8218626](8218626)) * **AIC-3592:** make native LangGraph hand-offs complete ([#246](#246)) ([bfb738f](bfb738f)) * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) ([5860b40](5860b40)) </details> <details><summary>launchdarkly-ai-langchain-messages: 1.0.0</summary> ## [1.0.0](launchdarkly-ai-langchain-messages-0.3.0...launchdarkly-ai-langchain-messages-1.0.0) (2026-10-30) ### ⚠ BREAKING CHANGES * **evaluations:** route generation and judges to a scoped wildcard handler only for its named providers, and accept two scoped wildcards of one mode when their lists differ * **AIC-3439:** let wildcard handlers accept only named providers * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) * **client:** capture conversation content by default ([#213](#213)) ### Features * **AIC-3439:** let wildcard handlers accept only named providers ([454a4de](454a4de)) * **client:** add result variant and value to the feature_flag span event ([#240](#240)) ([040d487](040d487)) * **client:** capture conversation content by default ([#213](#213)) ([77a7cf5](77a7cf5)) * **evaluations:** route generation and judges to a scoped wildcard handler only for its named providers, and accept two scoped wildcards of one mode when their lists differ ([454a4de](454a4de)) ### Bug Fixes * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) ([88e57e6](88e57e6)) * **AIC-3573:** never send a NativeTool to the model as a function tool ([#248](#248)) ([73caeae](73caeae)) * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) ([5860b40](5860b40)) * **AIC-3726:** realign three usage IDs with the 1.0 factory names ([#252](#252)) ([1c4d904](1c4d904)) </details> <details><summary>launchdarkly-ai-opencode-agents: 1.0.0</summary> ## [1.0.0](launchdarkly-ai-opencode-agents-0.3.0...launchdarkly-ai-opencode-agents-1.0.0) (2026-10-30) ### ⚠ BREAKING CHANGES * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) ### Features * **client:** add result variant and value to the feature_flag span event ([#240](#240)) ([040d487](040d487)) ### Bug Fixes * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) ([88e57e6](88e57e6)) * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) ([5860b40](5860b40)) </details> <details><summary>launchdarkly-ai-typesafe: 1.0.0</summary> ## [1.0.0](launchdarkly-ai-typesafe-0.2.0...launchdarkly-ai-typesafe-1.0.0) (2026-10-30) ### ⚠ BREAKING CHANGES * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) * **client:** capture conversation content by default ([#213](#213)) ### Features * **client:** add result variant and value to the feature_flag span event ([#240](#240)) ([040d487](040d487)) * **client:** capture conversation content by default ([#213](#213)) ([77a7cf5](77a7cf5)) ### Bug Fixes * **AIC-3568:** give the barrel core's __all__, and drop private-spec references ([#234](#234)) ([88e57e6](88e57e6)) * **AIC-3598:** make Python packaging and public types GA-ready ([#218](#218)) ([5860b40](5860b40)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > This is a **Release Please** cut that moves every monorepo package to **1.0.0** and records the GA release in changelogs. It updates `.release-please-manifest.json`, each package’s `pyproject.toml` / `__version__`, and prepends **1.0.0** notes to every `CHANGELOG.md`. > > Handler and barrel packages now require **`launchdarkly-ai-server>=1.0.0,<2`**, so installs must upgrade the core client in lockstep with adapters. > > There is **no new application logic** in this diff—only release metadata. The changelog text still matters for reviewers: it summarizes breaking work already on `main`, including **Evaluations from Code promoted to core**, **conversation content captured by default**, **`init_client` failing when LD init fails**, telemetry **`launchdarkly.project_id`**, renames like **`LaunchDarklySkillStore`** and **`create_openai_agents_handler`**, tightened **wildcard handler routing**, and **GA packaging / public `__all__`** cleanup. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 2e904f7. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
Jira: https://launchdarkly.atlassian.net/browse/AIC-3735
Spec: launchdarkly/ai-sdks-monorepo#125
What broke
Every
claude-messagescall whose AI Config settemperature(ortop_p/top_k) failed with anthropic 1.x installed:anthropic 1.0.0 (2026-08-20) removed
temperature,top_pandtop_kfrommessages.create(),messages.stream()andmessages.parse(). Passing them is now aTypeError.stop_sequencesis still accepted. anthropic-sdk-pythonMIGRATION.md, "Removed: deprecated request parameters", says to remove them or, for a model that still honours them, pass them throughextra_body. It also says: "The sampling parameters are only gone from the method signatures, not from the API."The handler forwarded them as keyword arguments since #107. CI didn't catch it:
pyproject.tomlallowedanthropic>=0.113, but every job syncs fromuv.lock, which pins 0.113.0, so nothing ever ran against 1.x. The mock-based handler tests passed anyway, because aMagicMockclient accepts any kwarg.The fix
_forwarded_parametersmovestemperature/top_p/top_k(_MESSAGES_SAMPLING_KEYS) intoextra_body.extra_bodyis merged into the request JSON on every anthropic release, so the wire body is unchanged on 0.113 and works on 1.x. Bothinvokeandstreamread this function. A config-suppliedextra_bodyis still dropped.claude-messagesnow requiresanthropic>=0.113,<2(that package only;uv.lockupdated, and it still pins 0.113.0). anthropic 2.x sends API version2026-10-21(anthropic/_constants.pyin 2.3.0:ANTHROPIC_API_VERSION = "2026-10-21"). On that version, the API returns 400 fortemperature,top_pandtop_k, "even at the parameter's default value" (https://platform.claude.com/docs/en/api/migration-2026-10-21, "Sampling parameters are removed"). So theextra_bodyroute only holds for anthropic 0.x and 1.x, which send2023-06-01. Support for anthropic 2 is a follow-up that decides the2026-10-21behaviour: AIC-3736.test_parameter_forwarding.pynow cover the whole allowed range. The sampling keys are no longer required in the SDK signatures, and keys added in 1.x aren't flagged as stale on 0.113.test_forwarded_parameters_bind_to_the_installed_sdk[create|stream]binds the handler's kwargs to the installed SDK's real signatures.temperatureand asserts it reaches the HTTP body. It pickshttpx/httpx2from what anthropic's own client imports, because 1.x rejects anhttpxclient.New CI job:
test-latest-anthropicThe lock keeps 0.113.0 (the lowest supported version). The new job:
uv pip install --upgrade-package anthropic -r packages/claude-messages/pyproject.toml,uv run --no-sync pytest).The requirement is read from
claude-messages' ownpyproject.tomlbecauseuv pip install anthropicignores the installed package's<2cap: I checked, and it installed 2.3.0.--upgrade-packagemoves only anthropic. The job's first version used--upgrade, which also upgradedopentelemetry-apiandpydanticand broke the OTel imports in the full suite. Today the job resolves anthropic 1.17.0, and compared with the lock, only anthropic changes.mainhas no required status checks, so this job is advisory unless someone adds it.Other SDKs
messages.create/.stream. Fixed here, and capped below 2.x.js-ai-sdkclaude-messages)@anthropic-ai/sdkis pinned^0.103.0(resolves below 0.104.0), which sends API2023-06-01. A 1.x bump moves it to2026-10-21(client.jsin 1.3.0), where these keys are a 400, so that bump needs the same decision.go-ai-sdkclaudemessages)model.parameterswithparams.SetExtraFields(raw JSON), and go.mod pins v1.80.0. The latest v1 is v1.84.0, which still hasTemperature/TopK/TopP. v2 (v2.4.0) is a separate/v2module on API2026-10-21.This PR doesn't change which keys are forwarded (only how they're sent), so the Claude Messages list still matches JS. Go's list already differed before this PR (it forwards
container,inference_geo,metadata, andoutput_configwhole), and that is out of scope here.Policy decisions for reviewers
diagnostics,workspace_idandspeed, which arrived in anthropic 1.x after 1.0.0. None of them shapes what the model generates: a diagnostics opt-in, a workspace-selection header, and a price/latency mode. Forwarding one later is additive. JS and Go don't forward them either.thinking: {"type": "between_tools"}is not forwarded. It also arrived in 1.x after 1.0.0. A config that sets it is dropped, not an error.test_the_shapes_match_the_sdk_typeslists it as a known gap. To forward it, add it to_TYPED_OBJECT_SHAPESand remove it from that list. The spec PR names it as not forwarded.Test output
Before the fix (original
handler.py), wire test:After (head
7a54bf0), full repopytest:make lintandmake format-checkare clean, andmake typecheckreports no issues in 106 source files. The cap fires: resolvingclaude-messageswithanthropic==2.3.0fails with "depends on anthropic>=0.113,<2 … unsatisfiable".Not run against the live Anthropic API.
🤖 Generated with Claude Code
Note
Overview
Fixes AIC-3735: AI Configs that set
temperature,top_p, ortop_kno longer crash on anthropic 1.x, which removed those keys frommessages.create/.streamkwargs.Handler:
_forwarded_parametersnow strips_MESSAGES_SAMPLING_KEYSand sends them inextra_bodyso the request JSON stays the same on 0.113 and binds cleanly on 1.x. Newer SDK-only params (diagnostics,speed,workspace_id) are documented as excluded, not forwarded.Dependency:
claude-messagesrequiresanthropic>=0.113,<2(anthropic 2.x API rejects sampling params even viaextra_body).CI & tests: Adds
test-latest-anthropic(upgrade anthropic within the cap, fullpytest). Drift tests treat sampling keys as signature-optional; new test binds handler output to the installed SDK. Handler tests assertextra_bodyand wire-level sampling; wire tests use anthropic’s httpx2 when present.Reviewed by Cursor Bugbot for commit 7a54bf0. Bugbot is set up for automated code reviews on this repo. Configure here.