magnificent-hairdresser-38202
11/17/2025, 9:52 PMMissing required parameters for function 'execute_bash': {'security_risk'} errorsnutritious-balloon-65098
11/17/2025, 9:52 PMnutritious-balloon-65098
11/17/2025, 9:57 PMMissing required parameters for function 'execute_bash': {'security_risk'} errors in the OpenHands repository.
Root Cause Identified
The issue occurs because:
1. grok-code-fast-1 is not recognized as supporting native function calling - It's missing from the FUNCTION_CALLING_PATTERNS list in openhands/llm/model_features.py
2. OpenHands falls back to text-based function call conversion - Since the model isn't in the function calling patterns, OpenHands uses the function call converter (openhands/llm/fn_call_converter.py)
3. Strict parameter validation fails - The converter requires all mandatory parameters including security_risk, but grok-code-fast-1 omits this parameter when generating text-based function calls
4. Error occurs during validation - The validation error is thrown at line 693 in fn_call_converter.py
Evidence Found
• Model capabilities: Research confirms grok-code-fast-1 supports "tool use", "function calling", and "structured output"
• Current configuration: The model is only listed in SUPPORTS_STOP_WORDS_FALSE_PATTERNS but missing from FUNCTION_CALLING_PATTERNS
• Recent commit: Found commit d5d5e265f that added grok-code-fast-1 to the stop words exclusion list but didn't add function calling support
Recommended Solution
Add grok-code-fast-1 to the FUNCTION_CALLING_PATTERNS list in `openhands/llm/model_features.py`:
FUNCTION_CALLING_PATTERNS: list[str] = [
# ... existing patterns ...
# xAI Grok models
'grok-code-fast-1',
# ... rest of patterns ...
]
This solution:
• ✅ Addresses the root cause by enabling native function calling
• ✅ Aligns with the model's actual capabilities
• ✅ Follows existing patterns for other function-calling models
• ✅ Provides better performance and reliability than text conversion
• ✅ Has minimal risk (only affects grok-code-fast-1)
No code changes were made as this was an investigation task. The user should implement the recommended solution by adding 'grok-code-fast-1' to the FUNCTION_CALLING_PATTERNS list to resolve the missing security_risk parameter errors.
<sub>View full conversation</sub>magnificent-hairdresser-38202
11/17/2025, 10:08 PMnutritious-balloon-65098
11/17/2025, 10:12 PMMissing required parameters for function 'execute_bash': {'security_risk'} errors in the OpenHands repository.
Root Cause Identified
The issue occurs because:
1. grok-code-fast-1 is not recognized as supporting native function calling - It's missing from the FUNCTION_CALLING_PATTERNS list in openhands/llm/model_features.py
2. OpenHands falls back to text-based function call conversion - Since the model isn't in the function calling patterns, OpenHands uses the function call converter (openhands/llm/fn_call_converter.py)
3. The converter strictly validates required parameters - When parsing text-based function calls, it requires all mandatory parameters including security_risk
4. The model omits the security_risk parameter - When generating text-based function calls, grok-code-fast-1 doesn't consistently include the security_risk parameter, causing validation to fail at line 693 in fn_call_converter.py
Configuration That Forces Native Function Calling
Answer to your question: The configuration that forces turning on native function calling is the FUNCTION_CALLING_PATTERNS list in openhands/llm/model_features.py. Models listed in this array are recognized as supporting native function calling and bypass the text-based function call converter entirely.
Recommended Solution
Add 'grok-code-fast-1' to the FUNCTION_CALLING_PATTERNS list in openhands/llm/model_features.py. Research confirms that grok-code-fast-1 officially supports "tool use", "function calling", and "structured output" according to xAI documentation.
This would enable native function calling for grok-code-fast-1, eliminating the need for error-prone text-based function call conversion and resolving the missing security_risk parameter issue.
Key Files Involved
• openhands/llm/model_features.py - Contains function calling patterns
• openhands/llm/fn_call_converter.py - Where the validation error occurs
• openhands/agenthub/codeact_agent/tools/bash.py - Defines the execute_bash tool with required security_risk parameter
No code changes were made as this was an investigation task. The solution would require adding grok-code-fast-1 to the function calling patterns to enable its native function calling capabilities.
<sub>View full conversation</sub>nutritious-balloon-65098
11/17/2025, 10:15 PMgrok-code-fast-1 model encounters Missing required parameters for function 'execute_bash': {'security_risk'} errors because:
1. grok-code-fast-1 is not recognized as supporting native function calling - It's missing from FUNCTION_CALLING_PATTERNS in openhands/llm/model_features.py
2. OpenHands falls back to text-based function call conversion - When is_function_calling_active() returns False, the system uses convert_fncall_messages_to_non_fncall_messages() and convert_non_fncall_messages_to_fncall_messages()
3. The converter strictly validates required parameters - The validation occurs in _extract_and_validate_params() in openhands/llm/fn_call_converter.py at line 693
4. The model omits the security_risk parameter - When generating text-based function calls, grok-code-fast-1 doesn't include the required security_risk parameter
Configuration That Forces Native Function Calling
Answer to your question: Yes, the native_tool_calling LLM config would work! Here's how:
# In LLMConfig (openhands/core/config/llm_config.py):
native_tool_calling: bool | None = Field(default=None)
How it works:
# In openhands/llm/llm.py lines 539-542:
features = get_features(self.config.model)
if self.config.native_tool_calling is None:
self._function_calling_active = features.supports_function_calling # Uses model patterns
else:
self._function_calling_active = self.config.native_tool_calling # Uses explicit config
To fix the grok-code-fast-1 issue, users can set:
[llm]
model = "grok-code-fast-1"
native_tool_calling = true
This would bypass the problematic function call converter and use native function calling directly.
Recommended Long-term Solution
Add 'grok-code-fast-1' to FUNCTION_CALLING_PATTERNS in openhands/llm/model_features.py since research confirms the model supports native function calling, tool use, and structured outputs.
Key Insight
The native_tool_calling config provides a manual override that can force any model to use (or not use) native function calling, regardless of what the model feature patterns indicate. This is the immediate workaround for the grok-code-fast-1 issue.
<sub>View full conversation</sub>magnificent-hairdresser-38202
11/19/2025, 6:04 AMnative_tool_calling config works, which proves this grok-code-fast-1 supports native tool calling. Please create a PR to add this model to FUNCTION_CALLING_PATTERNS listnutritious-balloon-65098
11/19/2025, 6:04 AM