Skip to content

chore: fix Vertex AI global region URL in LlmClient - #25936

Merged
davsclaus merged 1 commit into
mainfrom
quick-fix/vertex-ai-global-region-url
Aug 31, 2026
Merged

chore: fix Vertex AI global region URL in LlmClient#25936
davsclaus merged 1 commit into
mainfrom
quick-fix/vertex-ai-global-region-url

Conversation

@davsclaus

Copy link
Copy Markdown
Contributor

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 the global location, whose actual host is aiplatform.googleapis.com with no region prefix.
  • With CLOUD_ML_REGION=global set, requests went to the non-existent host global-aiplatform.googleapis.com, causing the TUI's F8 AI panel and camel ask/explain/harden to fail with a generic "LLM request failed" error whenever the Vertex AI auto-detect path was used with the global region.
  • Special-case global to omit the region prefix from the host while keeping locations/global in the path.

Test plan

  • mvn -q -DskipTests install on camel-jbang-core
  • mvn formatter:format impsort:sort — no changes needed
  • Reproduced the original failure live in the TUI's F8 AI panel with CLOUD_ML_REGION=global + ANTHROPIC_VERTEX_PROJECT_ID set and no ANTHROPIC_API_KEY

Claude Code on behalf of davsclaus

🤖 Generated with Claude Code

@github-actions github-actions Bot added the dsl label Aug 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

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>
@davsclaus
davsclaus force-pushed the quick-fix/vertex-ai-global-region-url branch from e220731 to d115c7d Compare August 31, 2026 08:25
@github-actions

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • dsl/camel-jbang/camel-jbang-core

🔬 Scalpel shadow comparison — Scalpel: 7 tested, 8 compile-only — current: 6 all tested

Maveniverse Scalpel detected 15 affected modules (current approach: 6).

⚠️ Modules only in Scalpel (9)
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-launcher
  • coverage

Skip-tests mode would test 7 modules (1 direct + 6 downstream), skip tests for 8 (generated code, meta-modules)

Modules Scalpel would test (7)
  • camel-jbang-core
  • camel-jbang-mcp
  • camel-jbang-plugin-mcp
  • camel-jbang-plugin-route-parser
  • camel-jbang-plugin-tui
  • camel-jbang-plugin-validate
  • camel-launcher-container
Modules with tests skipped (8)
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-launcher
  • coverage

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • dsl/camel-jbang/camel-jbang-core: 1 test(s) disabled on GitHub Actions

💡 Manual integration tests recommended:

You modified dsl/camel-jbang/camel-jbang-core. The related integration tests in dsl/camel-jbang/camel-jbang-it are excluded from CI. Consider running them manually:

mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
All tested modules (15 modules)
  • Camel :: Coverage
  • Camel :: JBang :: Core
  • Camel :: JBang :: Integration tests
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Main
  • Camel :: JBang :: Plugin :: Edit
  • Camel :: JBang :: Plugin :: Generate
  • Camel :: JBang :: Plugin :: Kubernetes
  • Camel :: JBang :: Plugin :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Testing
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Launcher
  • Camel :: Launcher :: Container

⚙️ View full build and test results

@gnodet gnodet 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.

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

⚠️ This bug fix targets main but the same file exists on camel-4.22.x. Consider backporting.

  • camel-4.22.x — no backport PR found
  • camel-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

@davsclaus davsclaus added this to the 4.23.0 milestone Aug 31, 2026
@davsclaus davsclaus added the bug Something isn't working label Aug 31, 2026
@davsclaus davsclaus self-assigned this Aug 31, 2026
@davsclaus
davsclaus merged commit e3f7f4c into main Aug 31, 2026
5 checks passed
@davsclaus
davsclaus deleted the quick-fix/vertex-ai-global-region-url branch August 31, 2026 10:22
Croway pushed a commit that referenced this pull request Aug 31, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dsl

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants