Skip to content

[OPIK-7438] [BE] fix: gate sampling params for Anthropic adaptive-thinking models on the playground/inference path#7575

Draft
JetoPistola wants to merge 2 commits into
mainfrom
danield/OPIK-7438-gate-temperature-anthropic-playground-path
Draft

[OPIK-7438] [BE] fix: gate sampling params for Anthropic adaptive-thinking models on the playground/inference path#7575
JetoPistola wants to merge 2 commits into
mainfrom
danield/OPIK-7438-gate-temperature-anthropic-playground-path

Conversation

@JetoPistola

@JetoPistola JetoPistola commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Details

Follow-up to PR #7531 (online-rules judge path). That PR gated temperature server-side for Anthropic adaptive-thinking models (claude-sonnet-5, claude-opus-4-7/4-8) on the judge path, but deliberately left the sibling playground / online-inference / proxy path out of scope.

LlmProviderAnthropicMapper.toCreateMessageRequest still forwarded temperature / top_p unconditionally, so those models 400 with temperature is deprecated for this model for API-created requests — which bypass the FE sanitizer added in OPIK-6244.

Changes (backend-only, infrastructure/llm/antropic):

  • Convert the temperature / top_p MapStruct mappings to @Named resolvers that gate on AnthropicModelName.supportsSamplingParams(request.model()) and whenever extended thinking is enabled per-request via custom_parameters.thinking.type (any non-blank type other than disabled), mirroring the judge-path logic in AnthropicClientGenerator.
  • top_p is now also dropped when gated (previously it could leak once temperature was suppressed).
  • top_k is not sent on this path (ChatCompletionRequest has no top_k), so there is nothing to gate — no dead code added.

Change checklist

  • User facing
  • Documentation update

Issues

Testing

  • New nested SamplingParamsGating cases in AnthropicMappersTest (11): adaptive models drop temperature+top_p; sampling-capable models forward them; thinking-enabled (enabled/adaptive/future) drops them; disabled/blank/absent thinking forwards them.
  • Existing AnthropicMappersTest (7) unaffected — Podam random models default to sampling-supported.
  • mvn clean test-compile clean on Corretto 25; AnthropicMappersTest (18) + AnthropicClientGeneratorTest (32) all green; spotless:apply clean.

Documentation

No user-facing docs change required.

…nking models on the playground/inference path

LlmProviderAnthropicMapper.toCreateMessageRequest forwarded temperature/top_p unconditionally, so
adaptive-thinking models (claude-sonnet-5, claude-opus-4-7/4-8) 400 with "temperature is deprecated for
this model" on API-created playground/inference/proxy requests that bypass the FE sanitizer (OPIK-6244).

Gate temperature and top_p by AnthropicModelName.supportsSamplingParams(model) and whenever extended
thinking is enabled per-request via custom_parameters, mirroring the judge-path logic in
AnthropicClientGenerator (OPIK-7526 / PR #7531). top_k is not sent on this path (ChatCompletionRequest has
no top_k), so nothing to gate there.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the java Pull requests that update Java code label Jul 22, 2026
@github-actions github-actions Bot added Backend tests Including test files, or tests related like configuration. 🟡 size/M labels Jul 22, 2026
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

⏱️ pre-commit per-hook timing

Hook Description Result Duration
☕ spotless — java backend Format Java code 3.43s
Total (1 ran) 3.43s
⏭️ 40 skipped (no matching files changed)
Hook Description Result
🐍 trim trailing whitespace — python sdk Strip trailing whitespace ⏭️
🐍 fix end of files — python sdk Ensure files end in a newline ⏭️
🐍 ruff — python sdk Lint + autofix Python (ruff) ⏭️
🐍 ruff-format — python sdk Format Python code (ruff) ⏭️
🐍 mypy — python sdk Static type check ⏭️
🤖 trim trailing whitespace — optimizer Strip trailing whitespace ⏭️
🤖 fix end of files — optimizer Ensure files end in a newline ⏭️
🤖 check yaml — optimizer Validate YAML syntax ⏭️
🤖 check json — optimizer Validate JSON syntax ⏭️
🤖 check toml — optimizer Validate TOML syntax ⏭️
🤖 check for added large files — optimizer Block large files (>1MB) ⏭️
🔐 detect private key — optimizer Block committed private keys ⏭️
🤖 check for merge conflicts — optimizer Block merge-conflict markers ⏭️
🤖 check for case conflicts — optimizer Block case-only name clashes ⏭️
🤖 pyupgrade — optimizer Modernize Python syntax ⏭️
🤖 ruff — optimizer Lint + autofix Python (ruff) ⏭️
🤖 ruff-format — optimizer Format Python code (ruff) ⏭️
🤖 mypy — optimizer Static type check ⏭️
📓 nbstripout — optimizer notebooks Strip notebook output ⏭️
📝 markdownlint — optimizer Lint Markdown ⏭️
🔤 codespell — optimizer Fix common misspellings ⏭️
📊 radon cc — optimizer Cyclomatic-complexity gate ⏭️
📊 radon raw — optimizer Raw size metrics gate ⏭️
📊 xenon — optimizer Fail on complexity thresholds ⏭️
📊 lizard — optimizer Cyclomatic-complexity gate ⏭️
🧹 vulture — optimizer Find dead code ⏭️
🛡️ trim trailing whitespace — guardrails Strip trailing whitespace ⏭️
🛡️ fix end of files — guardrails Ensure files end in a newline ⏭️
🛡️ ruff — guardrails Lint + autofix Python (ruff) ⏭️
🛡️ ruff-format — guardrails Format Python code (ruff) ⏭️
🛡️ mypy — guardrails Static type check ⏭️
⚓ helm-docs Regenerate Helm chart README ⏭️
block non-public FE plugins Block non-public FE plugins ⏭️
🧪 pre-commit wrapper smoke tests Self-test the wrapper scripts ⏭️
🌐 eslint — frontend Lint + autofix JS/TS ⏭️
🌐 typecheck — frontend Whole-project tsc type check ⏭️
📘 eslint — typescript sdk Lint + autofix JS/TS ⏭️
📘 typecheck — typescript sdk Whole-project tsc type check ⏭️
⚙️ actionlint — github workflows Lint GitHub Actions workflows ⏭️
🐳 hadolint — dockerfiles Lint Dockerfiles ⏭️

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Backend Tests - Integration Group 13

 49 files   49 suites   4m 24s ⏱️
348 tests 346 ✅ 2 💤 0 ❌
343 runs  341 ✅ 2 💤 0 ❌

Results for commit d49a79b.

♻️ This comment has been updated with latest results.

…cedence in sampling gate

Addresses review on #7575: add claude-opus-4-7 to the adaptive-model gating parameterization
(all three adaptive models now asserted to drop temperature/top_p), and add a case setting both
temperature and top_p on a sampling-capable model to guard the precedence branch (temperature kept,
top_p null).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Backend Tests - Integration Group 1

426 tests   426 ✅  10m 51s ⏱️
 25 suites    0 💤
 25 files      0 ❌

Results for commit d49a79b.

♻️ This comment has been updated with latest results.

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

Labels

Backend baz: pending java Pull requests that update Java code 🟡 size/M tests Including test files, or tests related like configuration.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant