Repository navigation
Conversation
…thropic Signed-off-by: Dmitry Voropaev <dy.voropaev@gmail.com>
Contributor
nachiketb-nvidia
approved these changes
Oct 22, 2026
nachiketb-nvidia
left a comment
Contributor
There was a problem hiding this comment.
one nit, otherwise, LGTM!
|
|
||
| // OpenAI accepts "none" and "minimal" reasoning effort, which Anthropic does not. | ||
| #[test] | ||
| fn openai_reasoning_effort_maps_to_anthropic_effort() -> TestResult { |
Contributor
There was a problem hiding this comment.
can you check if there is an existing test you can extend rather than creating a new one? thank you!
Author
There was a problem hiding this comment.
Sure, folded it into openai_request_translates_system_developer_and_reasoning_to_anthropic in 88116c7. It reuses that request and just loops over none and minimal at the end. Sorry for the delay.
…easoning test Signed-off-by: Dmitry Voropaev <dy.voropaev@gmail.com>
This branch has not been deployed
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.
What
The Anthropic request encoder now maps the two OpenAI-only reasoning efforts.
"minimal"becomesoutput_config.effort = "low"with adaptive thinking."none"becomesthinking = {"type": "disabled"}and sends nooutput_config.effort. Every other effort value is passed through as before.Why
OpenAI Chat
reasoning_effortand Responsesreasoning.effortaccept"none"and"minimal". Anthropic'soutput_config.effortonly acceptslow,medium,high,xhighandmax.AnthropicMessagesCodec::encode_requestcopied the effort as is, so a Chat or Responses caller routed to ananthropic_messagestarget got a request Anthropic rejects with a 400. For example,{"reasoning_effort": "none"}from Chat was translated to{"thinking": {"type": "adaptive"}, "output_config": {"effort": "none"}}. That turns thinking on, which is the opposite of what the caller asked for, and the effort value is invalid."minimal"produced{"effort": "minimal"}, also invalid. Codex CLI withmodel_reasoning_effort = "minimal"or"none"is one way to hit it.Mapping
"none"to disabled thinking mirrors the reverse direction from #840, where Anthropic disabled thinking becomes Responseseffort: "none"."low"is the closest Anthropic effort to"minimal".Notes for reviewers
The change is in
crates/switchyard-translation/src/codecs/anthropic/buffered.rs.openai_request_translates_system_developer_and_reasoning_to_anthropicintests/request_translation.rsnow also sendsnoneandminimaland checksthinkingand the effort inoutput_config. It fails onmainand passes with the fix.One open choice is how to handle
"none". Per Anthropic's docs, Claude Opus 5.5, Claude Sonnet 5.5, Claude Fable 5 and Claude Fable 5.1 rejectthinking: {"type": "disabled"}, so on those models a"none"request still gets a 400. The other option is to leave out boththinkingand the effort, which every model accepts but which runs those models with thinking on at their default effort. I went with disabled because it does what the caller asked on the models that support it and matches #840. Today the request fails on every model, so either option is an improvement. Happy to switch if you prefer the other one.Tested with the pinned 1.99 toolchain.
cargo test -p switchyard-translationand clippy with-D warningspass.cargo fmt --all --checkis clean.cargo clippy --workspace --all-targets -- -D warningsis clean.Summary by CodeRabbit
nonenow disables thinking without adding an effort setting;minimalmaps tolow, whilelowandhighretain their corresponding effort levels.