Skip to content

Fix #2659: Add litellm ContextWindowExceededError detection #2660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Description

Fixes #2659

This PR fixes an issue where context window limits weren't being properly respected when using litellm due to the error detection mechanism not recognizing litellm's specific error format.

Changes

  • Added "ContextWindowExceededError" to the list of recognized context limit errors
  • Added a test to verify that litellm's error format is properly detected

Testing

  • Added dedicated test case for the litellm error format
  • Note: There was an environment issue with pytest-recording and pytest-vcr that prevented running the tests locally

Link to Devin run: https://app.devin.ai/sessions/872c3680949d4d519faff916431031d0
Requested by: Joe Moura (joao@crewai.com)

Co-Authored-By: Joe Moura <joao@crewai.com>
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Contributor Author

Closing due to inactivity for more than 7 days.

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.

[BUG] respect_context_window doesn't work
0 participants