feat(node): Claude Code via Vertex AI on execution nodes - #10
Merged
Conversation
…`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
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>
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.
What
Turnkey Claude Code via Google Vertex AI on execution nodes — an
alternative to a direct
ANTHROPIC_API_KEY. Adds avertexstep toscripts/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-acpagent 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 recordsthe Vertex env in
NodeConfig.agent_env(CLAUDE_CODE_USE_VERTEX=1, project,region,
ANTHROPIC_MODEL+sonnet/opus/haikualias models,GOOGLE_APPLICATION_CREDENTIALS). The daemon injectsagent_envinto everyagent subprocess; the node's
claudeCLI reads it and google-auth refreshestokens itself — no gcloud needed at runtime. No-op unless
ANTHROPIC_VERTEX_PROJECT_IDis set, so the existingANTHROPIC_API_KEYpathis unchanged. Wired into
all(aftersecrets, beforeup).runtimes()now pinsnode+ the ACP adapters into~/.local/bin(always on
DAEMON_PATH). The adapters are Node scripts(
#!/usr/bin/env node); a headless daemon PATH lackingnodecan't spawnthem, so pinning makes resolution robust regardless of how the daemon starts.
status()reports the Vertex config + ADC presence.claude-opus-4-8[1m]etc.) and areoverride-able via env for other Vertex projects.
Usage
Testing
Validated live on the
shiv-os1node:claude -preturns via Vertex with the copiedauthorized_userADC —opus (
claude-opus-4-8[1m]) and sonnet both returned OKcodex+claude; both adapters resolve on the daemon PATHbash -nclean; all three embedded python heredocs compile🤖 Generated with Claude Code