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_window value in the UI
- The value is saved to the database
- However, the CrewAI agent always uses
True regardless 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 the additional_params list
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.
Bug Description
The
respect_context_windowparameter is not being properly read from the agent configuration when creating CrewAI agents. Instead, it's hardcoded toTrue.Current Behavior
In
src/backend/src/engines/crewai/helpers/agent_helpers.py(line 514), the parameter is hardcoded:Expected Behavior
The parameter should be read from the agent configuration:
Impact
respect_context_windowvalue in the UITrueregardless of the saved settingAdditional Issue
The
respect_context_windowparameter is also missing from theadditional_paramslist (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.pySuggested Fix
'respect_context_window'to theadditional_paramslistContext
The parameter is properly implemented in:
src/backend/src/models/agent.py:58)src/frontend/src/types/agent.ts:78)But the actual usage in the CrewAI engine ignores the configured value.