[BUG] Every bash command with Google Vertex seems to get stuck before executing

Status Fixed / completed
Maintainer reply ✓ Yes — ant-kurt
Activity 15 comments · opened May 28, 2025 · closed Jun 5, 2025
💡 Likely answer: A maintainer (ant-kurt, collaborator) responded on this thread — see the highlighted reply below.

Environment

  • Platform (select one):
  • [ ] Anthropic API
  • [ ] AWS Bedrock
  • [x] Google Vertex AI
  • [x] Other: LiteLLM (pass through vertex AI)
  • Claude CLI version: 1.0.3
  • Operating System: MacOS 15.5
  • Terminal: Iterm2

Bug Description

Bash tool seems to be hanging for 1-2min for simple commands. This doesn't seem to be the case when using Anthropic directly.

Steps to Reproduce

  1. Ask to validate script eg. scripts.sh
  2. Bash (bash -n ./scripts.sh)

Expected Behavior

Immediate request to proceed with 1. yes 2. Yes, and don't ask again 3. No and tell something differently

Actual Behavior

Hangs for 160s before requesting if we can proceed

Additional Context

<img width="853" alt="Image" src="https://github.com/user-attachments/assets/7a51efe8-63f4-409f-9cad-5342417678cf" />

View original on GitHub ↗

15 Comments

JasonAPelletier · 1 year ago

I am also experiencing this issue and can replicate following the steps outlined above

ArickHanna14 · 1 year ago

Also experiencing this issue and it's a pain

gboston · 1 year ago

@JasonAPelletier & @ArickHanna14 same environment configuration?

ArickHanna14 · 1 year ago

Yes, Google Vertex AI

ant-kurt collaborator · 1 year ago

Can you set env var ANTHROPIC_LOG=debug and see if you have a request to the ANTHROPIC_SMALL_FAST_MODEL hanging or failing? This is a "pre-flight" check done before BashTool moves forward.

ArickHanna14 · 1 year ago

So I am seeing the following in the logs, attempting to hit these urls over and over failing with a 429:

[log_5efd4d] post https://europe-west1-aiplatform.googleapis.com/v1/projects/crv-engineering-ai-prd-8058/locations/europe-west1/publishers/anthropic/models/claude-3-5-haiku@20241022:streamRawPredict failed with status 429 in 179ms - error; no more retries left
[log_5efd4d] response error (error; no more retries left) {
url: 'https://europe-west1-aiplatform.googleapis.com/v1/projects/crv-engineering-ai-prd-8058/locations/europe-west1/publishers/anthropic/models/claude-3-5-haiku@20241022:streamRawPredict',
status: 429,
headers: {
'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000',
'content-encoding': 'gzip',
'content-type': 'application/json; charset=UTF-8',
date: 'Wed, 04 Jun 2025 22:19:13 GMT',
server: 'scaffolding on HTTPServer2',
'transfer-encoding': 'chunked',
vary: 'Origin, X-Origin, Referer',
'x-content-type-options': 'nosniff',
'x-frame-options': 'SAMEORIGIN',
'x-xss-protection': '0'
},
message: undefined,
durationMs: 183
}
[log_14c374] sending request {
method: 'post',
url: 'https://europe-west1-aiplatform.googleapis.com/v1/projects/crv-engineering-ai-prd-8058/locations/europe-west1/publishers/anthropic/models/claude-3-5-haiku@20241022:streamRawPredict',
options: {
method: 'post',
path: '/projects/crv-engineering-ai-prd-8058/locations/europe-west1/publishers/anthropic/models/claude-3-5-haiku@20241022:streamRawPredict',
body: {
model: undefined,
max_tokens: 512,
messages: [Array],
system: [Array],
temperature: 1,
metadata: [Object],
stream: true,
anthropic_version: 'vertex-2023-10-16'
},
timeout: 60000,
signal: AbortSignal { aborted: false },
stream: true
},
headers: {
accept: 'application/json',
'anthropic-dangerous-direct-browser-access': 'true',
'anthropic-version': '2023-06-01',
authorization: '*',
'content-type': 'application/json',
'user-agent': 'claude-cli/1.0.11 (external, cli)',
'x-app': 'cli',
'x-goog-user-project': 'crv-engineering-ai-prd-8058',
'x-stainless-arch': 'arm64',
'x-stainless-helper-method': 'stream',
'x-stainless-lang': 'js',
'x-stainless-os': 'MacOS',
'x-stainless-package-version': '0.51.0',
'x-stainless-retry-count': '0',
'x-stainless-runtime': 'node',
'x-stainless-runtime-version': 'v23.11.0',
'x-stainless-timeout': '60'
}
}
[log_14c374] post https://europe-west1-aiplatform.googleapis.com/v1/projects/crv-engineering-ai-prd-8058/locations/europe-west1/publishers/anthropic/models/claude-3-5-haiku@20241022:streamRawPredict failed with status 429 in 166ms - error; no more retries left
[log_14c374] response error (error; no more retries left) {
url: 'https://europe-west1-aiplatform.googleapis.com/v1/projects/crv-engineering-ai-prd-8058/locations/europe-west1/publishers/anthropic/models/claude-3-5-haiku@20241022:streamRawPredict',
status: 429,
headers: {
'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000',
'content-encoding': 'gzip',
'content-type': 'application/json; charset=UTF-8',
date: 'Wed, 04 Jun 2025 22:19:15 GMT',
server: 'scaffolding on HTTPServer2',
'transfer-encoding': 'chunked',
vary: 'Origin, X-Origin, Referer',
'x-content-type-options': 'nosniff',
'x-frame-options': 'SAMEORIGIN',
'x-xss-protection': '0'
},
message: undefined,
durationMs: 170
}
[log_5e24d6] sending request {
method: 'post',
url: 'https://europe-west1-aiplatform.googleapis.com/v1/projects/crv-engineering-ai-prd-8058/locations/europe-west1/publishers/anthropic/models/claude-3-5-haiku@20241022:streamRawPredict',
options: {
method: 'post',
path: '/projects/crv-engineering-ai-prd-8058/locations/europe-west1/publishers/anthropic/models/claude-3-5-haiku@20241022:streamRawPredict',
body: {
model: undefined,
max_tokens: 512,
messages: [Array],
system: [Array],
temperature: 0,
metadata: [Object],
stream: true,
anthropic_version: 'vertex-2023-10-16'
},
timeout: 60000,
signal: AbortSignal { aborted: false },
stream: true
},
headers: {
accept: 'application/json',
'anthropic-dangerous-direct-browser-access': 'true',
'anthropic-version': '2023-06-01',
authorization: '
*',
'content-type': 'application/json',
'user-agent': 'claude-cli/1.0.11 (external, cli)',
'x-app': 'cli',
'x-goog-user-project': 'crv-engineering-ai-prd-8058',
'x-stainless-arch': 'arm64',
'x-stainless-helper-method': 'stream',
'x-stainless-lang': 'js',
'x-stainless-os': 'MacOS',
'x-stainless-package-version': '0.51.0',
'x-stainless-retry-count': '0',
'x-stainless-runtime': 'node',
'x-stainless-runtime-version': 'v23.11.0',
'x-stainless-timeout': '60'
}
}
[log_5e24d6] post https://europe-west1-aiplatform.googleapis.com/v1/projects/crv-engineering-ai-prd-8058/locations/europe-west1/publishers/anthropic/models/claude-3-5-haiku@20241022:streamRawPredict failed with status 429 in 154ms - error; no more retries left
[log_5e24d6] response error (error; no more retries left) {
url: 'https://europe-west1-aiplatform.googleapis.com/v1/projects/crv-engineering-ai-prd-8058/locations/europe-west1/publishers/anthropic/models/claude-3-5-haiku@20241022:streamRawPredict',
status: 429,
headers: {
'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000',
'content-encoding': 'gzip',
'content-type': 'application/json; charset=UTF-8',
date: 'Wed, 04 Jun 2025 22:19:17 GMT',
server: 'scaffolding on HTTPServer2',
'transfer-encoding': 'chunked',
vary: 'Origin, X-Origin, Referer',
'x-content-type-options': 'nosniff',
'x-frame-options': 'SAMEORIGIN',
'x-xss-protection': '0'
},
message: undefined,
durationMs: 156
}

ant-kurt collaborator · 1 year ago

OK - that call needs to succeed before the bash command is able to run. Can you try reducing the number of background Haiku calls going out by setting DISABLE_NON_ESSENTIAL_MODEL_CALLS=1? This should hopefully alleviate the 429.

Unfortunately there is a call to Haiku that is a requirement for BashTool to run, so there is not currently a way to bypass this.

ArickHanna14 · 1 year ago

So I launched claude with those variables DISABLE_NON_ESSENTIAL_MODEL_CALLS=1 ANTHROPIC_LOG=debug claude and I still see tons of 429s

gboston · 1 year ago

it seems to work once I activate these models on vertex AI and set it to us-east5. Is it possible to use different models that are available on europe-west1?

ant-kurt collaborator · 1 year ago

You can set the env var to a model in the supported region (see https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations#europe_1), such as ANTHROPIC_SMALL_FAST_MODEL=claude-3-haiku@20240307.

I'll check with the team and see if we can surface these sorts of errors better (though 429 is not what I would expect for region availability issues).

ArickHanna14 · 1 year ago

Setting that env var works for me and now I'm seeing bash commands execute much faster

gboston · 1 year ago

This indeed fixes the problem. Are there any plans on supporting Opus or 3.5 Haiku in other regions eg. europe-west1? They both give this 429 error on vertex.

ant-kurt collaborator · 1 year ago

You may need to reach out to the Google Vertex folks for questions about region support.

Marking this one as closed. Will see if we can improve the error logging here to make the model failures more obvious going forward.

ArickHanna14 · 1 year ago

Using us-east5 also works for us. Thanks for the help!

github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.