Skip to content

[Bug] anthropic-vertex-provider 2026.7.1: "Cannot convert undefined or null to object" breaks all Claude auth (vertex-sdk 0.16.1 -> 0.19.0 regression) #107341

Closed

Description

@danieljimz

Bug type

Regression (worked before, now fails)

Summary

On the current stable release, 2026.7.1, @openclaw/anthropic-vertex-provider (Claude via Vertex AI) fails on every single message with "Failed to acquire Google OAuth credentials." — the plugin can no longer authenticate at all.

Root cause: @openclaw/anthropic-vertex-provider@2026.7.1 bumped its @anthropic-ai/vertex-sdk dependency 0.16.1 → 0.19.0, which in turn bundles gaxios@7.1.5 + google-auth-library@10.9.0. That exact combination throws Cannot convert undefined or null to object deep inside gaxios's JWT/gtoken token-exchange flow.

This looks like the same underlying crash already tracked as the canonical Google Vertex null-object bug in #38327 — but that issue is scoped to the native google-vertex provider and has been open since 2026.3.2. This is a separate plugin package (@openclaw/anthropic-vertex-provider) hitting the identical signature via its own vendored copy of the same libraries, on the current stable release, so I'm opening this fresh against 2026.7.1 rather than letting it get lost in that older thread. Full repro/isolation details cross-posted there: #38327 (comment)

Steps to reproduce

  1. Run OpenClaw 2026.7.1 with @openclaw/anthropic-vertex-provider@2026.7.1 installed (image build: openclaw plugins install @openclaw/anthropic-vertex-provider@2026.7.1)
  2. Configure a service-account JWT for ADC (GoogleAuth default credential discovery via ~/.config/gcloud/application_default_credentials.json, no GOOGLE_APPLICATION_CREDENTIALS env var)
  3. Set an agent's model to any anthropic-vertex/* model (e.g. anthropic-vertex/claude-haiku-4-5)
  4. Send any message to that agent

Expected behavior

Claude responds normally (as it does on 2026.6.1, where the plugin still pins vertex-sdk@0.16.1).

Actual behavior

Every call fails:

embedded run agent end ... isError=true error="LLM request failed."
rawErrorPreview: "Failed to acquire Google OAuth credentials."

Reproduced directly outside OpenClaw, using the exact gaxios/google-auth-library copies bundled inside the plugin's own node_modules:

const {GoogleAuth} = require("google-auth-library"); // resolved from
// .../@openclaw/anthropic-vertex-provider/node_modules/google-auth-library (10.9.0)
const auth = new GoogleAuth({scopes: ["https://www.googleapis.com/auth/cloud-platform"]});
auth.getClient().then(c => c.getAccessToken()).catch(e => { console.error(e.message); console.error(e.stack); });
Cannot convert undefined or null to object
  at Gaxios._request (.../gaxios/build/cjs/src/gaxios.js:165:23)
  at async getToken (.../google-auth-library/build/src/gtoken/getToken.js:52:26)
  at async TokenHandler.getToken (.../google-auth-library/build/src/gtoken/tokenHandler.js:83:27)
  at async JWT.refreshTokenNoCache (.../google-auth-library/build/src/auth/jwtclient.js:189:23)
  at async JWT.refreshAccessTokenAsync (.../google-auth-library/build/src/auth/oauth2client.js:288:19)
  at async JWT.getAccessTokenAsync (.../google-auth-library/build/src/auth/oauth2client.js:317:23)

Isolation performed before filing:

  • The service-account key itself is valid — the same key, loaded through OpenClaw's own global/core google-auth-library copy (not the plugin's bundled one), successfully acquires a token in the same container.
  • Plain networking is fine from the same container (fetch() to a Google endpoint succeeds) — not a proxy/DNS/egress issue.
  • gaxios@7.1.5 is within google-auth-library@10.9.0's own declared range ("gaxios": "^7.1.4"), so this isn't a stray duplicate/mismatched copy in the tree — it's a real interaction bug between these two exact pinned versions.
  • Confirmed via npm view @openclaw/anthropic-vertex-provider@2026.6.1 dependencies vs @2026.7.1: 0.16.1 → 0.19.0 is the exact version delta that introduces the breakage.

OpenClaw version

2026.7.1 (stable)

Operating system

Debian 12 (Docker container, node:24-slim base), Node.js v24.18.0

Install method

npm install -g openclaw@2026.7.1, openclaw plugins install @openclaw/anthropic-vertex-provider@2026.7.1

Logs, screenshots, and evidence

See stack trace above. Also cross-posted with full context on #38327: #38327 (comment)

Impact and severity

Severity: Critical (Claude via Vertex AI is completely unusable — every message fails)
Frequency: Always, on every message
Consequence: Blocks upgrading past 2026.6.1 for any deployment using anthropic-vertex-provider

Additional information

Related: #38327 (same crash signature, same gaxios/google-auth-library dependency-level root cause, but tracked there only against the native google-vertex provider since 2026.3.2 — this issue exists to flag that the bug also affects a separate plugin package on the current stable release, in case the two need independent fix tracks or a shared dependency-level fix).

Activity

  1. clawsweeper commented on Jul 14, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 14, 2026, 10:27 AM ET / 14:27 UTC.

    Summary
    This remains a necessary provider-specific regression report: current main still pins the Anthropic Vertex plugin to the reported @anthropic-ai/vertex-sdk 0.19.0 dependency, while the issue supplies a precise standalone failure path against that package’s bundled Google auth stack. The older Google Vertex report is useful dependency-level context but does not replace this issue because it exercises a distinct provider-owned runtime. Likely related people: @sallyom is the strongest routing candidate based on the merged provider introduction and authentication implementation history. (github.com)

    Reproducibility: yes. The issue gives a high-confidence standalone reproduction using the exact plugin-bundled Google auth dependencies, although this read-only review did not execute a real service-account token exchange.

    Next step
    The failure is narrow, current, provider-owned, and has a clear dependency boundary, so one focused repair PR is appropriate once upstream source identifies a compatible version or backport.

    Review details

    Best possible solution:

    Ship a provider-local dependency update, constraint, or upstream backport that preserves the current Anthropic Vertex API while restoring service-account ADC, with live token-acquisition and Claude request proof on supported Node versions.

    Do we have a high-confidence way to reproduce the issue?

    Yes. The issue gives a high-confidence standalone reproduction using the exact plugin-bundled Google auth dependencies, although this read-only review did not execute a real service-account token exchange.

    Is this the best way to solve the issue?

    Yes in direction: repairing or constraining the provider-owned dependency set is narrower and safer than adding a core fallback or configuration switch, but the exact version choice must be selected from upstream source and live compatibility proof.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The exact safe dependency target is not yet proven: a blind downgrade could discard SDK fixes, while retaining 0.19.0 without an upstream patch leaves service-account ADC deployments broken.
    • A dependency-only unit test cannot establish the real credential exchange contract; the repaired package needs a live service-account ADC token acquisition and Anthropic Vertex request before release.

    Codex review notes: model internal, reasoning high; reviewed against e035601b9a49.

    Label changes

    Label changes:

    • add clawsweeper:queueable-fix: Current issue advisory state selects this label.
    • add clawsweeper:fix-shape-clear: Current issue advisory state selects this label.

    Label justifications:

    • P1: The current stable release reportedly makes every Anthropic Vertex model request fail for service-account ADC deployments and blocks their upgrade from 2026.6.1.
    • impact:auth-provider: The failure occurs while acquiring Google OAuth credentials for the Anthropic Vertex provider, preventing model authentication.
    Evidence reviewed

    Acceptance criteria:

    • node scripts/run-vitest.mjs extensions/anthropic-vertex
    • git diff --check
    • Inspect upstream @anthropic-ai/vertex-sdk, google-auth-library, gaxios, and gtoken source and changelogs for the selected dependency set.
    • Run a redacted live service-account ADC getAccessToken() probe using the installed Anthropic Vertex plugin dependency tree.
    • Run a redacted live request against one anthropic-vertex/* Claude model on a supported Node version.

    What I checked:

    • Current-main dependency: At current main, the extensions/anthropic-vertex workspace still resolves @anthropic-ai/vertex-sdk to 0.19.0, so the reported dependency path has not been repaired. (github.com) (pnpm-lock.yaml:3016, e035601b9a49)
    • Standalone reproduction: The reporter invokes GoogleAuth.getClient() and getAccessToken() using the plugin-bundled google-auth-library 10.9.0 and records the null-object exception through gaxios, independently of OpenClaw’s inference loop. (github.com)
    • Stable-release regression boundary: The report compares working package 2026.6.1 against failing 2026.7.1 and identifies the Anthropic Vertex SDK change from 0.16.1 to 0.19.0; v2026.7.1 is the current stable release in the supplied repository context. (github.com) (2d2ddc43d0dc)
    • Provider ownership history: The Anthropic Vertex provider and its GCP authentication path entered main through the merged provider implementation, making the plugin the correct repair boundary. (github.com) (extensions/anthropic-vertex/index.ts:1, 6e20c4baa093)
    • Related issue distinction: The older open report concerns google-vertex Gemini requests, whereas this issue isolates the separately packaged anthropic-vertex Claude provider; the shared error signature supports coordinated dependency investigation, not duplicate closure. (github.com)
    • Upstream authentication contract: The official Anthropic Vertex SDK documents ADC through google-auth-library, and version 0.19.0 declares Google auth as a direct dependency; therefore live ADC compatibility is part of the dependency contract that a repair must verify. (npmjs.com)

    Likely related people:

    • sallyom: Authored and merged the original Anthropic Vertex provider work, including GCP ADC discovery, provider registration, model catalog, and runtime integration. (role: introduced behavior and feature owner; confidence: high; commits: 6e20c4baa093; files: extensions/anthropic-vertex/index.ts, extensions/anthropic-vertex/api.ts, extensions/anthropic-vertex/provider-catalog.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    no-staleExclude from stale automation
    clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    on Jul 14, 2026
  3. self-assigned this
    on Jul 16, 2026
  4. steipete commented on Jul 16, 2026

    @steipete
    Contributor

    Fixed on main by #108350 (dbcf7abda1e).

    The landed fix injects a provider-local GoogleAuth transport, avoids global window.fetch mutation, and preserves HTTP(S)_PROXY / NO_PROXY routing through an environment-aware Undici dispatcher.

    Proof: the Anthropic Vertex suite passed all 63 tests, exact-head hosted CI passed all 57 executable jobs, and isolated live service-account ADC acquired an OAuth token with GOOGLE_APPLICATION_CREDENTIALS unset. Authenticated Claude Sonnet 4.6 and Opus 4.6 requests reached Vertex; the test project then returned its per-model request quota error (429), not an authentication failure. Temporary test IAM access was removed afterward.

  5. locked as resolved and limited conversation to collaborators on Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.no-staleExclude from stale automation

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions