fix: use correct hostname for Vertex AI global region endpoint - #88
Open
jflowers wants to merge 1 commit into
Open
fix: use correct hostname for Vertex AI global region endpoint#88jflowers wants to merge 1 commit into
jflowers wants to merge 1 commit into
Conversation
jflowers
force-pushed
the
opsx/vertex-global-region-url
branch
from
August 14, 2026 20:21
6a40f6b to
e936539
Compare
When region is set to 'global', both VertexSynthesizer.rawPredictURL() and VertexEmbedder.predictURL() were producing malformed URLs with hostname 'global-aiplatform.googleapis.com'. The correct global endpoint uses 'aiplatform.googleapis.com' without a region prefix. - Add conditional hostname construction in both methods - Add table-driven regression tests covering global and regional endpoints - Update README and AGENTS.md to document 'global' as a valid region value OpenSpec: vertex-global-region-url Assisted-by: claude-opus Generated with AI assistance (claude-opus)
jflowers
force-pushed
the
opsx/vertex-global-region-url
branch
from
August 14, 2026 20:57
e936539 to
5dc6c28
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When
region: globalis configured inconfig.yaml, both Vertex AI providers (VertexSynthesizerandVertexEmbedder) produced malformed URLs with hostnameglobal-aiplatform.googleapis.com, causing silent DNS resolution failures. The correct global endpoint usesaiplatform.googleapis.comwithout a region prefix, while retaininglocations/globalin the URL path.This fix adds conditional hostname construction in both
rawPredictURL()andpredictURL()methods. Regional endpoints (e.g.,us-east5,us-central1) continue to work identically.How to Test
Run the regression tests directly:
Both tests are table-driven with two subtests each:
region: "global"produceshttps://aiplatform.googleapis.com/v1/...(nothttps://global-aiplatform.googleapis.com/v1/...)region: "us-east5"/"us-central1"continues producinghttps://{region}-aiplatform.googleapis.com/v1/...Full test suite:
go build ./... go vet ./... go test -race -count=1 ./...How to Demo
Configure
region: globalin.uf/dewey/config.yaml:Before this fix, Dewey would fail with DNS resolution errors when making Vertex AI requests. After this fix, requests route correctly through Google's global endpoint (
aiplatform.googleapis.com), which forwards to the nearest available region.Key Files Changed
llm/vertex.gorawPredictURL()— conditional hostname forglobalregionembed/vertex.gopredictURL()— conditional hostname forglobalregionllm/vertex_test.goTestVertexSynthesizer_RawPredictURLtable-driven regression testsembed/vertex_test.goTestVertexEmbedder_PredictURLtable-driven regression testsREADME.mdglobalas a valid region valueAGENTS.mdglobalas a valid region valueopenspec/changes/vertex-global-region-url/This PR was generated by /uf.finale (AI-assisted).