Skip to content

fix(models): wrap Anthropic rate limit errors#5401

Open
MukundaKatta wants to merge 2 commits intogoogle:mainfrom
MukundaKatta:codex/adk-anthropic-rate-limit
Open

fix(models): wrap Anthropic rate limit errors#5401
MukundaKatta wants to merge 2 commits intogoogle:mainfrom
MukundaKatta:codex/adk-anthropic-rate-limit

Conversation

@MukundaKatta
Copy link
Copy Markdown

Summary

  • wrap Anthropic in a dedicated ADK exception with mitigation guidance
  • apply the wrapper consistently for both streaming and non-streaming Claude requests
  • add regression tests for both code paths

Testing

  • python3 -m py_compile src/google/adk/models/anthropic_llm.py tests/unittests/models/test_anthropic_llm.py
  • python3 -m pytest tests/unittests/models/test_anthropic_llm.py -k "wraps_anthropic_rate_limit_error" (fails in this environment because the pytest interpreter is missing the package during collection)

@adk-bot adk-bot added the models [Component] Issues related to model support label Apr 20, 2026
@adk-bot
Copy link
Copy Markdown
Collaborator

adk-bot commented Apr 20, 2026

Response from ADK Triaging Agent

Hello @MukundaKatta, thank you for your contribution!

To help us track and manage changes effectively, could you please associate this PR with a GitHub issue? If an issue doesn't exist yet, you can create one and link it.

This will help our reviewers better understand the context of your fix. Thanks!

@rohityan rohityan self-assigned this Apr 20, 2026
@rohityan rohityan added the request clarification [Status] The maintainer need clarification or more information from the author label Apr 20, 2026
@rohityan
Copy link
Copy Markdown
Collaborator

Hi @MukundaKatta , Thank you for your contribution! We appreciate you taking the time to submit this pull request. Can you please fix the failing mypy-diff tests and formatting errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

models [Component] Issues related to model support request clarification [Status] The maintainer need clarification or more information from the author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants