Skip to content

feat(provider): send Anthropic Messages to /ai/v1 - #4615

Merged
kwakayama merged 3 commits into
mainfrom
feat/sdk-messages-v1
Sep 28, 2026
Merged

kwakayama merged 3 commits into
mainfrom
feat/sdk-messages-v1

Conversation

@kojiwakayama

Copy link
Copy Markdown
Contributor

Refs veryfront/veryfront-issue-inbox#1904.

Merge only after the API serving /ai/v1/messages is live. Until then, Anthropic-protocol requests from this build would reach a path that does not exist yet.

What changes

The platform now serves every protocol under one prefix. OpenAI requests go to /ai/v1/chat/completions and /ai/v1/responses, and Anthropic Messages to /ai/v1/messages. /ai/anthropic/v1 is deprecated.

  • Routing: src/provider/veryfront-cloud/shared.ts gives Anthropic-protocol Veryfront Cloud models the base <api>/ai/v1, the same base as OpenAI-protocol models. The Anthropic client appends /messages, so requests go to <api>/ai/v1/messages. Request bodies still name the model as <provider>/<model>. The VERYFRONT_CLOUD_GATEWAY_ROUTES=vendor opt-out is unchanged.
  • Eval: src/eval/model-access.ts treats /ai/v1/messages as a gateway route through the /ai/v1/ prefix. It keeps recognising /ai/anthropic/v1/, which failures recorded by earlier releases can still carry.
  • Docs: docs/guides/configuration.md and docs/architecture/27-agent-message-stream-dataflow.md.

Tests

  • The routing and provider tests expect <api>/ai/v1 and <api>/ai/v1/messages for Anthropic-protocol models.
  • The eval test covers /ai/v1/messages, /ai/v1/messages/count_tokens, and the earlier prefix.
  • deno task typecheck, fmt:check, lint, docs:validate and docs:api-reference:check pass.
  • test:file on src/provider, src/eval and tests/integration/provider: 56 passed, 0 failed.

Anthropic-protocol Veryfront Cloud models now use the same vendor-neutral
base as OpenAI-protocol models, <api>/ai/v1, and send Messages requests to
/ai/v1/messages. Eval still recognises the earlier /ai/anthropic/v1 prefix in
recorded failures.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 66eece76-186d-42d9-9227-775640b72b7b

📥 Commits

Reviewing files that changed from the base of the PR and between fb42fde and f0a9f48.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • docs/architecture/27-agent-message-stream-dataflow.md
  • docs/guides/configuration.md
  • src/eval/model-access.test.ts
  • src/eval/model-access.ts
  • src/provider/veryfront-cloud/gateway-routing.test.ts
  • src/provider/veryfront-cloud/provider.test.ts
  • src/provider/veryfront-cloud/shared.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

📦 Client bundle boundary

Entrypoint Modules Source size Server leaks
src/index.client.ts 289 2321 KiB ✅ 0

A server module in a client graph aborts hydration in the browser. New leaks fail CI; known leaks are tracked in scripts/lint/client-bundle-baseline.json to burn down.

@gitar-bot

gitar-bot Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Gitar is working

Gitar

Copy link
Copy Markdown
Contributor

Review: 82/100 — Good, one doc fix needed before merge

Clean, tightly-scoped routing change with matching test updates across all three affected suites. Holding the merge note is the right call given the dependency on the not-yet-live /ai/v1/messages endpoint.

Strengths

  • Single source of truth for the route change: NEUTRAL_GATEWAY_PATHS_BY_PROTOCOL in shared.ts now maps both openai and anthropic to ai/v1, and every test/doc touchpoint was updated consistently with it.
  • Backward compatibility preserved correctly: the vendor-scoped fallback path (ai/gateway/anthropic/v1, used when VERYFRONT_CLOUD_GATEWAY_ROUTES=vendor) lives in model-catalog.ts and is untouched, so the opt-out still routes through the old per-vendor path.
  • src/eval/model-access.ts's GATEWAY_ROUTE_PREFIXES correctly keeps recognizing /ai/anthropic/v1/ for recorded failures from before this change, with a clear comment explaining why.
  • Test coverage is proportional to the diff: gateway-routing.test.ts and provider.test.ts updated expected URLs, and model-access.test.ts adds explicit /ai/v1/messages and /ai/v1/messages/count_tokens cases.

Concerns

  • CHANGELOG.md's "Unreleased" section (the entry titled "Changed: Veryfront Cloud models call the vendor-neutral endpoints") still says Anthropic-protocol models send to <api>/ai/anthropic/v1 — that's now stale and contradicts the new behavior this PR ships. Since AGENTS.md calls for docs to be updated whenever public behavior changes, and this PR already updated docs/guides/configuration.md and the architecture doc, the changelog entry should get the same /ai/v1/messages correction (or a follow-up "Changed" entry noting the further move) before merge.
  • Minor: the updated docblock in shared.ts:361-364 reads a little dense ("OpenAI- and Anthropic-protocol providers both use <api>/ai/v1 (/chat/completions, /responses or /messages), and Google keeps its vendor-scoped path... its vendor-scoped path.") — consider a short rewrap for readability, not blocking.

Action item to unblock a clean merge: update the CHANGELOG's existing Anthropic-route entry to reflect <api>/ai/v1/messages instead of <api>/ai/anthropic/v1, matching the other docs updated in this PR.


Generated by Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b9b00ad19f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/provider/veryfront-cloud/shared.ts
@codecov

codecov Bot commented Sep 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@github-actions

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 5809646547

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@github-actions

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: f0a9f48230

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@sonarqubecloud

Copy link
Copy Markdown

@kwakayama
kwakayama added this pull request to the merge queue Sep 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 27, 2026

@kwakayama kwakayama left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Score: 97/100
Verdict: APPROVE
Reviewed SHA: f0a9f48
Actionable findings: 0

Reviewed the Anthropic base path and /messages composition, provider-qualified model rewriting, vendor-route opt-out, and eval classification compatibility. Exact-head CI checks are green; formatting and lint passed locally. Targeted local tests were blocked by the repository runtime guard rejecting installed Deno 2.9.4.

@kwakayama
kwakayama added this pull request to the merge queue Sep 27, 2026
Merged via the queue into main with commit d2052ca Sep 28, 2026
61 checks passed
@kwakayama
kwakayama deleted the feat/sdk-messages-v1 branch September 28, 2026 00:12
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.

2 participants