Doriandarko / claude-engineer

Claude Engineer is an interactive command-line interface (CLI) that leverages the power of Anthropic's Claude-3.5-Sonnet model to assist with software development tasks. This tool combines the capabilities of a large language model with practical file system operations and web search functionality.
8.82k stars 934 forks source link

Rate limit exceeded. Retrying after a short delay... repeats forever and doesn't get out of the loop #123

Open cryptotester opened 1 month ago

cryptotester commented 1 month ago

Hi,

I'm a linux user, did setup 5 USD of test credits at ANTHROPIC for the ANTHROPIC_API...

I did a little test project (wagmi dapp, in nodejs and react).

After a while I got:

Rate limit exceeded. Retrying after a short delay...

As you can see in the screenshot:

image

It went on... and on... after a few minutes I pressed Ctrl+C, hoping to get the prompt and wait for a few minutes, then tell claude engineer to go on.

2 issues here:

Expected result:

Cheers

p.s. can it be I got rate limited because i'm using the free tier with the 5 usd test credits? Regardless I think if a user runs in the rate limit issue, the program should handle this better, as described above.

brendan-aleksivich commented 1 month ago

I have both Claude Pro and the Anthropic API. I'm wondering if Claude Pro is limited with the same rates, and if it's not if the dev can make this compatible with Claude Pro to get around some of these limits?

seoplanotx commented 1 month ago

You guys need to use a custom domain email. Example: yourname@yourdomain.com

I have two accounts: one is @gmail and the other is a gsuite domain.

I only get rate limited on the @gmail email. If you fill out their form and request to be upgraded to build, your rate limit is 4000 requests a minute, etc.. you don't get rate limited I've found.

lavie commented 1 month ago

The 429 error is received also when hitting the daily token limit of 1m tokens. I get this after about an hour of work :)

The current retry logic is inappropriate for a 24h rate limit. I suggest tweaking the retry logic in the following ways:

  1. Have a maximum retry count (20 retries of 5 seconds is more than enough to get over minute-level limits)
  2. After max retries prompt the user to decide when to try again. This way the user can pick it up the next day once the daily limit is reset.
Kusnezow94 commented 1 month ago

You guys have 100% hit the rate limit of claude. Has nothing to do with the script :-) check your console in claude. you have a daily limit of 1 mio tokens in the lowest tier, that gets hit rather quickly.

cryptotester commented 1 month ago

Has nothing to do with the script

Well sorry but, usability my friend. The script should:

See what I mean? Not asking the moon, just to take care of a simple use case that be managed gracefully.

codeverlan commented 1 month ago

Agree 100% The problem is so ridiculous on my end that I'm going to have to fork it and try to come up with something

lavie commented 1 month ago

The bug might actually be worse than just usability.

See here:
https://github.com/Doriandarko/claude-engineer/blob/35dfa59b1544176ab3a5ef25e4199082ec9b3201/main.py#L929

In case of a rate limit exception it calls the chat function recursively. This leaks stack space and should eventually just run out of memory. I don't think Python knows about the tail recursion trick like LISP does.

codeverlan commented 1 month ago

...and by the way, plenty of us have domain-based e-mail addresses