Skip to content

Native Messages lane forwards thinking.block_binding but drops its beta → 400 Extra inputs are not permitted #7102

Closed

Description

@Liang-Psych

Client or integration

Other — Posit Assistant 1.8.0 (Positron), speaking native Anthropic Messages to OpenCodex

Area

Provider adapter

Summary

On the managed native Messages lane, thinking.block_binding is forwarded in the body while its required beta thinking-binding-controls-2026-08-01 is dropped from anthropic-beta by the PF-10 allowlist. Anthropic then rejects the whole request:

400 invalid_request_error: thinking.adaptive.block_binding: Extra inputs are not permitted

thinking is on ANTHROPIC_MESSAGES_PASSTHROUGH_FIELDS, so the object is copied as-is, including block_binding. The beta is in neither FIRST_PARTY_BETAS nor NATIVE_CLIENT_BETAS (not even KNOWN_UNFORWARDED_BETAS), so it is counted as an unnamed drop. Header and body end up disagreeing, which is exactly what the context_management pairing in buildAnthropicMessagesPassthroughRequest was written to prevent, but block_binding is not covered by it.

This started for us with Posit Assistant 1.8.0, whose changelog fixes "Claude 400 errors when earlier thinking no longer matches the prompt" by sending block_binding: { prefix_mismatch_behavior: "drop_block" } plus the beta. Other clients do the same (opencode, pi, oh-my-pi), so any of them routed through OpenCodex should hit this on every adaptive-thinking request.

Expected: either forward the beta together with the field, or strip the field when the beta is dropped. Never send one without the other.

Anthropic docs on the field and the beta: https://platform.claude.com/docs/en/build-with-claude/preserved-thinking

Reproduction

Against main at 2.85.0 (732fba6), key-auth provider on https://api.anthropic.com:

import { buildAnthropicMessagesPassthroughRequest } from "./src/adapters/anthropic/passthrough";
const p = { adapter: "anthropic", baseUrl: "https://api.anthropic.com", authMode: "key", apiKey: "k" } as any;
const body = { model: "x", max_tokens: 16, messages: [{ role: "user", content: "hi" }],
  thinking: { type: "adaptive", block_binding: { prefix_mismatch_behavior: "drop_block" } } };
const r = buildAnthropicMessagesPassthroughRequest(p, "claude-haiku-5-5", body, undefined,
  { callerAnthropicBeta: "thinking-binding-controls-2026-08-01" });
console.log(r.headers["anthropic-beta"] ?? "(none)");   // (none)
console.log(JSON.stringify(r.wireBody.thinking));       // block_binding still present
console.log(r.droppedBetas, r.droppedUnrecognizedBetas); // true 1

Sent upstream, that request returns the 400 above.

Version

Observed on an installed build reporting contractVersion: 2026-09-25.2; reproduced on main 2.85.0 (732fba6)

Operating system

macOS (Apple Silicon, arm64)

Provider and model

anthropic (api key) / claude-haiku-5-5. Any adaptive-thinking model should behave the same.

Logs or error output

"model": "claude-haiku-5-5",
"status": 400,
"errorCode": "invalid_request_error",
"upstreamError": "thinking.adaptive.block_binding: Extra inputs are not permitted",
"failureStage": "headers-only",
"failureCause": "payload-rejected",
"resendPermission": "refused-futile",
"reasonCodes": ["anthropic-beta-dropped", "same-wire-native"],
"contractVersion": "2026-09-25.2"

Proposed fix

Tested locally; happy to open a PR if useful.

  1. Add thinking-binding-controls-2026-08-01 to FIRST_PARTY_BETAS. It meets the stated bar: no billing tier and no retained server state. It only makes the API drop a stale thinking block instead of refusing the request.
  2. Pair it with the body like context_management: when the beta does not survive the allowlist (compatible third party, or the caller sent no beta), strip thinking.block_binding copy-on-write and keep the rest of thinking.
--- a/src/adapters/anthropic/beta-allowlist.ts
+++ b/src/adapters/anthropic/beta-allowlist.ts
@@ const FIRST_PARTY_BETAS: readonly string[] = [
   "interleaved-thinking-2025-05-14",
+  "thinking-binding-controls-2026-08-01",
 ];
@@
+export const THINKING_BINDING_BETA = "thinking-binding-controls-2026-08-01";
--- a/src/adapters/anthropic/passthrough.ts
+++ b/src/adapters/anthropic/passthrough.ts
+export function withoutThinkingBlockBinding(body: Rec): Rec {
+  const thinking = body.thinking;
+  if (!isRec(thinking) || !Object.prototype.hasOwnProperty.call(thinking, "block_binding")) return body;
+  const { block_binding: _dropped, ...rest } = thinking;
+  return { ...body, thinking: rest };
+}
@@ buildAnthropicMessagesPassthroughRequest
-  const sentBody = betas.betas.includes(CONTEXT_MANAGEMENT_BETA) && body.context_management !== undefined
+  const withContext = betas.betas.includes(CONTEXT_MANAGEMENT_BETA) && body.context_management !== undefined
     ? { ...wireBody, context_management: contextManagementForWire(body.context_management, oauthToolNames) }
     : wireBody;
+  const sentBody = betas.betas.includes(THINKING_BINDING_BETA) ? withContext : withoutThinkingBlockBinding(withContext);

With four new cases in tests/adapters/anthropic/anthropic-beta-allowlist.test.ts (first-party keeps both; no caller beta strips the field; compatible third party drops both; source body not mutated), the allowlist suite and tests/claude-integration/messages-native.test.ts pass and tsc --noEmit is clean. Failures elsewhere in tests/adapters/anthropic/ are identical before and after the change.

If maintainers prefer not to forward the beta, step 2 alone still fixes the 400. Clients then fall back to Anthropic's default handling of mismatched thinking blocks.

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    bug
    provider
    on Oct 14, 2026
  2. Ingwannu commented on Oct 16, 2026

    @Ingwannu
    Owner

    Fixed on dev by #7132, commit c410b777dce26fc2055700e959e9acaa36bc103d.

    Native Messages now pairs thinking.block_binding and context_management with the final effective beta headers, using one shared schema table. Unsupported destinations or missing betas remove the gated body fields copy-on-write.

    I checked that the merge commit is an ancestor of current inspected dev@4ae49360b7 and that its implementation is present. Regression commands and results are recorded in #7132; I did not rerun those tests in this triage pass.

    Closing as completed on the integration branch. This is not a claim that the fix has reached an npm/desktop release; please use a build containing the commit when checking the result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugprovider

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions