Fix: Replace SystemExit with LLMContextLengthExceededError in handle_context_length

- Changed handle_context_length to raise LLMContextLengthExceededError instead of SystemExit when respect_context_window=False
- This allows proper exception handling and prevents the entire application from terminating
- Added comprehensive unit tests to verify the fix
- Updated test imports to include LLMContextLengthExceededError

Fixes #3774

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2025-10-22 04:53:24 +00:00
parent 4371cf5690
commit 6dcc7ac725
4 changed files with 4098 additions and 3972 deletions

7918
uv.lock generated

File diff suppressed because it is too large Load Diff