chore: fix Vertex AI global region URL in LlmClient - #25936
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
CLOUD_ML_REGION=global must use the aiplatform.googleapis.com host with no region prefix; the region-prefixed host only applies to regional locations (e.g. us-east5). The unconditional prefix broke the TUI's F8 AI panel and camel ask/explain/harden when Vertex AI env vars were set to the global region. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
e220731 to
d115c7d
Compare
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 7 tested, 8 compile-only — current: 6 all testedMaveniverse Scalpel detected 15 affected modules (current approach: 6).
|
gnodet
left a comment
There was a problem hiding this comment.
Correct fix for Vertex AI global region URL construction. When vertexRegion is "global", the hostname should be aiplatform.googleapis.com (no region prefix), not global-aiplatform.googleapis.com. The fix is consistent with how the camel-google-vertexai component handles the same case in PredictionServiceClientFactory.java.
📋 PR Metadata
| Aspect | Current | Suggested |
|---|---|---|
| Category | chore (title) | bug (this fixes incorrect behavior) |
| Labels | dsl |
+ bug |
| Milestone | (none) | 4.23.0 |
🔀 Backport Status
main but the same file exists on camel-4.22.x. Consider backporting.
camel-4.22.x— no backport PR foundcamel-4.18.x— file does not exist, no backport needed
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of Guillaume Nodet
CLOUD_ML_REGION=global must use the aiplatform.googleapis.com host with no region prefix; the region-prefixed host only applies to regional locations (e.g. us-east5). The unconditional prefix broke the TUI's F8 AI panel and camel ask/explain/harden when Vertex AI env vars were set to the global region. Closes #25936 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Summary
LlmClient.resolveAnthropicUrl()built the Vertex AI Anthropic endpoint by always prefixing the host with<region>-. That's correct for regional locations (e.g.us-east5) but wrong for thegloballocation, whose actual host isaiplatform.googleapis.comwith no region prefix.CLOUD_ML_REGION=globalset, requests went to the non-existent hostglobal-aiplatform.googleapis.com, causing the TUI's F8 AI panel andcamel ask/explain/hardento fail with a generic "LLM request failed" error whenever the Vertex AI auto-detect path was used with the global region.globalto omit the region prefix from the host while keepinglocations/globalin the path.Test plan
mvn -q -DskipTests installoncamel-jbang-coremvn formatter:format impsort:sort— no changes neededCLOUD_ML_REGION=global+ANTHROPIC_VERTEX_PROJECT_IDset and noANTHROPIC_API_KEYClaude Code on behalf of davsclaus
🤖 Generated with Claude Code