Skip to content

Commit 75c368d

Browse files
author
Scion Agent (opencode-vertex-fix-dev)
committed
fix(opencode): respect vertex_not_blocked guard and populate standard GCP env vars
1 parent d43563b commit 75c368d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

harnesses/opencode/provision.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,11 @@ def _select_auth_method(
204204
"GOOGLE_CLOUD_PROJECT/VERTEXAI_PROJECT and/or "
205205
"GOOGLE_CLOUD_REGION/GOOGLE_CLOUD_LOCATION/VERTEX_LOCATION"
206206
)
207+
if not vertex_not_blocked:
208+
raise ValueError(
209+
"opencode: auth type 'vertex-ai' selected but GCP metadata "
210+
"access is blocked (gcp_metadata_mode='block')"
211+
)
207212
return "vertex-ai", ""
208213

209214
# Auto-detect precedence: api-key > auth-file > vertex-ai.
@@ -428,8 +433,10 @@ def _provision(manifest: dict[str, Any]) -> int:
428433
)
429434
if project:
430435
env_payload["VERTEXAI_PROJECT"] = project
436+
env_payload["GOOGLE_CLOUD_PROJECT"] = project
431437
if location:
432438
env_payload["VERTEX_LOCATION"] = location
439+
env_payload["GOOGLE_CLOUD_REGION"] = location
433440

434441
try:
435442
_write_json(auth_out, resolved_payload)

0 commit comments

Comments
 (0)