Skip to content

Adopt native env-var credential support from google-antigravity 0.1.7 and remove the sidecar override #325

Description

@joycel-github

Background

The antigravity harness sidecar (python/antigravity/harness_server.py) currently carries a temporary override, _vertex_kwargs_from_env(), that reads the standard GenAI environment variables (GOOGLE_GENAI_USE_VERTEXAI / GOOGLE_GENAI_USE_ENTERPRISE + GOOGLE_CLOUD_{PROJECT,LOCATION}) and threads them into LocalAgentConfig explicitly.

This override existed because older google-antigravity releases (through 0.1.5, which we pin) did not read those env vars natively: a user following the documented recipe (export env vars, construct a bare LocalAgentConfig) would fall through to the AI Studio path and hit a misleading "A Gemini API key is required" error instead of routing to Vertex.

The upstream SDK has since been fixed to read these env vars natively (LocalAgentConfig.__init__ hydrates vertex; VertexEndpoint hydrates project/location via a model_validator). That fix shipped in google-antigravity==0.1.7 (published 2026-07-16), verified present in the published wheel.

The override is now redundant and marked TODO: remove once AGY reads these env vars natively.

Plan

Tracked as two small, sequenced PRs:

  • PR 1 — Bump google-antigravity 0.1.5 → 0.1.7. Just python/antigravity/requirements.txt. Independently valuable; with the override still present, behavior is unchanged (explicit kwargs from the override simply win, same result).
  • PR 2 — Remove the _vertex_kwargs_from_env override. Depends on PR 1. Deletes the override + VertexKwargs, simplifies _build_default_config() to a bare LocalAgentConfig(system_instructions=...), and updates _has_credentials() to read GOOGLE_CLOUD_{PROJECT,LOCATION} from env (the SDK now hydrates those onto the VertexEndpoint, not the LocalAgentConfig, so the startup precheck must consult env rather than config.{project,location}). Includes the corresponding harness_server_test.py updates.

Ordering matters: PR 1 must merge first. Removing the override while still pinned to 0.1.5 would regress to the original bug.

Notes on the 0.1.5 → 0.1.7 jump

ax inherits both 0.1.6 and 0.1.7. Reviewed the SDK diff scoped to ax's surface (Agent, AgentConfig, LocalAgentConfig, types.{Text,Thought,ToolCall}, conversation.chat) — no breaking changes. New LocalAgentConfig params (env, subagents, session_continuation_mode) are additive/optional. DEFAULT_IMAGE_GENERATION_MODEL was renamed but ax doesn't reference it.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions