Skip to content

preserve output_config in Anthropic transformer#1389

Open
gigi206 wants to merge 1 commit into
musistudio:mainfrom
gigi206:fix/preserve-output-config-in-anthropic-transformer
Open

preserve output_config in Anthropic transformer#1389
gigi206 wants to merge 1 commit into
musistudio:mainfrom
gigi206:fix/preserve-output-config-in-anthropic-transformer

Conversation

@gigi206
Copy link
Copy Markdown

@gigi206 gigi206 commented May 11, 2026

Problem

Claude Code sends an output_config: { effort: <level> } field in the request body alongside thinking, to signal the desired effort level (low/medium/high/xhigh/max). The AnthropicTransformer.transformRequestOut rebuilds a UnifiedChatRequest and copies only the known fields, discarding output_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 like reasoning_effort (DeepSeek V4, Kimi K2, etc.).

Fix

  • Add an optional output_config field to UnifiedChatRequest.
  • Copy request.output_config through in transformRequestOut.

The field is optional so existing requests without it are unaffected.

Use case

A custom transformer chained after Anthropic can now read request.output_config?.effort and translate it to its provider's effort vocabulary (e.g. DeepSeek reasoning_effort: low|medium|high|max, Kimi reasoning_effort: minimal|low|medium|high|xhigh|none).

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant