mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-09 14:57:59 -05:00
Fix tool call validation error handling for Groq LLM provider (#10927)
Co-authored-by: openhands <openhands@all-hands.dev> Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
This commit is contained in:
@@ -944,6 +944,23 @@ class AgentController:
|
||||
return
|
||||
else:
|
||||
raise LLMContextWindowExceedError()
|
||||
# Check if this is a tool call validation error that should be recoverable
|
||||
elif (
|
||||
isinstance(e, BadRequestError)
|
||||
and 'tool call validation failed' in error_str
|
||||
and (
|
||||
'missing properties' in error_str
|
||||
or 'missing required' in error_str
|
||||
)
|
||||
):
|
||||
# Handle tool call validation errors from Groq as recoverable errors
|
||||
self.event_stream.add_event(
|
||||
ErrorObservation(
|
||||
content=f'Tool call validation failed: {str(e)}. Please check the tool parameters and try again.',
|
||||
),
|
||||
EventSource.AGENT,
|
||||
)
|
||||
return
|
||||
else:
|
||||
raise e
|
||||
|
||||
|
||||
Reference in New Issue
Block a user