mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-03 00:02:36 +00:00
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:
@@ -18,6 +18,9 @@ from crewai.process import Process
|
||||
from crewai.tools.tool_calling import InstructorToolCalling
|
||||
from crewai.tools.tool_usage import ToolUsage
|
||||
from crewai.utilities.errors import AgentRepositoryError
|
||||
from crewai.utilities.exceptions.context_window_exceeding_exception import (
|
||||
LLMContextLengthExceededError,
|
||||
)
|
||||
import pytest
|
||||
|
||||
from crewai import Agent, Crew, Task
|
||||
|
||||
Reference in New Issue
Block a user