From e17a068a58c7dee67a33852860e5bcae051a7f37 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Sun, 7 Dec 2025 23:09:06 -0500 Subject: [PATCH] fix(glmt): pass env vars to proxy subprocess The spawn() call was missing the env option, so ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL were not being passed to the proxy subprocess. This caused 401 Unauthorized errors. --- src/ccs.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ccs.ts b/src/ccs.ts index a6b426f4..9fa92ef4 100644 --- a/src/ccs.ts +++ b/src/ccs.ts @@ -75,8 +75,14 @@ async function execClaudeWithProxy( const proxyPath = path.join(__dirname, 'glmt', 'glmt-proxy.js'); const proxyArgs = verbose ? ['--verbose'] : []; // Use process.execPath for Windows compatibility (CVE-2024-27980) + // Pass environment variables to proxy subprocess (required for auth) const proxy = spawn(process.execPath, [proxyPath, ...proxyArgs], { stdio: ['ignore', 'pipe', verbose ? 'pipe' : 'inherit'], + env: { + ...process.env, + ANTHROPIC_AUTH_TOKEN: apiKey, + ANTHROPIC_BASE_URL: settings.env.ANTHROPIC_BASE_URL, + }, }); // 3. Wait for proxy ready signal (with timeout)