-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Bug Description
The respect_context_window parameter is not being properly read from the agent configuration when creating CrewAI agents. Instead, it's hardcoded to True.
Current Behavior
In src/backend/src/engines/crewai/helpers/agent_helpers.py (line 514), the parameter is hardcoded:
'respect_context_window': True,Expected Behavior
The parameter should be read from the agent configuration:
'respect_context_window': agent_config.get('respect_context_window', True),Impact
- Users can set the
respect_context_windowvalue in the UI - The value is saved to the database
- However, the CrewAI agent always uses
Trueregardless of the saved setting
Additional Issue
The respect_context_window parameter is also missing from the additional_params list (lines 518-522), which may prevent it from being properly handled even if read from the config.
Files Affected
src/backend/src/engines/crewai/helpers/agent_helpers.py
Suggested Fix
- Change line 514 to read from agent_config
- Add
'respect_context_window'to theadditional_paramslist
Context
The parameter is properly implemented in:
- Database model (
src/backend/src/models/agent.py:58) - Pydantic schemas with default value of True
- Frontend TypeScript types (
src/frontend/src/types/agent.ts:78) - Frontend forms allow configuration
But the actual usage in the CrewAI engine ignores the configured value.
Metadata
Metadata
Assignees
Labels
No labels