Repository navigation
fix(sse): keep output_config.format for the official Anthropic API-key provider - #16626
Merged
diegosouzapw merged 2 commits intoOct 15, 2026
Merged
diegosouzapw merged 2 commits into
diegosouzapw merged 2 commits into
Conversation
…y provider The Claude passthrough strip of output_config.format (#1719) only exempted the Claude OAuth provider, so structured output silently disappeared for first-party Anthropic API-key requests. Extract the strip into a pure helper and exempt both first-party ids (claude, anthropic); Claude-compatible gateways still lose format and keep effort. Co-authored-by: Rafli Ahmad Zulfikar <flashzapper@gmail.com> Inspired-by: decolua/9router#4050
Contributor
CI Coverage Report
Coverage artifact was not available for this run. |
diegosouzapw
deleted the
fix/port-pr-4050-output-config-format-anthropic
branch
October 18, 2026 23:50
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.
Summary
output_config.format(Fix fix: strip output_config.format for non-Anthropic Claude-format endpoints #1719) only exempted the Claude OAuth provider (claude), so structured output (json_schema) was silently dropped for the official Anthropic API-key provider (anthropic,https://api.anthropic.com/v1/messages).output_config.format; Claude-compatible gateways (MiniMax, Alibaba MaaS, DeepSeek via aggregators…) still loseformatand keepeffort.Attribution
Thanks to @raflyazf for the original implementation.
Changes
open-sse/handlers/chatCore/outputConfigFormatStrip.ts(new): pure helperstripOutputConfigFormatForCompat(body, provider)+FIRST_PARTY_ANTHROPIC_PROVIDERS = {claude, anthropic}.open-sse/handlers/chatCore.ts: the inline fix: strip output_config.format for non-Anthropic Claude-format endpoints #1719 block in the Claude passthrough branch now calls the helper (same strip semantics: deleteformat, drop an emptiedoutput_config).tests/unit/chatcore-output-config-format-strip.test.ts(new): helper cases (anthropic keeps, claude keeps, compat strips format/keeps effort, format-only dropsoutput_config, missing/null untouched) + an end-to-endhandleChatCorepassthrough toanthropicasserting the upstream body still carriesoutput_config.format.Not touched: MiniMax
dropOutputConfigquirk, theoutput_config.effortstrip for effort-encoded models, Bedrock/Vertex Claude (still stripped).Test plan
claude-only guard, the new test file failed 3/7 (official anthropic API-key provider keeps output_config.format,first-party Anthropic ids…,Claude passthrough to the anthropic API-key provider forwards output_config.format upstream— upstreamformatwasundefined). After the fix:node --import tsx/esm --test tests/unit/chatcore-output-config-format-strip.test.ts→ℹ tests 7 ℹ pass 7 ℹ fail 0claude-directive-midconv-passthrough,claude-directive-only-relocation,claude-passthrough-thinking-2454,chatcore-upstream-body,claude-code-compatible-request,cc-compatible-provider,claude-adaptive-thinking-normalize,antigravity-strip-output-config-1944,claude-helper-minimax-output-config,system-role-extraction,system-transforms-provider-scope,chatcore-sanitization,chatcore-reasoning-control,chatcore-model-output-cap-wiring,translator-openai-to-claude→ℹ tests 213 ℹ pass 213 ℹ fail 0npx eslint --suppressions-location config/quality/eslint-suppressions.json <changed files>→ clean;npx prettier --check <changed files>→ all formattednpm run typecheck:core→ cleanGITHUB_BASE_REF=release/v3.8.52 node scripts/check/check-pr-test-policy.mjs→Result: PASSGITHUB_BASE_REF=release/v3.8.52 npm run check:test-masking→OK — sem enfraquecimento