Repository navigation
fix(anthropic): preserve required fallback beta with custom headers - #158300
Merged
Merged
Conversation
RomneyDa
marked this pull request as ready for review
September 25, 2026 20:00
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
RomneyDa
enabled auto-merge (squash)
September 25, 2026 20:01
This was referenced Sep 25, 2026
roboclaw-bot
added a commit
that referenced
this pull request
Sep 25, 2026
Preserve authored selections, native thinking display and replay-bound cache carriers. Raise the OAuth identity floor and retain required fallback betas after custom headers and payload hooks without changing excluded transports. Backport #156093: 5e5f9c2 Backport #156062: 2f10ac3 Backport #157662: d29ac12 Backport #158300: 169da00 The initial #155966 support is already inherited from the stable cut. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: Serg <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vyctorbrzezowski <[email protected]> Co-authored-by: steipete <[email protected]> Co-authored-by: jalehman <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Sep 26, 2026
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 Problem This Solves
Fixes Anthropic API-key turns failing with HTTP 400 (
fallbacks: Extra inputs are not permitted) when a customanthropicBetaor beta header replaces the required server-side fallback beta. Found during live validation of #157595; this is a separate, preexisting failure.User Impact
Users can keep custom Anthropic betas enabled on direct API-key requests without breaking otherwise valid turns. No configuration migration is needed.
Why This Change Was Made
Derive the required fallback beta from the final request payload in the existing shared request-policy owner, after custom headers and payload hooks. Both SDK and native transports use it. OAuth, proxy, and injected-client exclusions remain in place.
Evidence
pnpm openclaw --profile ... agent --local, isolated state, stored API-key profile from 1Password, no provider credential environment variables, realhttps://api.anthropic.com/v1/messagesendpoint. Model:anthropic/claude-opus-5-5; custom beta:files-api-2025-04-14.f13c49ca203): HTTP 400,fallbacks: Extra inputs are not permitted; payload containedfallbacks: "default"but outgoing header omitted its required beta.LIVE_OK, normalstoptermination, 3.023 s agent turn. Payload still containsfallbacks: "default"; outgoing header includes both the custom files beta andserver-side-fallback-2026-07-01. Native OpenClaw harness and stored-profile credential provenance confirmed.pnpm test packages/ai/src/providers/anthropic.test.ts --maxWorkers=1: 110 passed, 2.71 s wall.pnpm test packages/ai/src/transports/anthropic-transport-stream.test.ts --maxWorkers=1: 143 passed, 2.58 s wall. Shared test-support module is exercised by these suites.git diff --checkandnode scripts/check-changed.mjspassed, including formatting, production and all 25 core-test typecheck graphs, lint, dead-export scan, import-cycle checks, and repository guards.95bd8ca65ab; CI test timings are pending.AI-assisted implementation and local verification; credentials and raw live logs are excluded from this PR.