Skip to content

Fix #1906: raise claude-agent-sdk floor to ^0.2.141 - #1907

Closed
waleedkadous wants to merge 7 commits into
mainfrom
builder/bugfix-1906
Closed

waleedkadous wants to merge 7 commits into
mainfrom
builder/bugfix-1906

Conversation

@waleedkadous

@waleedkadous waleedkadous commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Builds from this repo's lockfile ran @anthropic-ai/claude-agent-sdk 0.2.105, and consult's claude lane got API 400 "thinking.type.enabled" is not supported for this model on claude-opus-5. This raises the declared floor to ^0.2.141, refreshes the lockfile, and adds a regression test.

Fixes #1906

Root Cause

packages/codev/package.json declared ^0.2.41 and pnpm-lock.yaml resolved it to 0.2.105, which bundles Claude Code 2.1.105. That CLI decides which models get adaptive thinking from a name allowlist (opus-4-6, sonnet-4-6), and sends {type: "enabled", budget_tokens} to any other Opus. claude-opus-5 accepts only adaptive, so it returns a 400.

Reproduced from this worktree (direct SDK query(), claude-opus-5, trivial prompt):

SDK (bundled CLI) API key stored login
0.2.105 (2.1.105), lockfile 400 OK
0.2.141 (2.1.141), installed consult 3.3.7 OK OK

Consult sets no thinking option itself, and setting one would not help: on a model it doesn't recognise, the 2.1.105 CLI rewrites adaptive to enabled. The SDK is the component that knows model capabilities, so consult is unchanged.

Release exposure: fresh installs are not affected. pnpm publish ships the version range, not the lockfile, and local-install runs npm install -g on the tarball, so both resolve fresh. A caret on 0.x pins the minor, so they get 0.2.141, the last 0.2.x; 0.3.x is never picked. The exposure is any install whose own lockfile already resolved an older 0.2.x, and the new floor closes that.

Fix

  • packages/codev/package.json: ^0.2.41 → ^0.2.141, the version every fresh install already runs.
  • pnpm-lock.yaml: refreshed. The diff stays inside the SDK's own subtree: the SDK and its per-platform native-binary packages, @anthropic-ai/sdk 0.81 → 0.93, and the @img/sharp-* optionals that 0.2.105 pulled in and 0.2.141 dropped.
  • consult/index.ts: the claude lane now logs [CLAUDE] agent sdk: @anthropic-ai/claude-agent-sdk <version> bundled with codev beside the auth line, the same way the codex lane logs its CLI version, so the next version mismatch shows up in the output (architect fold-in). Verified live: … 0.2.141 bundled with codev.

Moving to 0.3.x is out of scope; it is a breaking-range bump.

Test Plan

  • Regression test added: consult/__tests__/bugfix-1906-claude-sdk-floor.test.ts checks that the installed SDK and the declared floor are both ≥ 0.2.141, and pins the default model it was probed against. Fails without the fix (lockfile and manifest restored to main, frozen install: 2 failed, 0.2.105 / ^0.2.41) and passes with it.
  • End to end from the worktree build: consult -m claude --prompt … on claude-opus-5 over ANTHROPIC_API_KEY returned the 400 before the fix and a review after it (12.7s).
  • Auth paths unchanged: no consult code was touched. API key (via consult) and stored login (via direct SDK) both serve on 0.2.141.
  • Build passes
  • All tests pass (porch build + tests checks)

The repo lockfile resolved @anthropic-ai/claude-agent-sdk ^0.2.41 to 0.2.105, whose bundled
Claude Code CLI only sends adaptive thinking to opus-4-6/sonnet-4-6 and sends
thinking.type.enabled to any other Opus. claude-opus-5 rejects that with API 400, so the
claude lane failed in worktree/local builds while the published install (fresh resolve to
0.2.141) worked.

Raise the floor to ^0.2.141 (what fresh installs already run) and refresh the lockfile.
The regression test pins both the installed SDK version and the declared floor.
@waleedkadous

Copy link
Copy Markdown
Contributor Author

Thank you, clean and well-scoped, and running the claude review on the worktree build is the right proof.

One small fold-in before merge, under the owner's fix-in-place rule: your non-blocking note (1). Please log the Agent SDK version on the claude lane next to the existing [CLAUDE] auth: line, as the codex lane does for its CLI version, so the next version skew is visible in the output.

The 0.3.x migration is a real follow-up and stays out of this PR.

Name the @anthropic-ai/claude-agent-sdk version beside the [CLAUDE] auth line, as the codex lane
does for its CLI, so an SDK too old for the configured model shows in the output. The floor test
now reads the version through the same helper and pins the line.
@waleedkadous

Copy link
Copy Markdown
Contributor Author

Closing on the owner's ruling (decision main-19, 2026-11-17): the claude lane is moving off the Agent SDK to the installed claude CLI (issue #1912), which supersedes this floor raise. Thank you for the clean diagnosis; it is the reason for that change. Branch kept.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repo lockfile pins @anthropic-ai/claude-agent-sdk 0.2.105; consult's claude lane gets API 400 on claude-opus-5 in local dev builds

1 participant