fix(agent): bump claude-agent-sdk to 0.3.156 for Opus 4.8 thinking shape#2439
Closed
fercgomes wants to merge 1 commit into
Closed
fix(agent): bump claude-agent-sdk to 0.3.156 for Opus 4.8 thinking shape#2439fercgomes wants to merge 1 commit into
fercgomes wants to merge 1 commit into
Conversation
claude-opus-4-8 was failing with HTTP 400 ("thinking.type.enabled is not
supported for this model. Use thinking.type.adaptive and output_config.effort")
because @anthropic-ai/claude-agent-sdk@0.3.154 was emitting the legacy
thinking-block shape. Upstream claude-code v2.1.156 fixes this — the SDK now
sends thinking: { type: "adaptive" } + output_config: { effort } for Opus 4.8
while keeping the legacy shape for Opus 4.7 / Sonnet 4.6 where the API still
accepts it.
No in-repo code change required: this repo never builds the thinking parameter
itself, only forwards options.effort and applyFlagSettings({ effortLevel }) to
the SDK. The fix lives entirely in the SDK bump.
v0.3.155 was never published; latest stable is 0.3.156.
Generated-By: PostHog Code
Task-Id: 25779980-b5ce-4ec1-b8b6-0b9de6204bf5
Member
|
Continuing here #2441 |
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
@anthropic-ai/claude-agent-sdk0.3.154 → 0.3.156 inpackages/agent.claude-opus-4-8:thinking.type.enabled is not supported for this model. Use thinking.type.adaptive and output_config.effort.UPSTREAM.mdunder a newv0.39.0section.Why this shape and not the proposed in-repo
buildThinkingConfigThe attached bug report proposed a
buildThinkingConfig(model, effort)helper in the agent-server. That doesn't apply to this repo — we never build the Anthropicthinkingparameter ourselves. The full chain is:packages/agent/src/server/bin.tsreadsPOSTHOG_CODE_MODELandPOSTHOG_CODE_REASONING_EFFORT.packages/agent/src/adapters/claude/session/options.ts:419forwards effort as a string:options.effort = params.effort.packages/agent/src/adapters/claude/claude-agent.ts:1223/1769forwards effort changes:query.applyFlagSettings({ effortLevel }).@anthropic-ai/claude-agent-sdkbuilds the actual Anthropic request body.No
budget_tokens,thinking.type, oroutput_configexists anywhere in our TypeScript source, and the Anthropic SDKs are unpatched. The fix lives entirely in upstream claude-code v2.1.156 ("Fixed an issue when using Opus 4.8 where thinking blocks were modified, leading to API errors") which ships as SDK0.3.156. v0.3.155 was never published.Test plan
pnpm installrefreshes lockfile without conflicts.pnpm --filter agent typecheckclean.options.test.ts,models.test.ts,model-config.test.ts,claude-agent.refresh.test.ts,claude-agent.slash-command.test.ts).high/xhigheffort for each model and confirm no HTTP 400:claude-opus-4-8(the failing model)claude-opus-4-7claude-opus-4-6claude-opus-4-5claude-sonnet-4-6thinking: { type: "adaptive" }+output_config: { effort }.