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
{{ message }}
Repository navigation
ai-anthropic: modelOptions.context_management is forwarded to the wire but the required beta header is never sent #1074
AnthropicTextAdapter accepts modelOptions.context_management, forwards it onto the request body, and never sends the beta header that Anthropic requires for it. The option is typed, accepted, transmitted — and cannot work.
Detail
mapCommonOptionsToAnthropic lists context_management in its validKeys whitelist and copies it into requestParams (dist/esm/adapters/text.js, validKeys around line 195):
Context editing requires anthropic-beta: context-management-2025-06-27 (docs). The string context-management does not appear anywhere in dist/.
There is also no caller-facing escape hatch: betas is computed internally from tools and modelOptions, so a consumer cannot add the header themselves.
Why it is easy to miss
AnthropicContextManagementOptions appears in the provider-options type of every model in model-meta.d.ts, so this typechecks cleanly and looks supported:
Activity
feat: add context management support and corresponding beta handling
feat: add context management support and corresponding beta handling
feat: add context management support and corresponding beta handling
feat: add context management support and corresponding beta handling
feat: add context management support and corresponding beta handling (#…
fix(ai-anthropic): send the mcp-client beta when mcp_servers is set (#…