Skip to content

Enable routing to Vercel for Anthropic models#641

Open
chrarnoldus wants to merge 2 commits intomainfrom
christiaan/vercel
Open

Enable routing to Vercel for Anthropic models#641
chrarnoldus wants to merge 2 commits intomainfrom
christiaan/vercel

Conversation

@chrarnoldus
Copy link
Contributor

No description provided.

@chrarnoldus chrarnoldus marked this pull request as ready for review March 2, 2026 21:28
extraHeaders['x-anthropic-beta'] = [extraHeaders['x-anthropic-beta'], betaFlag]
.filter(Boolean)
.join(',');
for (const header of ['anthropic-beta', 'x-anthropic-beta']) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[WARNING]: Behavioral change — both anthropic-beta and x-anthropic-beta are now set for all gateways.

Previously only x-anthropic-beta was sent (used by OpenRouter). Now anthropic-beta is also sent to OpenRouter, and x-anthropic-beta is sent to Vercel. While likely harmless (gateways should ignore unrecognized headers), this is a subtle change worth being aware of — if either gateway treats the unexpected header variant as an error or processes it differently, it could cause issues.

Also, the old Vercel-specific code in applyVercelSettings added context-1m-2025-08-07 to the anthropic-beta header for Anthropic models routed through Vercel. That beta flag is now dropped entirely. If 1M context support on Vercel still requires this beta flag, this is a regression. If it's now GA, this is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kilo-code-bot
Copy link
Contributor

kilo-code-bot bot commented Mar 2, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Verify before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
src/lib/providers/anthropic.ts 20 Both anthropic-beta and x-anthropic-beta headers are now set for all gateways (behavioral change). Also, the context-1m-2025-08-07 beta flag previously added for Vercel Anthropic requests is dropped — verify this beta is no longer needed.
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
src/lib/providers/vercel/index.ts (removed) The old applyVercelSettings code added context-1m-2025-08-07 to the anthropic-beta header for Anthropic models on Vercel (referencing Vercel docs). This beta flag is now completely removed. If 1M context support on Vercel still requires this flag, this is a regression. If the feature is now GA on Vercel, this removal is correct.
Files Reviewed (2 files)
  • src/lib/providers/anthropic.ts - 1 issue
  • src/lib/providers/vercel/index.ts - 0 inline issues (1 observation about removed code)

Fix these issues in Kilo Cloud

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.

1 participant