Skip to content

fix: catch tool exceptions to prevent corrupted agent context#243

Open
Olexandr88 wants to merge 1 commit intohuggingface:mainfrom
Olexandr88:patch-1
Open

fix: catch tool exceptions to prevent corrupted agent context#243
Olexandr88 wants to merge 1 commit intohuggingface:mainfrom
Olexandr88:patch-1

Conversation

@Olexandr88
Copy link
Copy Markdown

Unexpected exceptions in _exec_tool could leave the agent context in an invalid state an assistant message with tool_calls committed but no corresponding tool results. Wrapped call_tool in try/except to always return a valid result tuple.

Added error handling for tool calls to log exceptions and return error messages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant