preserve output_config in Anthropic transformer#1389
Open
gigi206 wants to merge 1 commit into
Open
Conversation
Claude Code sends `output_config: { effort: ... }` to signal effort
level, but AnthropicTransformer's transformRequestOut dropped it when
building the UnifiedChatRequest, making it unavailable to downstream
transformers that could map it to provider-specific `reasoning_effort`.
Add `output_config?` to UnifiedChatRequest and copy it through.
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.
Problem
Claude Code sends an
output_config: { effort: <level> }field in the request body alongsidethinking, to signal the desired effort level (low/medium/high/xhigh/max). TheAnthropicTransformer.transformRequestOutrebuilds aUnifiedChatRequestand copies only the known fields, discardingoutput_config.Result: downstream transformers (provider-specific ones in
transformer.use[]) cannot see the effort level and have no way to map it to provider-specific parameters likereasoning_effort(DeepSeek V4, Kimi K2, etc.).Fix
output_configfield toUnifiedChatRequest.request.output_configthrough intransformRequestOut.The field is optional so existing requests without it are unaffected.
Use case
A custom transformer chained after
Anthropiccan now readrequest.output_config?.effortand translate it to its provider's effort vocabulary (e.g. DeepSeekreasoning_effort: low|medium|high|max, Kimireasoning_effort: minimal|low|medium|high|xhigh|none).