From fd236e1fc443245e1071eeca6d4d75f1010da2c4 Mon Sep 17 00:00:00 2001 From: Gustavo Madeira Santana Date: Fri, 3 Apr 2026 20:44:16 -0400 Subject: [PATCH] fix: preserve Unicode Vertex ADC paths --- src/plugin-sdk/anthropic-vertex-auth-presence.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/plugin-sdk/anthropic-vertex-auth-presence.ts b/src/plugin-sdk/anthropic-vertex-auth-presence.ts index 179091786e5..1e391331c0d 100644 --- a/src/plugin-sdk/anthropic-vertex-auth-presence.ts +++ b/src/plugin-sdk/anthropic-vertex-auth-presence.ts @@ -15,6 +15,14 @@ function hasAnthropicVertexMetadataServerAdc(env: NodeJS.ProcessEnv = process.en return explicitMetadataOptIn === "1" || explicitMetadataOptIn?.toLowerCase() === "true"; } +function normalizeOptionalPathInput(value: unknown): string | undefined { + if (typeof value !== "string") { + return undefined; + } + const trimmed = value.trim(); + return trimmed || undefined; +} + function resolveAnthropicVertexDefaultAdcPath(env: NodeJS.ProcessEnv = process.env): string { return platform() === "win32" ? join( @@ -29,7 +37,7 @@ function resolveAnthropicVertexAdcCredentialsPathCandidate( env: NodeJS.ProcessEnv = process.env, ): string { return ( - normalizeOptionalSecretInput(env.GOOGLE_APPLICATION_CREDENTIALS) ?? + normalizeOptionalPathInput(env.GOOGLE_APPLICATION_CREDENTIALS) ?? resolveAnthropicVertexDefaultAdcPath(env) ); }