Skip to content
Source
Sign inSign up
TanStack/ai

ai-anthropic: Sonnet 5.5 and Haiku 5.5 are missing from ANTHROPIC_MODEL_MID_CONVERSATION_CHANNELS #2154

Send to my agent
Closedcs-conr(GitHub profile, opens in a new tab) opened this issue 0 comments

TanStack AI version

@tanstack/ai-anthropic 1.1.1 (latest), @tanstack/ai 1.4.0. Also present on main as of 2026-11-15.

Framework/Library version

Server-side only: Bun 1.4.4 (also seen under Node 24 via Next.js 16).

Describe the bug and the steps to reproduce it

ANTHROPIC_MODEL_MID_CONVERSATION_CHANNELS in packages/ai-anthropic/src/model-meta.ts lists Opus 4.8, Opus 5, Opus 5.5, Fable 5 and Fable 5.1. claude-sonnet-5-5 and claude-haiku-5-5 are missing, and their model entries (CLAUDE_SONNET_5_5, CLAUDE_HAIKU_5_5) declare no supports.mid_conversation_channels, so there is nothing for the table to pick up.

Anthropic's mid-conversation system messages docs list both models: mid-conversation system messages are available on "… Claude Opus 5.5, Claude Opus 5, Claude Opus 4.8, Claude Sonnet 5.5, and Claude Haiku 5.5" (not Claude Sonnet 5), and mid-conversation tool changes "are in beta on the same models". The same page lists mid-conversation-tool-changes-2026-07-01 for Amazon Bedrock (InvokeModel). We also checked Sonnet 5.5 with a raw request, on both the direct API and Bedrock.

Effect: with midConversationChannels: true in the adapter config, a Sonnet 5.5 adapter still resolves to undefined, because the constructor reads ANTHROPIC_MODEL_MID_CONVERSATION_CHANNELS[model]. Lazy tools then fall back to inserting the discovered tool into tools. That invalidates the prompt cache on the next step, and the whole prefix is written again.

Steps:

  1. Build an adapter for each model with midConversationChannels: true.
  2. Read adapter.midConversationChannels.

Expected: { tools: true, systemPrompts: true } for Sonnet 5.5 and Haiku 5.5, as for Opus 5.5. Actual: undefined for both. Opus 5.5 gets the object.

Workaround: assign the instance field after construction:

Object.assign(adapter, { midConversationChannels: { tools: true, systemPrompts: true } })

Your Minimal, Reproducible Example

Inline, because it needs no network call and no real key:

import { createAnthropicChat } from '@tanstack/ai-anthropic'

for (const model of ['claude-opus-5-5', 'claude-sonnet-5-5', 'claude-haiku-5-5'] as const) {
  const adapter = createAnthropicChat(model, 'sk-ant-placeholder', { midConversationChannels: true })
  console.log(model, adapter.midConversationChannels)
}

Output:

claude-opus-5-5 { tools: true, systemPrompts: true }
claude-sonnet-5-5 undefined
claude-haiku-5-5 undefined

Do you intend to try to help solve this bug with your own PR?

No, because I do not have time to dig into it. The fix looks like a mid_conversation_channels entry on the two model entries plus their rows in the table.

Terms & Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
  1. tanstack-source added labelsbug

  2. github-actions[bot](GitHub profile, opens in a new tab) added labelswaiting-on: maintainer

  3. AlemTuzlak closed this

Sign in to join this conversation.