Skip to content

feat(node): Claude Code via Vertex AI on execution nodes - #10

Merged
shivchander merged 1 commit into
mainfrom
feat/node-vertex-claude
Sep 1, 2026
Merged

feat(node): Claude Code via Vertex AI on execution nodes#10
shivchander merged 1 commit into
mainfrom
feat/node-vertex-claude

Conversation

@shivchander

Copy link
Copy Markdown
Owner

What

Turnkey Claude Code via Google Vertex AI on execution nodes — an
alternative to a direct ANTHROPIC_API_KEY. Adds a vertex step to
scripts/execution-node-stack.sh.

Why

Claude Code can authenticate to Anthropic models through Vertex (Google ADC)
instead of an Anthropic key. This wires that into the node so a node-hosted
claude-agent-acp agent talks to Vertex with no per-agent config.

Changes

  • vertex() step — installs the Google ADC on the node
    (~/.config/gcloud/application_default_credentials.json, 0600) and records
    the Vertex env in NodeConfig.agent_env (CLAUDE_CODE_USE_VERTEX=1, project,
    region, ANTHROPIC_MODEL + sonnet/opus/haiku alias models,
    GOOGLE_APPLICATION_CREDENTIALS). The daemon injects agent_env into every
    agent subprocess; the node's claude CLI reads it and google-auth refreshes
    tokens itself — no gcloud needed at runtime. No-op unless
    ANTHROPIC_VERTEX_PROJECT_ID is set, so the existing ANTHROPIC_API_KEY path
    is unchanged. Wired into all (after secrets, before up).
  • runtimes() now pins node + the ACP adapters into ~/.local/bin
    (always on DAEMON_PATH). The adapters are Node scripts
    (#!/usr/bin/env node); a headless daemon PATH lacking node can't spawn
    them, so pinning makes resolution robust regardless of how the daemon starts.
  • status() reports the Vertex config + ADC presence.
  • Model IDs default to the desktop's (claude-opus-4-8[1m] etc.) and are
    override-able via env for other Vertex projects.

Usage

# copy your Google ADC to the node first, then:
ANTHROPIC_VERTEX_PROJECT_ID=my-proj VERTEX_ADC=~/adc.json just node-stack all

Testing

Validated live on the shiv-os1 node:

  • claude -p returns via Vertex with the copied authorized_user ADC —
    opus (claude-opus-4-8[1m]) and sonnet both returned OK
  • daemon advertises codex + claude; both adapters resolve on the daemon PATH
  • bash -n clean; all three embedded python heredocs compile

🤖 Generated with Claude Code

…`vertex` step)

Add a turnkey `vertex` step so a node can run Claude Code agents authenticated
to Google Vertex AI instead of a direct ANTHROPIC_API_KEY:

- `vertex()` installs the Google ADC on the node (0600) and records the Vertex
  env (CLAUDE_CODE_USE_VERTEX, project, region, ANTHROPIC_MODEL + alias models,
  GOOGLE_APPLICATION_CREDENTIALS) in NodeConfig.agent_env, which the daemon
  injects into every agent subprocess. The node's claude CLI reads these and
  google-auth refreshes tokens itself — no gcloud needed at runtime. No-op
  unless ANTHROPIC_VERTEX_PROJECT_ID is set, so the ANTHROPIC_API_KEY path is
  unchanged. Wired into `all` (after `secrets`, before `up`).
- `runtimes()` pins `node` + the ACP adapters into ~/.local/bin (always on
  DAEMON_PATH). The adapters are Node scripts (`#!/usr/bin/env node`), so a
  headless daemon PATH lacking node would fail to spawn them; pinning makes
  resolution robust regardless of how the daemon is launched.
- `status()` reports the Vertex config + ADC presence.
- Model IDs default to the desktop's (`claude-opus-4-8[1m]` etc.), override-able
  via env for other Vertex projects.

Validated live on the shiv-os1 node: `claude -p` returns via Vertex with the
copied authorized_user ADC (opus + sonnet), the daemon advertises codex +
claude, and both adapters resolve on the daemon PATH.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: shiv <shivchander.s30@gmail.com>
@shivchander
shivchander merged commit b18a44b into main Sep 1, 2026
shivchander added a commit that referenced this pull request Sep 1, 2026
…`vertex` step) (#10)

Add a turnkey `vertex` step so a node can run Claude Code agents authenticated
to Google Vertex AI instead of a direct ANTHROPIC_API_KEY:

- `vertex()` installs the Google ADC on the node (0600) and records the Vertex
  env (CLAUDE_CODE_USE_VERTEX, project, region, ANTHROPIC_MODEL + alias models,
  GOOGLE_APPLICATION_CREDENTIALS) in NodeConfig.agent_env, which the daemon
  injects into every agent subprocess. The node's claude CLI reads these and
  google-auth refreshes tokens itself — no gcloud needed at runtime. No-op
  unless ANTHROPIC_VERTEX_PROJECT_ID is set, so the ANTHROPIC_API_KEY path is
  unchanged. Wired into `all` (after `secrets`, before `up`).
- `runtimes()` pins `node` + the ACP adapters into ~/.local/bin (always on
  DAEMON_PATH). The adapters are Node scripts (`#!/usr/bin/env node`), so a
  headless daemon PATH lacking node would fail to spawn them; pinning makes
  resolution robust regardless of how the daemon is launched.
- `status()` reports the Vertex config + ADC presence.
- Model IDs default to the desktop's (`claude-opus-4-8[1m]` etc.), override-able
  via env for other Vertex projects.

Validated live on the shiv-os1 node: `claude -p` returns via Vertex with the
copied authorized_user ADC (opus + sonnet), the daemon advertises codex +
claude, and both adapters resolve on the daemon PATH.

Signed-off-by: shiv <shivchander.s30@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant