fix: Add error detection function and test for ZeroDivisionError and other errors alike#1332
Merged
Merged
Conversation
3 tasks
Collaborator
|
Please run "pre-commit run --all-files" to correct the file format. |
Contributor
Author
|
I updated the code checked by pre-commit. |
sitabulaixizawaluduo
previously approved these changes
May 13, 2026
Collaborator
Hi @chenzhiyi021, this PR has conflicts with `main`. Could you rebase to resolve them? Thanks! |
Contributor
Author
|
Thanks for your info. I solved the conflict. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix Python tool error handling to properly report execution failures
Currently, PythonTool.execute() always returns ToolCallStatus.SUCCESS even when code execution fails (e.g., ZeroDivisionError, syntax errors). This led to the problem of the AsyncTaskRunner crash issue during training when agent code has ZeroDivisionError.
This PR fixes the issue by:
Returning ToolCallStatus.ERROR when report != "Done"
Adding comprehensive unit tests for error scenarios
Related Issue
Fixes #1333
Type of Change
Checklist
pre-commit run --all-files)./docs/build_all.sh)main/review-prcommand/create-prBreaking Change Details (if applicable):
Additional Context
Need help? Check the Contributing Guide or ask in
GitHub Discussions!