You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SDK users running on Vertex (or Bedrock) with claude-opus-4-8 / 4-7 get ThinkingBlock.thinking == "" (empty) and no thinking_delta events, even with thinking={"type":"adaptive","display":"summarized"}.
This is not the same as the now-fixed #831 (where the SDK didn't forward display). The SDK does now correctly pass --thinking-display (_internal/transport/subprocess_cli.py resolves thinking["display"] → --thinking-display). The remaining failure is downstream in the bundled CLI, which strips thinking.display from the request body on non-first-party providers.
Full CLI root-cause analysis, request-body captures, and a live Vertex reproduction are in the CLI issue: anthropics/claude-code#71599. Filing here for SDK-user visibility and to track an SDK-side mitigation, since claude-agent-sdk bundles the affected CLI.
#831 made the SDK forward the flag. But the bundled CLI (2.1.177 → 2.1.193, latest) gates thinking.display behind a first-party-only provider allow-list (firstParty | anthropicAws | foundry) that omits vertex/bedrock. So with CLAUDE_CODE_USE_VERTEX=1, the CLI builds thinking: {"type":"adaptive"} (no display), the server applies the Opus 4.8 default display:"omitted", and the SDK parses back a ThinkingBlock with empty thinking + a signature. Direct Anthropic (first-party) is unaffected.
Version boundary: bundled CLI 2.1.150 works; 2.1.177+ (and 2.1.193, latest) broken on Vertex/Bedrock.
Reproduction (SDK)
importosfromclaude_agent_sdkimportClaudeAgentOptions, query, AssistantMessage, ThinkingBlock# Vertex env: CLAUDE_CODE_USE_VERTEX=1, CLOUD_ML_REGION=global, ANTHROPIC_VERTEX_PROJECT_ID=<your-project>options=ClaudeAgentOptions(
model="claude-opus-4-8[1m]",
thinking={"type": "adaptive", "display": "summarized"}, # forwarded correctly since #831
)
asyncformsginquery(prompt="Reason step by step, then answer: a bat and ball cost $1.10; the bat is $1.00 more than the ball. How much is the ball?", options=options):
ifisinstance(msg, AssistantMessage):
forbinmsg.content:
ifisinstance(b, ThinkingBlock):
print("thinking len:", len(b.thinking)) # 0 on Vertex; non-empty on direct Anthropic
Observed on Vertex: thinking len: 0 (signature present). On the direct Anthropic API: non-empty.
Verified workaround (no downgrade)
Set the CLI extra-body env var on the subprocess; it re-injects display on the wire (verified against live Vertex — empty → 224-char summarized thinking):
Optional mitigation: when thinking["display"] is set and a 3P provider is detected (CLAUDE_CODE_USE_VERTEX / CLAUDE_CODE_USE_BEDROCK in env), have the transport set/merge CLAUDE_CODE_EXTRA_BODY with the thinking override so display survives the bundled CLI — until the CLI fix lands.
Summary
SDK users running on Vertex (or Bedrock) with
claude-opus-4-8/4-7getThinkingBlock.thinking == ""(empty) and nothinking_deltaevents, even withthinking={"type":"adaptive","display":"summarized"}.This is not the same as the now-fixed #831 (where the SDK didn't forward
display). The SDK does now correctly pass--thinking-display(_internal/transport/subprocess_cli.pyresolvesthinking["display"]→--thinking-display). The remaining failure is downstream in the bundled CLI, which stripsthinking.displayfrom the request body on non-first-party providers.Full CLI root-cause analysis, request-body captures, and a live Vertex reproduction are in the CLI issue: anthropics/claude-code#71599. Filing here for SDK-user visibility and to track an SDK-side mitigation, since
claude-agent-sdkbundles the affected CLI.Why it still affects the SDK after #831
#831made the SDK forward the flag. But the bundled CLI (2.1.177 → 2.1.193, latest) gatesthinking.displaybehind a first-party-only provider allow-list (firstParty | anthropicAws | foundry) that omitsvertex/bedrock. So withCLAUDE_CODE_USE_VERTEX=1, the CLI buildsthinking: {"type":"adaptive"}(nodisplay), the server applies the Opus 4.8 defaultdisplay:"omitted", and the SDK parses back aThinkingBlockwith emptythinking+ a signature. Direct Anthropic (first-party) is unaffected.Version boundary: bundled CLI 2.1.150 works; 2.1.177+ (and 2.1.193, latest) broken on Vertex/Bedrock.
Reproduction (SDK)
Observed on Vertex:
thinking len: 0(signature present). On the direct Anthropic API: non-empty.Verified workaround (no downgrade)
Set the CLI extra-body env var on the subprocess; it re-injects
displayon the wire (verified against live Vertex — empty → 224-char summarized thinking):Must be
type:"adaptive"— Opus 4.8 rejectstype:"enabled"with HTTP 400.Requests for the SDK
CLAUDE_CODE_EXTRA_BODYworkaround) near the thinking docs, linking Vertex/Bedrock:thinking.display:"summarized"stripped from request body → empty thinking on Opus 4.8/4.7 (regression 2.1.150→2.1.177, still in 2.1.193) claude-code#71599.thinking["display"]is set and a 3P provider is detected (CLAUDE_CODE_USE_VERTEX/CLAUDE_CODE_USE_BEDROCKin env), have the transport set/mergeCLAUDE_CODE_EXTRA_BODYwith the thinking override sodisplaysurvives the bundled CLI — until the CLI fix lands.thinking.display:"summarized"stripped from request body → empty thinking on Opus 4.8/4.7 (regression 2.1.150→2.1.177, still in 2.1.193) claude-code#71599.Related
display; this issue is the remaining CLI-side drop on Vertex/Bedrock.thinking.display:"summarized"stripped from request body → empty thinking on Opus 4.8/4.7 (regression 2.1.150→2.1.177, still in 2.1.193) claude-code#71599 — upstream CLI root cause (request-bodythinking.displaystripped on Vertex/Bedrock).