detached e7dc295

Fix Google Vertex global endpoint

For the global GCP endpoint, the URL is contructed starting with
https://aiplatform.googleapis.com/ instead of
https://${GOOGLE_CLOUD_LOCATION}-aiplatform.googleapis.com.
commit
e7dc295707a4a869470b9fd317f3d2e207593c8e
author
Eckhart Koeppen · · 2026-07-06 09:19 UTC
committer
Eckhart Köppen · · 2026-07-12 13:11 UTC
parent
9559c57
signature
unsigned
1 file · +10 -2
M packages/provider/google_vertex.go +10 -2
@@ -311,7 +311,11 @@ func (t *vertexTransport) RoundTrip(req *http.Request) (*http.Response, error) {
311311 newPath := fmt.Sprintf("/v1/projects/%s/locations/%s/publishers/google/models/%s%s",
312312 t.cfg.project, t.cfg.location, modelID, verb)
313313 clone := req.Clone(req.Context())
314- clone.URL.Host = t.cfg.location + "-aiplatform.googleapis.com"
314+ if t.cfg.location == "global" {
315+ clone.URL.Host = "aiplatform.googleapis.com"
316+ } else {
317+ clone.URL.Host = t.cfg.location + "-aiplatform.googleapis.com"
318+ }
315319 clone.URL.Path = newPath
316320 // Drop existing auth header and pick the right one.
317321 clone.Header.Del("x-goog-api-key")
@@ -336,9 +340,13 @@ func NewVertex(_ string, _ string) Client {
336340 if err != nil {
337341 return &unimplementedClient{name: "google-vertex", hint: err.Error()}
338342 }
343+ baseHost := "aiplatform.googleapis.com"
344+ if cfg.location != "global" {
345+ baseHost = cfg.location + "-aiplatform.googleapis.com"
346+ }
339347 inner := &geminiClient{
340348 apiKey: "vertex-placeholder", // overwritten by transport
341- baseURL: "https://" + cfg.location + "-aiplatform.googleapis.com",
349+ baseURL: "https://" + baseHost,
342350 http: &http.Client{
343351 Transport: &vertexTransport{inner: http.DefaultTransport, cfg: cfg},
344352 Timeout: 0,
@@ -311,7 +311,11 @@ func (t *vertexTransport) RoundTrip(req *http.Request) (*http.Response, error) {
311 newPath := fmt.Sprintf("/v1/projects/%s/locations/%s/publishers/google/models/%s%s",311 newPath := fmt.Sprintf("/v1/projects/%s/locations/%s/publishers/google/models/%s%s",
312 t.cfg.project, t.cfg.location, modelID, verb)312 t.cfg.project, t.cfg.location, modelID, verb)
313 clone := req.Clone(req.Context())313 clone := req.Clone(req.Context())
314- clone.URL.Host = t.cfg.location + "-aiplatform.googleapis.com"314+ if t.cfg.location == "global" {
315+ clone.URL.Host = "aiplatform.googleapis.com"
316+ } else {
317+ clone.URL.Host = t.cfg.location + "-aiplatform.googleapis.com"
318+ }
315 clone.URL.Path = newPath319 clone.URL.Path = newPath
316 // Drop existing auth header and pick the right one.320 // Drop existing auth header and pick the right one.
317 clone.Header.Del("x-goog-api-key")321 clone.Header.Del("x-goog-api-key")
@@ -336,9 +340,13 @@ func NewVertex(_ string, _ string) Client {
336 if err != nil {340 if err != nil {
337 return &unimplementedClient{name: "google-vertex", hint: err.Error()}341 return &unimplementedClient{name: "google-vertex", hint: err.Error()}
338 }342 }
343+ baseHost := "aiplatform.googleapis.com"
344+ if cfg.location != "global" {
345+ baseHost = cfg.location + "-aiplatform.googleapis.com"
346+ }
339 inner := &geminiClient{347 inner := &geminiClient{
340 apiKey: "vertex-placeholder", // overwritten by transport348 apiKey: "vertex-placeholder", // overwritten by transport
341- baseURL: "https://" + cfg.location + "-aiplatform.googleapis.com",349+ baseURL: "https://" + baseHost,
342 http: &http.Client{350 http: &http.Client{
343 Transport: &vertexTransport{inner: http.DefaultTransport, cfg: cfg},351 Transport: &vertexTransport{inner: http.DefaultTransport, cfg: cfg},
344 Timeout: 0,352 Timeout: 0,

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 476

↑↓ moveenter openesc close