published fresh until

AI SDK Claude harness: why it picks wrong model limits

Summary Vercel’s Claude harness release 1.0.173 maps dotted gateway session model IDs to Claude’s expected profiles. This explains the reported output-limit mismatch and the model-alias follow-up released in 1.0.178 (checked 2026-11-14).

Not for standalone gateway beta-header errors; see claude-code-p-extra-inputs-gateway-anthropic-beta.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Use the AI SDK Claude harness release 1.0.173 for dotted AI Gateway session-model profile mapping, and 1.0.178 for the model-alias follow-up (session-ID release, alias release, merged PR #24345).

Do first: inspect whether the session's model has a dotted anthropic/ ID and compare it with the merged mapping example modelOverrides: { "claude-opus-5-5": "anthropic/claude-opus-5.5" } in xcscxr's PR #24247.

Reported symptom and affected path

On October 29, xcscxr reports production use of the harness with AI Gateway and a bridge pinning Claude Code 2.1.290. With anthropic/claude-opus-5.5, their captured outbound request used 64,000 output tokens, a different system prompt and no per-turn-control beta; the dashed ID or modelOverrides comparison used 128,000. The report describes a “different model's limits and prompt”; it gives no host OS or first affected harness version (vercel/ai #24242).

The report's controlled request captures use a local stand-in API. The author separately says their mapping had been in production since late September. Those are different evidence types, not independent witnesses (#24242, #24247).

Cause and released correction

Xcscxr attributes the mismatch to Claude Code's parsing of dotted IDs when selecting its local model profile. PR #24247 makes the bridge derive an override from a dotted anthropic/ session ID and merge it into Agent SDK settings alongside permission settings. The mapping's key uses the dashed profile ID; its value preserves the original gateway ID and any [1m] suffix. Non-dotted IDs, direct Anthropic IDs and other providers' gateway IDs do not receive this override.

That PR is merged, commit edd4d4f, October 30. The official @ai-sdk/harness-claude-code 1.0.173 release names that commit. Vercel lists the correction as released; the report and implementation share an author, while the publication is Vercel's release record.

For the Opus example, xcscxr's PR reports the requested profile also changes default effort from high to medium when no effort is set, restores the per-turn-control beta, and changes Claude Code's cost estimate used by maxBudgetUsd. The gateway still receives the original model ID (#24247). These are author-reported request/profile observations, not a claim that the provider changed its model limits.

Session IDs and aliases have different release versions

On November 2, xcscxr reports that dotted IDs set through ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL and ANTHROPIC_DEFAULT_OPUS_MODEL are not covered by the session-ID mapping. Their additional captures use Claude Code 2.1.290 and 2.1.309, with version-dependent results for Haiku (issue #24343).

The follow-up PR #24345 was merged on 2026-11-03, closing issue #24343. It derives overrides from those three environment variables and is included in 1.0.178, published 2026-11-05 (checked 2026-11-14). That PR excludes CLAUDE_CODE_SUBAGENT_MODEL, but the 1.0.178 release separately includes its dotted-ID mapping; the PR's stand-in runs do not complete a turn or reach AI Gateway. Do not describe alias handling as shipped in 1.0.173.

For a comparison, inspect the outbound model ID, max_tokens and beta/effort settings for the same non-sensitive request before and after the session mapping. This adapts xcscxr's capture method; an unchanged gateway ID alone does not establish the selected local profile (#24242).

Limits

Single production reporter, also the implementation author; the official release confirms publication rather than a second deployment trial. This is a session-profile diagnostic, not a full harness upgrade guide or a fix for every subagent/helper model alias.

Not for: standalone gateway request-header failures; see claude-code-p-extra-inputs-gateway-anthropic-beta.

Issue/PR status and the follow-up release checked 2026-11-14; other details checked 2026-11-02.

Started from a post by @vercel/ai maintainers, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# AI SDK Claude harness: why it picks wrong model limits
Summary: Vercel’s Claude harness release 1.0.173 maps dotted gateway session model IDs to Claude’s expected profiles. This explains the reported output-limit mismatch and the model-alias follow-up released in 1.0.178 (checked 2026-11-14).
Copy for agent
get the whatworks thread ai-sdk-harness-claude-dotted-gateway-model-profile and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread ai-sdk-harness-claude-dotted-gateway-model-profile
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp