feat: implement Claude 4.x model handling in invocation parameters#11287
feat: implement Claude 4.x model handling in invocation parameters#11287jash0803 wants to merge 6 commits intoArize-ai:mainfrom
Conversation
…InvocationParametersFormFields
…InvocationParametersFormFields
| const isDisabled = | ||
| isClaude4 && | ||
| ((field.invocationName === "temperature" && values["top_p"] != null) || | ||
| (field.invocationName === "top_p" && values["temperature"] != null)); |
There was a problem hiding this comment.
Both fields disabled when temperature and top_p both set
Medium Severity
The isDisabled logic disables temperature when top_p is set and disables top_p when temperature is set. If both values are present simultaneously (e.g., after switching from a non-Claude-4 model where both were configured), both fields become disabled and the user is stuck — neither slider can be interacted with. Since the onChange handler that enforces mutual exclusion only runs on user interaction, there's no way to recover from this state. The condition needs to account for the "both set" case, for example by only disabling top_p when temperature is set (matching the "prefer temperature" behavior used elsewhere).
There was a problem hiding this comment.
this flag is for claude 4 models
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| const isDisabled = | ||
| isClaude4 && | ||
| ((field.invocationName === "temperature" && values["top_p"] != null) || | ||
| (field.invocationName === "top_p" && values["temperature"] != null)); |
There was a problem hiding this comment.
Top_p slider permanently disabled on Claude 4 models
Medium Severity
The isDisabled check for top_p evaluates values["temperature"] != null, but temperature always has a default value of 1.0 (via mergeInvocationParametersWithDefaults). Since there's no UI mechanism to "clear" a slider value back to undefined/null, this makes top_p permanently disabled on all Claude 4 models. The mutual exclusion effectively becomes one-directional — temperature always wins — and users can never opt to use top_p instead.
Similarly, if both values are already present when switching from a non-Claude-4 model (e.g., user set top_p on Claude 3 then switches to Claude 4), both sliders become disabled simultaneously, creating a UI deadlock with no way to resolve the conflict.


Fixes #11278
Note
Medium Risk
Touches both UI state management and server request parameter shaping for Anthropic models; mistakes could silently alter sampling behavior (e.g., unexpectedly dropping
top_p) for Claude 4.x invocations.Overview
Adds Claude 4.x model detection and enforces the provider constraint that only one of
temperatureortop_pmay be set.In the playground UI, setting one parameter now clears the other and the conflicting field is disabled to provide visual feedback. On the request path, Anthropic invocation-parameter constraints and the server-side
AnthropicStreamingClientboth droptop_pwhen both are present (preferringtemperature) to avoid invalid Claude 4.x calls.Written by Cursor Bugbot for commit 048feab. This will update automatically on new commits. Configure here.