Implemented
29
Wait/retry when agent hits rate limits (don't just error)
Source: zed-industries/zed#31531 · opened by @notpeter
Summary
When a user encounters a recoverable rate-limit error when bringing their own API Key (Anthropic/OpenAI) instead of erroring, wait. Use hints in the response headers.
Description
For example, the current error message for OpenAI is:
> Failed to connect to OpenAI API: Rate limit reached for gpt4.1 in organization org-<myorg> on tokens per min (TPM): Limit 30000, Used 25292, Requested 10584. Please try again in 11.75s. Visit to learn more
Anthropic header is retry-after (seconds: 59)
OpenAI is x-ratelimit-reset-requests / x-ratelimit-reset-tokens (1m30s)
Docs:
• [OpenAI Rate Limits](
• [Anthropic Rate Limits](
I have not been able to find reference to response headers in the [Google Gemini Rate Limit docs]( or for Copilot Chat which specify rate limits.
When a user encounters a recoverable rate-limit error when bringing their own API Key (Anthropic/OpenAI) instead of erroring, wait. Use hints in the response headers.
Description
For example, the current error message for OpenAI is:
> Failed to connect to OpenAI API: Rate limit reached for gpt4.1 in organization org-<myorg> on tokens per min (TPM): Limit 30000, Used 25292, Requested 10584. Please try again in 11.75s. Visit to learn more
Anthropic header is retry-after (seconds: 59)
OpenAI is x-ratelimit-reset-requests / x-ratelimit-reset-tokens (1m30s)
Docs:
• [OpenAI Rate Limits](
• [Anthropic Rate Limits](
I have not been able to find reference to response headers in the [Google Gemini Rate Limit docs]( or for Copilot Chat which specify rate limits.
No pledges yet. Be the first to back this.
Comments
Similar requests
Agent: Support timeout for terminal tool calls
4 votes · 0 comments
Support http_client injecting GITHUB_TOKEN (fix for GitHub 403 response: API rate limit exceeded errors)
71 votes · 0 comments
Using `zed --wait` from the integrated terminal does not focus that terminal when closing the opened buffer.
4 votes · 0 comments
Windows: Changing the shell setting breaks some things
1 vote · 0 comments
Skill delete in Zed Agent deletes the whole folder from SSH connected server instead of disconnecting the skill
0 votes · 0 comments
No comments yet.