Skip to content

Conversation

danilbogdan
Copy link

Currently there is no way to log errors other than providing failure_error_function in each function_tool decorator use. Current PR provides env variable OPENAI_AGENTS_LOG_TOOL_ERRORS that enables such logs.

@seratch seratch added enhancement New feature or request feature:core labels Sep 25, 2025
@danilbogdan danilbogdan changed the title provide env var to enable tool error logging feat: provide env var to enable tool error logging Sep 25, 2025
Copy link
Collaborator

@rm-openai rm-openai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just log them directly? You can use the existing log data flag to either just log "tool failed" or f"tool failed {input} {error}"

@danilbogdan
Copy link
Author

danilbogdan commented Sep 25, 2025

Done. However, I’m now uncertain about the purpose of this flag.

The reason of PR is that I couldn’t detect tool failures in production, not just in debug mode. I assumed that not everyone wanted to log tool errors, which is why I included the flag that, by default, maintains the current behavior but allows enabling error logs.

Now, by default, we log everything, and in debug mode, we can hide some data which is useless imho.

@seratch seratch changed the title feat: provide env var to enable tool error logging feat: add tool error logging Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature:core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants