Repository navigation
fix: surface non-FINISHED DelegateTool sub-agents as errors - #6498
Open
Christian-Sidak wants to merge 1 commit into
Open
Christian-Sidak wants to merge 1 commit into
Christian-Sidak wants to merge 1 commit into
Conversation
DelegateExecutor._delegate_tasks never checked conversation.state.execution_status, so sub-agents that ended in ERROR, STUCK, or PAUSED were reported as ordinary completed results with is_error=False. This brought it in line with the TaskManager fix from e75b9c2 (OpenHands#3742). Changes: - Add ConversationErrorEvent import to delegate/impl.py - Add _run_stop_detail static method (mirrors TaskManager) that extracts the reason a sub-agent stopped and preserves any partial output - In run_task: check execution_status after _run_until_finished; only FINISHED goes into results, all other statuses go into errors with status name + detail - Pass is_error=bool(errors) to the final DelegateObservation Add four regression tests covering FINISHED, ERROR, STUCK, and mixed outcomes. Fixes OpenHands#6488 Signed-off-by: Christian Sidak <christian@sentineltech.eu> Signed-off-by: Christian-Sidak <61099993+Christian-Sidak@users.noreply.github.com>
1 of 8 tasks
Draft
1 of 5 tasks
Author
|
Checking in on this. The fix ensures that when a DelegateTool sub-agent finishes in a non-FINISHED state (FAILED, REJECTED, CANCELLED, etc.) the caller sees an error result rather than an empty success. CI is green. |
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.
HUMAN:
This fix addresses silent error swallowing in DelegateTool where non-FINISHED sub-agent outcomes (ERROR, STUCK, PAUSED) were being silently reported as successful results with is_error=False, making it impossible for callers to detect that a delegated sub-agent had failed.
AGENT:
Why
DelegateExecutor._delegate_tasks never checked conversation.state.execution_status after running a sub-agent, so ERROR, STUCK, and PAUSED outcomes were silently reported as ordinary results with is_error=False. This meant callers had no way to detect that a delegated sub-agent had failed.
Summary
Issue Number
Fixes #6488
How to Test
Run the new unit tests:
New tests:
All 20 existing tests in tests/tools/delegate/test_delegation.py continue to pass.
Video/Screenshots
No visual changes. See test output above.
Design Doc
No design doc needed for this targeted bug fix.
Type
Notes
The _run_stop_detail helper mirrors the pattern from TaskManager._run_stop_detail (#3742) for consistency.