Skip to content

fix: set CLOUDSDK_PROXY_TYPE=http instead of https for gcloud#179

Open
javabrett wants to merge 1 commit intoanthropic-experimental:mainfrom
javabrett:fix/cloudsdk-proxy-type-invalid
Open

fix: set CLOUDSDK_PROXY_TYPE=http instead of https for gcloud#179
javabrett wants to merge 1 commit intoanthropic-experimental:mainfrom
javabrett:fix/cloudsdk-proxy-type-invalid

Conversation

@javabrett
Copy link
Copy Markdown

Problem

sandbox-utils.ts sets CLOUDSDK_PROXY_TYPE=https when configuring the Google Cloud SDK proxy, but https is not a valid value for that property. Every gcloud command inside the sandbox fails immediately with:

ERROR: (gcloud.projects.list) Invalid value for property [proxy/type]:
The proxy type property value [https] is not valid.
Possible values: [http, http_no_tunnel, socks4, socks5].

The error can be reproduced directly without srt:

CLOUDSDK_PROXY_TYPE=https CLOUDSDK_PROXY_ADDRESS=localhost CLOUDSDK_PROXY_PORT=8080 gcloud projects list
ERROR: (gcloud.projects.list) Invalid value for property [proxy/type]: The proxy type property value [https] is not valid. Possible values: [http, http_no_tunnel, socks4, socks5].

With the fix:

CLOUDSDK_PROXY_TYPE=http CLOUDSDK_PROXY_ADDRESS=localhost CLOUDSDK_PROXY_PORT=8080 gcloud projects list
# works

Root cause

The srt HTTP proxy is an HTTP CONNECT proxy. Most tools (curl, requests, etc.) call this an "HTTPS proxy" because it tunnels HTTPS traffic. But gcloud's CLOUDSDK_PROXY_TYPE enum uses http to mean "HTTP CONNECT proxy" — the valid values (http, http_no_tunnel, socks4, socks5) describe the proxy protocol, not the tunnelled traffic.

The comment in the code acknowledges the intent ("Use HTTPS proxy to match other HTTP-based tools") but the value chosen doesn't match gcloud's vocabulary.

Fix

Change CLOUDSDK_PROXY_TYPE=https to CLOUDSDK_PROXY_TYPE=http and update the comment to explain why.

One-line diff:

-      envVars.push(`CLOUDSDK_PROXY_TYPE=https`)
+      envVars.push(`CLOUDSDK_PROXY_TYPE=http`)

gcloud's CLOUDSDK_PROXY_TYPE accepts only: http, http_no_tunnel,
socks4, socks5. Setting it to 'https' causes every gcloud command
to fail with:

  ERROR: Invalid value for property [proxy/type]: The proxy type
  property value [https] is not valid. Possible values:
  [http, http_no_tunnel, socks4, socks5].

The srt HTTP proxy is an HTTP CONNECT proxy, which gcloud refers
to as type 'http' (not 'https'). The 'https' naming was likely
chosen to indicate the proxy handles HTTPS traffic, but that is
not what gcloud's proxy type enum means.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@javabrett javabrett force-pushed the fix/cloudsdk-proxy-type-invalid branch from 17a9ea4 to 5288ce3 Compare April 12, 2026 23:55
javabrett added a commit to javabrett/sandbox-runtime that referenced this pull request Apr 13, 2026
Identifies the local build containing two fixes pending upstream:
- fix/cloudsdk-proxy-type-invalid (PR anthropic-experimental#179)
- fix/keychain-secd-mach-lookup (PR anthropic-experimental#215)
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