Skip to content

feat: implement Claude 4.x model handling in invocation parameters#11287

Open
jash0803 wants to merge 6 commits intoArize-ai:mainfrom
jash0803:fix/claude-params-validation
Open

feat: implement Claude 4.x model handling in invocation parameters#11287
jash0803 wants to merge 6 commits intoArize-ai:mainfrom
jash0803:fix/claude-params-validation

Conversation

@jash0803
Copy link
Contributor

@jash0803 jash0803 commented Feb 8, 2026

  • Added support for Claude 4.x models to ensure only one of temperature or top_p can be set.
  • Introduced isClaude4 utility function to check model type.
  • Updated InvocationParametersFormFields to handle disabling fields based on model type.
  • Modified applyAnthropicInvocationParameterConstraints to filter parameters accordingly.
  • Adjusted playground_clients.py to remove top_p if temperature is set for Claude 4.x models.

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 temperature or top_p may 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 AnthropicStreamingClient both drop top_p when both are present (preferring temperature) to avoid invalid Claude 4.x calls.

Written by Cursor Bugbot for commit 048feab. This will update automatically on new commits. Configure here.

@jash0803 jash0803 requested review from a team as code owners February 8, 2026 02:19
@github-project-automation github-project-automation bot moved this to 📘 Todo in phoenix Feb 8, 2026
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 8, 2026
@RogerHYang RogerHYang self-assigned this Feb 9, 2026
const isDisabled =
isClaude4 &&
((field.invocationName === "temperature" && values["top_p"] != null) ||
(field.invocationName === "top_p" && values["temperature"] != null));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this flag is for claude 4 models

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

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

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: 📘 Todo

Development

Successfully merging this pull request may close these issues.

[BUG]: Playground allows invalid temperature + top_p combination for all Claude 4.x models

2 participants